22: Version Control
00:00:00
◼
►
Welcome to Under the Radar, a show about independent iOS app development.
00:00:03
◼
►
I'm Marco Arment.
00:00:04
◼
►
And I'm David Smith.
00:00:05
◼
►
Under the Radar is never longer than 30 minutes, so let's get started.
00:00:09
◼
►
So today we wanted to talk about version control.
00:00:12
◼
►
And this is a great collaboration tool.
00:00:16
◼
►
And therefore, the two of us who work by ourselves
00:00:20
◼
►
are going to tell you all about it.
00:00:23
◼
►
Drawing on our vast experience about using version control
00:00:26
◼
►
with all the clever things you hear about with, like,
00:00:29
◼
►
git, and you can have merging and branching strategies and rebasing and all the things
00:00:34
◼
►
that thankfully I never have to deal with because I tend to just work by myself and
00:00:38
◼
►
I'm collaborating with myself. And so thankfully things typically, like merge conflicts, not
00:00:44
◼
►
a big problem for me, it turns out. But still, I think version control is a very important
00:00:49
◼
►
part of the discipline of software engineering. And so it seemed like it was something that
00:00:54
◼
►
was worth discussing, even if obviously, jokingly, some of the more collaborative parts of it
00:00:59
◼
►
aren't as relevant for us?
00:01:01
◼
►
- I mean, for me, I have mostly the same situation
00:01:03
◼
►
in that I'm mostly collaborating with nobody,
00:01:07
◼
►
but there have been times where I've seen
00:01:09
◼
►
a lot of the value of it.
00:01:09
◼
►
For instance, I used to work at normal jobs
00:01:11
◼
►
where I had other people working with me,
00:01:13
◼
►
so we would do things there,
00:01:14
◼
►
but that was back in the subversion days,
00:01:17
◼
►
and it was much simpler,
00:01:19
◼
►
and it was still very small teams.
00:01:22
◼
►
And these days, I mostly don't do any kind of collaboration.
00:01:27
◼
►
However, I do have a couple of open source projects
00:01:31
◼
►
that I run and most of them get no activity whatsoever,
00:01:36
◼
►
but a few of them do get third party contributions
00:01:38
◼
►
and I have done, you know, get pull requests
00:01:41
◼
►
and merges and stuff like that and those things,
00:01:45
◼
►
so I have minimal experience there
00:01:48
◼
►
and you and I actually just started accidentally
00:01:51
◼
►
collaborating on something and I don't think
00:01:53
◼
►
it's even worth mentioning what it is.
00:01:54
◼
►
It's a very, very narrow need that both of us
00:01:57
◼
►
happen to have and almost nobody else does.
00:02:00
◼
►
I committed to your code base the other day,
00:02:03
◼
►
and that was like the first time I've ever committed
00:02:06
◼
►
to someone else's iOS code base.
00:02:09
◼
►
And you said that was probably the first time
00:02:11
◼
►
that anyone's ever committed to yours, right?
00:02:13
◼
►
- It's been a very long time, since like 2011, 2012,
00:02:17
◼
►
I think was the last time I had any kind of collaboration.
00:02:21
◼
►
So yes, it is very much a rare thing,
00:02:24
◼
►
but it was kind of fun.
00:02:24
◼
►
Like I was like, oh, someone else,
00:02:26
◼
►
It's like I have to do a fetch and a pull
00:02:28
◼
►
rather than just a push.
00:02:30
◼
►
This is novel and exciting.
00:02:32
◼
►
- Yeah, I don't know how I would deal with that in my apps.
00:02:35
◼
►
I'd probably fix all the style differences,
00:02:38
◼
►
which is like this huge faux pas to like
00:02:40
◼
►
restyle someone else's commit.
00:02:42
◼
►
- But yeah, version control, there is definitely,
00:02:45
◼
►
collaboration is an important part of that,
00:02:46
◼
►
and there are lots of different ways to deal with that.
00:02:49
◼
►
Like obviously, we're saying for us,
00:02:51
◼
►
we don't do as much from a collaboration perspective,
00:02:53
◼
►
but I've worked in companies where it's an important thing,
00:02:56
◼
►
And there's lots of great mechanisms for this now.
00:02:59
◼
►
Like this is something that I think back to.
00:03:01
◼
►
I think my first version control system was CVS, I think.
00:03:05
◼
►
- And then I went to Subversion and then to Git.
00:03:08
◼
►
And every time, like the tool itself gets better
00:03:11
◼
►
and less awkward and less cumbersome.
00:03:13
◼
►
And I think about the things that are,
00:03:15
◼
►
even things like GitHub or Bitbucket,
00:03:18
◼
►
or there's lots of kind of these online
00:03:20
◼
►
backs or front ends for the repository,
00:03:24
◼
►
which makes so many of these things so helpful.
00:03:26
◼
►
And while I don't do a lot of it, whenever I've had to do something like that, where
00:03:30
◼
►
you have like, you submit a pull request, and you can have notes and code review, and
00:03:34
◼
►
a lot of these things are nice and clear and obvious, rather than just kind of sitting
00:03:38
◼
►
there at the command line trying to work out what's going on when someone else submits
00:03:44
◼
►
code, and it crashes into yours, and things are horrible and broken.
00:03:49
◼
►
And you can do some pretty powerful things too.
00:03:51
◼
►
I remember back with my early days of version control where you would check out specific
00:03:57
◼
►
files that you were going to change, and things like that that would be very cumbersome, and
00:04:02
◼
►
you'd be like, every now and then you'd go down the hall and ask Jim down the hall, "Hey,
00:04:06
◼
►
are you done with that header?
00:04:08
◼
►
Because I need to add something to it for my part of this app."
00:04:12
◼
►
And things like that which most modern version control systems can just deal with in terms
00:04:17
◼
►
of they'll, you know, if you edit the top and he edits the bottom, it just goes and
00:04:21
◼
►
that's fine. And, you know, that can sometimes be problematic if he's changing something
00:04:24
◼
►
in one way and you're changing it in another, but, you know, by and large, collaboration
00:04:29
◼
►
is much easier from a version control perspective than it used to be, because you can just,
00:04:34
◼
►
you have these nice visual tools and, you know, mechanisms by which you can, you know,
00:04:39
◼
►
each share access into a repository.
00:04:42
◼
►
- Yeah, I mean, it is so nice to have modern conveniences
00:04:46
◼
►
with these things and modern advancements.
00:04:49
◼
►
I mean, I too, I never did the systems where checkouts
00:04:53
◼
►
are exclusive to one person, but just basics of versioning
00:04:57
◼
►
and merging from all these systems are great.
00:05:00
◼
►
And especially branching became a lot easier with Git
00:05:04
◼
►
and the DBCS model, and these things, I mean,
00:05:08
◼
►
it just helps so much when you're working on a team.
00:05:10
◼
►
And also when you're working by yourself,
00:05:12
◼
►
and I think that's what we're gonna talk about too,
00:05:13
◼
►
is like even when you're working alone,
00:05:15
◼
►
these systems provide invaluable help,
00:05:18
◼
►
and I think every developer, this is actually,
00:05:22
◼
►
I know that not every developer who works for themselves
00:05:26
◼
►
does version control, and I think not doing it
00:05:28
◼
►
is a huge mistake.
00:05:29
◼
►
- Yes, I don't even know how, I mean,
00:05:31
◼
►
that just seems like, that's like the wild, wild west,
00:05:34
◼
►
where like, are you like copying folders,
00:05:36
◼
►
like anytime, you know, like it's when you have
00:05:38
◼
►
like version one, version two, version three,
00:05:40
◼
►
like, oh, that's chilling. Yes, use version control. Whatever it is, it's one of these
00:05:46
◼
►
it doesn't really matter which one you choose. Like, if you're a Git person, a Mercurial
00:05:50
◼
►
person, if you want to use subversion, if you want to do something else, that's fine.
00:05:53
◼
►
But you have to use something. Because I think the thing that you also can keep in mind with
00:05:59
◼
►
version control is it's a powerful development tool. In the way that you and I, we probably
00:06:05
◼
►
spend most of our development time in Xcode or in some ways in some like TextMate or something,
00:06:09
◼
►
if you're doing web programming. But the tool of version control is a pretty powerful one
00:06:18
◼
►
in terms of it being a part of your development process and allowing you to do things that
00:06:24
◼
►
would otherwise be really awkward. Like, I love in Git having lightweight branching of
00:06:28
◼
►
being able to be like, I have this idea for a way to kind of restructure something or
00:06:34
◼
►
or do a big refactor, or take some code and take it in a different direction.
00:06:40
◼
►
And I can just branch off from my main thing, try it for a few days, and if I end up, it
00:06:47
◼
►
turns out to be just this complete dead end, I can sort of just throw that away and go
00:06:52
◼
►
back to where I started from in a way that is nice and clean and reliable and isn't going
00:06:57
◼
►
to break something, or if I want to just cherry pick part of that in, I can do that in a controlled
00:07:04
◼
►
also just to look at what I've been doing. Like sometimes I'll, you know, it's being
00:07:08
◼
►
able to look at the, like in some ways you'd think like the blame part of version control
00:07:16
◼
►
if you work by yourself. And if you're not familiar, like blame in most version control
00:07:20
◼
►
systems, you can look at any line of code and see who created it and when that was created
00:07:25
◼
►
in the history of your project. You know, and so this is the classic, like if someone
00:07:28
◼
►
breaks the build, you can run blame on it and see who broke it. But even for myself,
00:07:33
◼
►
Like when the names are always me, it's often really helpful to be able to look back and
00:07:37
◼
►
be like, "Why am I doing this this way?"
00:07:40
◼
►
And I can go back and say, "Huh, interesting.
00:07:41
◼
►
I added this two years ago when I was working on X feature."
00:07:47
◼
►
And that's often really, really, really helpful to be able to look back and to understand
00:07:52
◼
►
my own code even better, and even more so if you're collaborating with someone else.
00:07:59
◼
►
And even just to be able to, like one thing I always do in my development cycle is I take
00:08:06
◼
►
the last commit that, like the version that I just released, and whenever I'm getting
00:08:11
◼
►
ready to submit to the app store, like the very last step before I hit actual archive
00:08:16
◼
►
and submit to the app store, is I always go and run a diff between the last submitted
00:08:21
◼
►
version and my current version of the code.
00:08:24
◼
►
And I just go through, like sort of line by line in all the changes, and make sure that
00:08:28
◼
►
that there's nothing in there that jumps out at me
00:08:30
◼
►
is like, whoa, why is this still in here?
00:08:33
◼
►
Or like, that doesn't seem right.
00:08:35
◼
►
And I've caught several bugs in my process that way
00:08:39
◼
►
by using version control as a tool
00:08:42
◼
►
to help me write better code.
00:08:44
◼
►
- Yeah, I mean, the biggest value of it as independent
00:08:47
◼
►
is that it's giving you a tool that can show you
00:08:50
◼
►
what you've changed and when you changed it,
00:08:53
◼
►
and possibly why you changed it.
00:08:55
◼
►
But that's like, just knowing what has changed,
00:08:57
◼
►
whether it's what did I do today to this one file
00:09:01
◼
►
so I know whether to even commit this change or not,
00:09:04
◼
►
or what has changed in the entire app
00:09:08
◼
►
between this version, which I know worked in this way,
00:09:11
◼
►
and the current version, which keeps having this weird bug
00:09:14
◼
►
that I can't figure out why it's happening.
00:09:16
◼
►
You can go and you can see, all right,
00:09:17
◼
►
well, here's everything that's different between these two.
00:09:19
◼
►
So the bug is because of some part of this.
00:09:22
◼
►
And it's so useful to know that stuff.
00:09:25
◼
►
Everyone can get value out of that.
00:09:27
◼
►
It also, it helps even if you have to work
00:09:29
◼
►
on multiple computers or if you're working on,
00:09:32
◼
►
like if you have a deployment on your server
00:09:34
◼
►
and one locally on your computers,
00:09:35
◼
►
you keep those synced up properly in a sane way.
00:09:39
◼
►
I mean, it's just so great.
00:09:41
◼
►
I'm still, I'm shocked that anybody still doesn't use it.
00:09:46
◼
►
But fortunately, most people do use it.
00:09:47
◼
►
I think most people have come around to it now.
00:09:49
◼
►
So we're mostly sane in that way.
00:09:52
◼
►
In an industry that's insane in so many other ways,
00:09:54
◼
►
we're mostly sane in that way.
00:09:56
◼
►
And it really helps in that regard that it's also become so much easier to do.
00:10:01
◼
►
Like I think in Xcode, it has full-on version control built into it, in terms of not even
00:10:07
◼
►
its weird snapshotting thing that it always asks me when I'm refactoring a project, and
00:10:12
◼
►
then it asks me, "Do I want to make a snapshot?"
00:10:13
◼
►
And I don't really know what that means, and I really don't think I do.
00:10:17
◼
►
But it has it built in.
00:10:18
◼
►
Like, all of my projects, whenever I'm changing something, it's really helpful in Xcode to
00:10:23
◼
►
just see what's changed.
00:10:24
◼
►
And once I change something, it gets a little M icon
00:10:27
◼
►
next to it that says it's modified,
00:10:28
◼
►
or if I've added a file to it, it's there.
00:10:31
◼
►
And so there's no reason not to be aware
00:10:33
◼
►
of this type of thing, 'cause the tooling is in place
00:10:37
◼
►
to make that just so easy and streamlined
00:10:40
◼
►
that you'd be a fool not to.
00:10:44
◼
►
- Yeah, and whether you do it on a hosted service
00:10:46
◼
►
like GitHub or Bitbucket, or whether you do it just locally,
00:10:49
◼
►
like you can, almost all these systems,
00:10:51
◼
►
you can have a local server if you want to,
00:10:54
◼
►
and not have it synced to any remote/paid web service.
00:10:59
◼
►
But I recommend, if you can swing it
00:11:01
◼
►
for regulatory reasons and for money reasons,
00:11:05
◼
►
I recommend just putting it on GitHub or Bitbucket.
00:11:07
◼
►
Put it on one of the big hosts,
00:11:08
◼
►
because it just, it outsources a class of problems
00:11:12
◼
►
that you don't need to deal with anymore,
00:11:13
◼
►
and also you get a whole lot of convenience
00:11:16
◼
►
for having that be on a hosted system.
00:11:17
◼
►
You have the nice web GUIs,
00:11:19
◼
►
you have the ability to access it from anywhere,
00:11:21
◼
►
multiple computers,
00:11:22
◼
►
have kind of this built-in backup. So it's, yeah, definitely host it if you can, and please,
00:11:29
◼
►
please use version control.
00:11:30
◼
►
>> Yeah, and that's getting to, I think, another kind of interesting aspect to version control,
00:11:35
◼
►
which is the, like, the backup portion of it.
00:11:38
◼
►
>> Like, both in terms of, like, what you're saying, where, like, it's another physical
00:11:42
◼
►
backup, like, in the same way that you should have probably a clone of your main development
00:11:45
◼
►
hard drive running all the time, and, like, backup in that sense of, like, being able
00:11:49
◼
►
to not have -- if my computer dies, that's suddenly like, I'm out of luck, and that's
00:11:56
◼
►
it. The only copy of my code was sitting on that machine. That's terrifying. You have
00:12:04
◼
►
to have it backed up in a lot of ways, because the funny thing about doing the kind of work
00:12:10
◼
►
we do, there's no sort of tangible -- the only tangible outcome of our work is a collection
00:12:17
◼
►
of text files and images sitting on our hard drive. And so the amount of time and energy
00:12:23
◼
►
and money that goes into creating those, we have to treat them incredibly carefully. If
00:12:28
◼
►
we were at Coca-Cola and we have to keep -- I imagine the recipe for Coca-Cola is very well
00:12:35
◼
►
protected and backed up and guarded to make sure that they can keep making it, because
00:12:39
◼
►
if somehow it got lost and they didn't know the recipe anymore, that would be hugely problematic.
00:12:45
◼
►
And so as developers, our source code is that thing.
00:12:49
◼
►
Even if we have an old binary of our app, that doesn't do us any good, we can't change
00:12:56
◼
►
And so it's important to back it up, both in terms of that kind of backup.
00:12:59
◼
►
And then something else that I've found it so helpful for many times too, is it's having
00:13:05
◼
►
this, like, being able to go through, so it's like you have this little time machine that
00:13:10
◼
►
you can go back in time and say, "What was my app like at a particular time?"
00:13:15
◼
►
And like you were saying earlier, this is great for identifying weird regressions and
00:13:21
◼
►
bugs where it's like it worked in version 2, but it doesn't work in version 3.
00:13:25
◼
►
Why is that?
00:13:26
◼
►
And you can actually go back and what I'll often end up doing is I'll export the project
00:13:32
◼
►
from my version control at a particular milestone and change the bundle identifier and I can
00:13:38
◼
►
run them both at the same time.
00:13:39
◼
►
And I can kind of go back and forth and I can see why things are different and that kind of snapshotting is really helpful
00:13:47
◼
►
To be able to look back and then even one other thing that I've it's kind of more silly
00:13:51
◼
►
But I love sometimes being able to go back
00:13:54
◼
►
To like the verb like version one of a product after it becomes very mature both to kind of laugh at myself
00:14:01
◼
►
And just kind of look at it
00:14:03
◼
►
But also just to kind of for nostalgia reasons of kind of looking at it
00:14:06
◼
►
and it's nice to have a sense of, "Wow, I've really come a long way. This app used to be
00:14:11
◼
►
so simple and now it's so much more robust." That's fun to have this backup of it that
00:14:18
◼
►
never goes away in that way. This is why I also version control all my screenshots that
00:14:23
◼
►
I submit to the App Store. They're in there for that same reason, that sometimes it's
00:14:28
◼
►
really fun or useful, or I'm doing a retrospective post. When one of my apps hits a milestone,
00:14:35
◼
►
been, you know, it's, oh, it's five years old. Like, if it's, you know, hitting a milestone,
00:14:39
◼
►
it's kind of fun to, like, do a blog post or something like that to kind of talk about
00:14:42
◼
►
it and show screenshots or the icon from a long time ago. Like, Version Control is a
00:14:46
◼
►
great place to keep those things, so it's all in the same place and it, you know, as
00:14:50
◼
►
time marches on, you can keep a nice, accurate record of what's changed.
00:14:55
◼
►
All right, our sponsor this week is Braintree. Braintree is code for easy online payments.
00:15:01
◼
►
They're a full stack payment platform.
00:15:03
◼
►
And why make payment integration more difficult
00:15:06
◼
►
than it has to be?
00:15:07
◼
►
Brain Tree allows you to accept nearly any type of payment
00:15:10
◼
►
from any device with just one integration.
00:15:13
◼
►
They support PayPal, Bitcoin, Venmo, Apple Pay,
00:15:15
◼
►
Android Pay, cards, and they will support whatever's next,
00:15:19
◼
►
all with that one integration.
00:15:20
◼
►
It's flexible to your system's needs
00:15:22
◼
►
and supports most programming languages.
00:15:24
◼
►
So whether you're using Java, Ruby, or Python,
00:15:26
◼
►
you will always have a range of server side
00:15:29
◼
►
and client-side SDKs available.
00:15:31
◼
►
The Braintree client code supports Android,
00:15:33
◼
►
iOS, and JavaScript, and all of this takes
00:15:36
◼
►
just 10 lines of code to implement.
00:15:38
◼
►
Braintree makes payments and your job a whole lot easier.
00:15:42
◼
►
Learn more at Braintreepayments.com/radar.
00:15:46
◼
►
Once again, that's Braintreepayments.com/radar.
00:15:50
◼
►
Thank you very much to Braintree for sponsoring our show
00:15:52
◼
►
and all of Relay FM.
00:15:53
◼
►
- So I think what might make sense
00:15:56
◼
►
for the rest of the episode is to kind of talk
00:15:58
◼
►
about how this actually, what we do in practice, what the actual tools that we use, what that
00:16:06
◼
►
goes around, because I think there's certainly a degree to which version control can become
00:16:10
◼
►
a very personal thing. And some people like Mercurial, some people like Git, some people
00:16:15
◼
►
maybe even still love Subversion, or there's something new and fancier that I'm not aware
00:16:19
◼
►
of, but you end up with these kind of preferences, and at least I know for myself, I have workflows
00:16:24
◼
►
and things that I've built up over time that are part of this, that maybe are helpful,
00:16:29
◼
►
or if you're looking for a different way of doing Git or different tools for it might
00:16:33
◼
►
be helpful to discuss. So what is your typical, like, how do you actually interact with your
00:16:38
◼
►
version control system?
00:16:39
◼
►
>> So, on the server I just do it all via command line, and I use Git and I host on
00:16:44
◼
►
GitHub. I would imagine GitHub is probably one of the biggest reasons why people choose
00:16:49
◼
►
Git, and why it's so popular, because GitHub is just so convenient in many ways and so
00:16:54
◼
►
good in many ways and it isn't perfect but it's very good. I use GitHub again, private
00:16:59
◼
►
everything I pay for it, it's fine. It's been very secure for me and totally fine and honestly
00:17:05
◼
►
if somebody steals my source code somehow I don't really worry about that because source
00:17:10
◼
►
code is not very valuable. Like if you get somebody's source code to their entire app
00:17:14
◼
►
what do you do with that? Like you can upload it but that's illegal and they can easily
00:17:19
◼
►
get it taken down, so like, you know,
00:17:21
◼
►
you can make your own app again also illegal from that,
00:17:24
◼
►
get it taken down, so like, the actual value
00:17:27
◼
►
of stolen source code isn't particularly high
00:17:30
◼
►
for somebody's random iOS app.
00:17:31
◼
►
So anyway, back to how I use it,
00:17:34
◼
►
I use the command line for almost everything I do
00:17:37
◼
►
in general in development, so MySQL,
00:17:41
◼
►
I use the command line interface to that.
00:17:43
◼
►
If I'm doing development with other server side demons
00:17:46
◼
►
like memcache or redis. I will use the command line to interface with those to set them up
00:17:51
◼
►
to to do administrative tasks if I need to ever get. I usually don't do that anymore.
00:17:59
◼
►
Get is so complicated on the command line and so tedious on the command line that I
00:18:07
◼
►
usually just use get tower as my gooey, which is a Mac app. It's some price. It doesn't
00:18:15
◼
►
matter it's worth whatever price they charge it's worth it I think it's like
00:18:18
◼
►
50 bucks whatever it is totally worth it get because git is incredibly
00:18:24
◼
►
complicated and it doesn't need to be most in most use you can get by and it's
00:18:30
◼
►
it's totally fine and you'll be fine but sometimes you have to do something
00:18:34
◼
►
crazy with it or you have a weird error that you have to overcome and anything
00:18:40
◼
►
involving branching merging of branches certain advanced operations like
00:18:45
◼
►
committing only part of what you've changed or discarding only part of what you've changed.
00:18:50
◼
►
You can do all these things in the command line, but it's so obtuse to figure out how
00:18:55
◼
►
to do that on Git, and many times things can be multiple commands, and many times they're
00:19:00
◼
►
very error prone if you do them manually, and you could actually do some damage if you
00:19:04
◼
►
do it wrong. So typically now I just use Git Tower on the Mac, and I just don't do any
00:19:10
◼
►
kind of operations like that on the server.
00:19:12
◼
►
I'm exactly the same. I use Git Tower for probably like 99% of my Git. It just sort
00:19:17
◼
►
of works, it's very reliable, it's straightforward, and the way that they present Git I've always
00:19:24
◼
►
found kind of works with my head. Sometimes I've tried some other Git clients and they
00:19:30
◼
►
can get very... I don't even... They're showing me too much. Git has all kinds of crazy information
00:19:38
◼
►
and metadata and things about, especially when you have lots of branches, like things
00:19:42
◼
►
that are going on, and they just hurt my head.
00:19:45
◼
►
I liken the way that I use Git Tower, it's pretty straightforward.
00:19:50
◼
►
I open it up, I open a repository, it's like, "Here's the things that you've changed, and
00:19:54
◼
►
would you like to commit them?"
00:19:55
◼
►
And most of my process is that, and if I want to make a branch, I just pick the commit I
00:20:00
◼
►
want to branch from, I give it a name, and now it's created.
00:20:04
◼
►
And so it does a very good job of showing that to me
00:20:08
◼
►
in a way that, yeah, it's completely,
00:20:10
◼
►
it's one of those essential tools.
00:20:11
◼
►
Like if I'm setting up a new computer,
00:20:13
◼
►
there's a, like in that first five things
00:20:16
◼
►
that I will download onto it,
00:20:18
◼
►
one of them is going to be Git Tower,
00:20:19
◼
►
'cause I really can't work productively without it,
00:20:23
◼
►
which is probably saying a lot.
00:20:24
◼
►
- Yeah, yeah, I mean, again,
00:20:26
◼
►
I really do try to avoid GUI tools for developer stuff
00:20:30
◼
►
where there is a perfectly suitable command line version.
00:20:33
◼
►
But this is one of those things where it's so worth it.
00:20:36
◼
►
It is so, you know, not only does it save me a lot of time
00:20:39
◼
►
and it makes certain operations, you know,
00:20:41
◼
►
less error prone that are complex,
00:20:43
◼
►
but also it just gives me a really good view
00:20:46
◼
►
of what's going on.
00:20:47
◼
►
Like, you know, most of what we mentioned before,
00:20:49
◼
►
like a lot of what we were talking about is like
00:20:51
◼
►
how source control can show you and help you track
00:20:56
◼
►
what you're changing, what, you know,
00:20:57
◼
►
what has changed over time, how things used to be
00:20:59
◼
►
or how things are now.
00:21:01
◼
►
And git tower is, they just do a really nice job
00:21:05
◼
►
of showing the diffs, showing the various commits
00:21:07
◼
►
and what was in each commit, showing branches
00:21:10
◼
►
and letting you do that.
00:21:11
◼
►
And it isn't, I mean, there are certainly,
00:21:13
◼
►
there's certainly room for improvement in particular.
00:21:15
◼
►
I think the sub module area is,
00:21:19
◼
►
could use some improvement, but that's,
00:21:21
◼
►
most of the areas that I think tower could be improved,
00:21:25
◼
►
including sub modules, I think are at least partially
00:21:28
◼
►
or even mostly because the underlying Git feature
00:21:32
◼
►
is itself complicated and finicky.
00:21:35
◼
►
So like submodules suck.
00:21:38
◼
►
Everything about Git submodules is horrible.
00:21:40
◼
►
And so I can understand why the implementation
00:21:42
◼
►
of them in tower is also a little bit odd
00:21:45
◼
►
and a little bit finicky.
00:21:47
◼
►
But ultimately I think if I'm going to be using Git,
00:21:49
◼
►
this is the way to do it.
00:21:52
◼
►
- Yeah, and I agree.
00:21:53
◼
►
And I think it's also probably worth contrasting it to,
00:21:56
◼
►
I do use the version control integration in Xcode quite a bit, but it's through totally
00:22:03
◼
►
different things.
00:22:05
◼
►
Like I use the...
00:22:07
◼
►
So A, it's just useful to be able to see what's changed.
00:22:11
◼
►
And often what I'll end up doing is, if in the...
00:22:13
◼
►
What's it called?
00:22:14
◼
►
The navigator view?
00:22:15
◼
►
Like, the bottom left part of the Xcode browser, you can say, "Show me only files that have
00:22:22
◼
►
changed, that have an active version control status."
00:22:25
◼
►
And that's really helpful.
00:22:26
◼
►
I'll find when I'm working on something and I can kind of just see the files that I've
00:22:31
◼
►
been working on, and it collapses a big project into a nice small list, and it's also kind
00:22:36
◼
►
of just, if I see something that doesn't look right, often I'll find a nib file that has
00:22:41
◼
►
changed for some reason that I don't understand. I opened it up once and touched it, and then
00:22:47
◼
►
horrible things happen, and being able to be aware of that earlier in the process is
00:22:52
◼
►
helpful, but most of what I do is very helpful, like version control, I'm sure these have
00:22:58
◼
►
fancy names, but where you can compare inside of Xcode your current version to a past version.
00:23:05
◼
►
So it's like in the top right corner of Xcode, there's the three views, there's the regular
00:23:10
◼
►
view, the companion view, and then the version control view.
00:23:13
◼
►
And in that, I'm so often in there, where I'm looking at code and trying to see what's
00:23:18
◼
►
changed, how is this different, how did I used to do this, like if I have a problem
00:23:23
◼
►
that I've solved once before, I go in there and compare them, and then like I was saying
00:23:27
◼
►
earlier, surprisingly often for working just myself, I'll use blame, so I'll switch it
00:23:34
◼
►
into blame mode and look through the source file and say like, when did this change, when
00:23:39
◼
►
did I start doing it this way, what was that around, and those kinds of tools, and having
00:23:44
◼
►
them built right into Xcode is really useful. I go to tower regularly, but it's when I'm
00:23:52
◼
►
done with something, or when I'm getting ready to do a release, or in these big strategic
00:23:58
◼
►
operations. But I love that Xcode has integration at the tactical level, where I'm actively
00:24:05
◼
►
coding, and in that process I don't have to context switch to some other app to look this
00:24:10
◼
►
I can very easily just be like, "Huh, why am I doing it this way? When did this change?"
00:24:14
◼
►
And that sort of thing. And so I use those tools in Xcode a lot, but I hardly ever commit
00:24:20
◼
►
to any of those types of operations from Xcode. It has them, I'm sure they're there, and I'm
00:24:25
◼
►
glad they exist in some ways, so that out of the box you can do basic version control,
00:24:29
◼
►
but in Xcode I find it really helpful at that basic, the actual line of code level, and
00:24:37
◼
►
And then I go to tower whenever I want to do actual operations, like things that I would
00:24:41
◼
►
go to a command line and type, you know, git clone, git branch, git merge, git whatever.
00:24:45
◼
►
I don't actually know what half of them are because I just use tower instead.
00:24:50
◼
►
So I didn't even know this version view was here. I just open it up now and I'm like,
00:24:56
◼
►
my mind is blown, like, oh my God, this is so useful.
00:24:59
◼
►
So someone has not been watching what's new in developer tools sessions at WWDC for the
00:25:04
◼
►
last few years. I think we just discovered that live on air.
00:25:08
◼
►
Does that surprise anybody? I didn't read the manual. This is great!
00:25:12
◼
►
This is amazing! All I ever really used in Xcode was the little
00:25:17
◼
►
M indicators on the sidebar to know what I've changed.
00:25:19
◼
►
Well, there you go. Now you know that you can do some of these basic operations live
00:25:23
◼
►
at Xcode, and like I said, they're really helpful. They're not...
00:25:27
◼
►
Yes! It turns out!
00:25:30
◼
►
Turns out. Alright, anything else this week?
00:25:34
◼
►
No, I think that's it. Mostly, I guess, just to say, make sure you're using version control,
00:25:38
◼
►
please, please, please, make sure you're using version control. It's one of those things
00:25:41
◼
►
that if you're not, and version everything, I version stuff, I don't do a lot of Photoshop
00:25:49
◼
►
work, but when I do, I just put my PSDs into version control. And it doesn't do all the
00:25:55
◼
►
cool fancy diffing, it's not fancy in that way, but I don't care. I can always go back
00:26:00
◼
►
in time, I can always snapshot things.
00:26:02
◼
►
Like whatever you're doing, try and version control it.
00:26:05
◼
►
I version control my blog, I version control anything I can because once you get into the
00:26:09
◼
►
discipline and the habit of doing it, it's just so much better.
00:26:13
◼
►
And it's probably worth saying, I'm terrible about commit messages because I'm just working
00:26:17
◼
►
by myself, and it's hilarious.
00:26:21
◼
►
Most of my commit messages are often just like, "stuff, kind of works now, hmm, this
00:26:25
◼
►
seems to be better."
00:26:26
◼
►
- Fix, fix, fix. - Fix, fix.
00:26:28
◼
►
But that's enough.
00:26:30
◼
►
Like, it's, 'cause I'm still creating snapshots.
00:26:33
◼
►
Like, I'm not necessarily communicating as well
00:26:35
◼
►
to my future self, which is maybe, you know,
00:26:37
◼
►
like, problematic to, you know, in some ways,
00:26:41
◼
►
but just having it.
00:26:42
◼
►
Like, just putting random gibberish in there
00:26:44
◼
►
and just like, you'd be better off if you just like,
00:26:47
◼
►
had Git, take a, you know, take a commit snapshot
00:26:49
◼
►
once an hour would be, you know,
00:26:52
◼
►
even if you didn't want it to do anything.
00:26:53
◼
►
Like, having just some kind of resource
00:26:55
◼
►
to be able to go back in time is so valuable
00:26:57
◼
►
and I think can make you such a better developer,
00:27:00
◼
►
especially when you use the Xcode integration tools.
00:27:03
◼
►
- To understand how-- - To watch the videos.
00:27:05
◼
►
- If you watch the videos,
00:27:06
◼
►
you can really do some powerful things.
00:27:08
◼
►
So I highly recommend them.
00:27:10
◼
►
- All right, thanks a lot.
00:27:10
◼
►
That's all the time we have this week.
00:27:12
◼
►
So thanks for listening, everybody.
00:27:13
◼
►
Thanks to our sponsor, Braintree,
00:27:15
◼
►
and we will see you next week.
00:27:17
◼
►
I can't believe you didn't know those were there.
00:27:23
◼
►
How did you not know those were there?
00:27:30
◼
►
There's a lot of Xcode I haven't explored yet.
00:27:34
◼
►
There's only, in the default nav bar, there's only six buttons.
00:27:40
◼
►
I just never clicked on those two.
00:27:41
◼
►
Yeah, the one next to it with the semi-circles, the Venn diagram one, the assistant editor,
00:27:45
◼
►
I don't know what that does either.
00:27:46
◼
►
Well, that one is mostly just useful for if you have a nib in one view and the related
00:27:51
◼
►
file in the other one.
00:27:52
◼
►
Oh, okay, yeah.
00:27:53
◼
►
Like, it's designed to have two things compared to, like, next to each other, so that's useful
00:27:58
◼
►
if you're, like, dragging outlets or things, you know, from, if you're dragging outlets
00:28:02
◼
►
from a nib file into a source file, use the companion one.
00:28:05
◼
►
But yeah, you know, there's this whole world of version control that's been waiting for
00:28:11
◼
►
you this whole time.
00:28:13
◼
►
Oh, I'm so glad we captured that on...
00:28:18
◼
►
[BLANK_AUDIO]