[MUSIC]
[APPLAUSE]
ROBBIE: Hey, dad.
Can I ask you a question?
TODD: Why sure Robbie.
That's what I'm here for.
ROBBIE: Yeah, speaking of which, aren't you supposed to be like,
at a job or something?
TODD: Listen Robbie, I'm in between opportunities
right now.
And so I'm taking that time to build up my personal brand
and my social media presence.
ROBBIE: Hmm.
So you mean you're like, on Twitter all day and stuff, dad?
[LAUGHTER]
TODD: It's grown up stuff.
You wouldn't understand.
Anyway, what's your question?
ROBBIE: Well, you remember last time I installed a CocoaPod,
its version number had a squiggly arrow
in front of it and stuff?
TODD: I sure do.
ROBBIE: Well, you never really did tell me what that means,
dad.
TODD: Why I guess I didn't, did I?
Well, follow me, Robbie, to the wall of knowledge.
ROBBIE: Oh, you mean that projector screen over there?
[LAUGHTER]
TODD: Just watch me.
So to answer your question a little better,
I probably need to explain to you
what semantic versioning is.
In semantic versioning, libraries
have version numbers that are broken
into three parts that look a little something like this.
Now, let's explore these numbers from right to left.
The number on the right is the patch number.
As a general rule, anytime an author
makes any kind of bug fix to their library that
doesn't break backwards compatibility--
and let's face it, you shouldn't be
breaking backwards compatibility for a bug
fix-- they increment this number.
The number in the middle is the minor release number.
Library authors will increment this
when they add a new feature.
But again, generally, if they do it
in a backwards compatible way.
Now the number on the left is the major release number.
Library authors will increment this
when they make changes to their code that
breaks backwards compatibility.
ROBBIE: I think I get it.
So, if you fixed a crash bug in your library--
TODD: I might change the version number to 1.4.8,
as long as the change is backwards compatible.
ROBBIE: And if you added a new feature?
TODD: I would change the version number to 1.5.0.
ROBBIE: OK.
But let's say you made a fix that
changed the signature of some of your method calls.
TODD: Right.
Well, that's not backwards compatible.
So I might change my version to 2.0.0.
ROBBIE: Oh.
I get it.
But wait.
You still haven't explained what the squiggly line means, dad.
TODD: Well, let's say you have version 1.4.7 installed.
Would you want CocoaPods to automatically
update your library to 1.4.8 when you call pod update?
ROBBIE: Well, that sounds safe.
Because it's not breaking the change, right?
You're just fixing the crash bug.
TODD: That's right.
Now, let's say you have version 1.4.8.
Would you want CocoaPods to automatically
update your library to 1.5.0 when you call pod update?
ROBBIE: Well, yeah, I guess so.
I mean, the developers have just added new features.
Nothing should break, right?
TODD: Yeah, that's probably true.
ROBBIE: Probably?
TODD: We'll get back to that.
So here's the $64,000 question.
Let's say you have version 1.5.0.
Would you want CocoaPods to automatically
update your library to 2.0.0 when you call pod update?
ROBBIE: Well, probably not.
You've changed the major version, which
means there's changes in there that will break my code
and my project won't compile.
TODD: Correct.
You got it.
ROBBIE: Hooray!
But what does any of this have to do
with the squiggly arrow, dad?
TODD: So the squiggly arrow means
that you're OK letting CocoaPods automatically
upgrade your library, but only if it
increments the last version number you specified.
ROBBIE: Hmm?
TODD: Let's say you have squiggly arrow 1.4.7.
That means you're totally fine having CocoaPods upgrade you
to 1.4.8, 1.4.9, and 1.4.10, but not 1.5.0.
Similarly, squiggly arrow 1.4 means
you're fine having CocoaPods upgrade you
to 1.4.8, 1.4.9, 1.5.0, 1.6.2, but not, say, 2.0.0.
ROBBIE: Well, what if I have squiggly arrow 1 1?
TODD: Well, that means you're OK having CocoaPods automatically
update your library to just about anything.
At that point you might as well not include any version number
at all.
ROBBIE: Well that seems pretty worthless, dad.
TODD: It is.
Just like my brother-in-law.
[LAUGHTER]
ROBBIE: And what if I don't want to use a squiggly line at all,
dad?
TODD: CocoaPod supports a number of operations all of which
work pretty much like you'd expect.
ROBBIE: OK.
So, hmm, why would I ever want to upgrade just the patch
version?
It seems like I should be able to upgrade the patch version
and and the minor version anytime I want.
Right, dad?
TODD: Well, in theory yes.
In practice sometimes you'll find
the developers do add small breaking changes here or there
when they upgrade their minor version.
Maybe developers making bug fixes,
and it turns out one of their fixes
adds another argument to one of their methods.
Well, you know, technically it's non-backwards compatible.
The API surface has changed.
But changing the major version seems pretty drastic
here for what's essentially a minor bug fix.
And so perhaps they compromise and change the minor version
instead.
Usually these situations are pretty easy to fix.
But they do happen.
ROBBIE: But doesn't that break the whole semantic versioning
rule?
TODD: Well, yes.
But it's important to remember that semantic versioning is
just a convention.
Nobody anywhere is going to enforce it, or eject a CocoaPod
that doesn't follow it.
And so, there is a small risk that your code
might break even when only the minor version number changes.
So you'll find that some CocoaPod users are only
comfortable updating their libraries
when the patch number changes.
Other developers are OK with updating their library
when the minor number changes.
It probably depends on how much you
feel like living on the edge, and how comfortable
you feel with a pod developer following semantic versioning.
ROBBIE: So what about Google?
Have they promised to follow semantic versioning
in their CocoaPods, dad?
TODD: I think it's safe to say most groups at Google
try to follow semantic versioning.
But the groups that are part of the new, automated CocoaPod
publishing process are a little better at it.
ROBBIE: Well, that'll help me sleep better at night.
Say, does this squiggly line have an official name dad?
TODD: Yes, it's called a twiddle wakka.
ROBBIE: You're joking, right?
TODD: I don't joke about things like this.
[LAUGHTER]
So there you go son.
All your questions about the squiggly arrow answered.
ROBBIE: Don't you mean the twiddle wakka wakkas, dad?
[LAUGHTER]
TODD: Oh.
But seriously, correct me again and I will cut your [BLEEP]
[BLEEP] off.
[AUDIENCE GROAN]
ROBBIE: Don't you mean the twiddly wakkas, dad?
TODD: But seriously, correct me again,
I'm going to ship you off to military school.