Podcast Lookup

Source Control

Programming Throwdown

  • December 7, 2015
  • 1 h 3 min
  • Episode 48
Episode page
About this episodeThis show covers Source Control: Various tools that keep history of your code and enable code collaboration. Book of the Show Jason…

This show covers Source Control: Various tools that keep history of your code and enable code collaboration. Book of the Show Jason: Kobolds Ate My Baby Patrick: Firefight

★ Support this podcast on Patreon ★

Transcript

From the publisher

This transcript comes from the podcast’s own feed, shown as the publisher wrote it.

Source Control

00:00—
  1. A

    Programming Throwdown Episode 48: Source Control. Take it away, Jason! Hey everyone.

  2. B

    Sorry for the late episode. We had some issues recording this episode, and so we—this is take two. But this is a very important episode. Personally, I can't stress how important this is for you, starting developers, and really for anybody using a computer. And so happy to talk about it again for the first time, but in this show, instead of doing news, we have something kind of like a public service announcement. I want to talk about backing up. So backing up is, you know, related to Source Control, but it's sort of even more—sort of fundamental is this idea that, you know, you need to keep copies of things. And so I didn't know this when I was in high school. I used to make a lot of Starcraft maps, and

  3. A

    Because you were a nerd? No, no, we all are.

  4. B

    Yeah, exactly. So I made these Starcraft maps. It was—it was, you know, wasn't the maps I made weren't popular enough to like make it on a website or anything like that. I mean, this is, you know, 1996, so I don't know if there were even that many websites. Like it wasn't like everything was indexed like it is now. There was actually Web Rings—remember Web Rings? Yes, where you'd go to one of the sites and it would link you to all the others, and you just go through anyways. So I wasn't popular enough to make it into a Starcraft map web ring. I just had my maps, my computer, and but for me they were very cool because I—the maps actually told stories. They were like RPGs. It wasn't like typical Starcraft where you're, you know, playing this tactical game; it was like all about this story that unfolded. You had this character, and you know how you leveled them up, changed a story, and it took a lot of time. It was like a ton of different macros and triggers, and all that. And my hard drive crashed. I lost all of it. Um, to this day, you know, I have a lot of other projects that I haven't lost, and every now and then I go and look at them, and it's kind of cool, and have a little nostalgia trip. But, you know, I lost a ton of projects when that hard drive died. And so don't—don't do that. Don't be regretting that. There's plenty of ways to back up. You could use Source Control. So I'll tell you sort of what my backup strategy is. I have Source Control for projects where, you know, it's a lot of small files, you know, text files where Source Control does really well. For product—for things that are kind of small but aren't really source code, that for those I do, you know, Dropbox, Google Drive, you know, iCloud Drive. These kinds of different projects that sort of back your stuff up in the cloud. All of them have limits unless you want to pay money. I've been backing things up since i was in college and very poor and so uh i used to do a whole bunch of crazy r syncing among computers and things like that now you don't have to do any of that you can use bit torrent sync uh which is actually one of our tools of the show earlier you can also use sync thing which is an open source version of bit torrent okay so this is a

  5. A

    side topic, but I was thinking about this other day. People on the internet were saying that oh, don't use BT Sync because it's closed source; you don't know what they're doing. You can't trust it. Use Syncthing because it's open source; you can trust it. Blah blah blah. What is your opinion? Do you use both? Like is there a legitimate reason? Personally, I'm not going to go audit the source code, right? Like I'm just going to be honest, I'm not going to do that. So is there an advantage? Like do you put an advantage on something which is open source versus something that's not? You just go on features? Like how do you make that decision?

  6. B

    Personally, um okay, so for me I'll look at open source for cost reasons. You know, in other words, like I got into Emacs instead of Visual Studio just because I didn't want to pay for Visual Studio, and it just kind of grew on me there. Um I don't really buy the argument that open source is more audited because, you know, although like you know we have this like fantasy that open source projects everyone's looking at the code all the time. There's all this third party. The reality is if you look at most big open source projects, it's really just one or two entities pushing the project. Um and so I don't feel like there's that many more eyeballs on the source code, honestly. Um also, you know, if you want to do something malicious, you have access to the source code, and you don't have to do any reverse engineering or tamper protection or tampering or anything like that. Um so, you know, I tend to—I would think for security reasons I would go closed source. Um I

  7. A

    feel like security reasons I'd probably go open source, really because yeah, because I feel like someone will have taken a cursory look to say like, hey, but you know, like you said, I have no proof of that. Um I mean, but

  8. B

    I feel like long.

  9. A

    Term it's hard to say for something that doesn't have a server that's like—like for something that's just run on my computer or like run between two computers on my home network. It doesn't need to reach out to a third party, like I don't worry about it as much, and I would only start to worry about it if it's like I'm depending on someone. I'm buying a piece of software, and I need them to be doing something on an ongoing basis as well. Like that makes me a little less happy.

  10. B

    Yeah, right. Well, yeah, definitely when BitTorrent Sync was—you have to pay per month. I didn't use it because, uh, yeah, anything you have to pay per month just—it definitely like turns me off. I think we talked about this in the last episode. Yeah. Um but, you know, now it's just—I think it's a $50 one-time fee. It's totally reasonable. At the time, Syncthing blew up your processor, like not literally, but Syncthing would just max out my processor 24/7. Um and I just—I had some very large directories full of pictures, and for whatever reason the indexing, you know, just wasn't optimized or what have you. And even though like nothing would change, I wouldn't even add any pictures, one of my cores would be at 100, and my laptop battery wouldn't last, and things like that. Um since then they fixed a lot of that. Um but, you know, I'd already migrated over to BitTorrent Sync, so I'd have to migrate back. Um But I did just as a—you know, just for experimental reasons, I did reinstall Syncthing and try it the latest version, and all those problems are fixed. So I guess if I had to tell people, I would tell them to use Syncthing at this point because it's more mature, but when I started it was in

  11. A

    bad shape. I use BitTorrent Sync, in all fairness, also because it has mobile clients.

  12. B

    Oh, that's true. I forgot about that, but yeah, the mobile client is amazing. It just every time you take a picture and I don't need.

  13. A

    It that often, but I do occasionally. And also for like you said, for pictures. Okay, so you use rsync sync thing? But sync between two computers you own, right? So for

  14. B

    files that are too big to fit on the cloud without spending money. I'll use, you know, bt sync. Yeah, like you know if you have like in my case, I have, you know, terabytes of photos. Um, I don't know what that would cost me per month, but it's much easier for me to actually have bt sync running at my parents' house. So like literally I take a picture with my phone and then the next time I'm on Wi-Fi, it goes to my parents' and to my desktop. Yeah, I need to set.

  15. A

    Something like that up because that's really important. It's not just computers you have in your house because if you have fire or theft or flood or whatever it may be and every you lose everything in your house, you really can't rely only on that.

  16. B

    Yep, that's right.

  17. A

    Although it's much better than having relying on a single spinning bit of metal inside a metal case inside a computer. Um, oh yeah, that could just go down randomly at any point and you know you'd be faced with either just loss of it or paying large sums of money to attempt to recover it.

  18. B

    Yep, the other thing is um this is a little bit orthogonal, but so I had a friend who lives in Berkeley and you know it was went on Facebook and told everyone like he's so excited to go on vacation. Went on vacation and then was robbed while he was out of town. And that person, like you know they took all his electronics and so you know like things he had on Dropbox he could recover, but you know anything if even if he had backed it up on external hard drive, you know it's still gone, right? Yeah.

  19. A

    So I also use CrashPlan, which I think they changed their name now. I'd have to look.

  20. B

    Oh, which is a backup service that I

  21. A

    pay for as well to um back up my stuff to their servers. And people use some of the Amazon AWS EC2 Glacier—one of those acronyms at Amazon—to back up their data to the Amazon thing. So same idea, same idea sort of as backing it up to the Dropbox servers, although I think there's some risk there that because it's not really meant purely for backup that if your file somehow got accidentally deleted, it could get deleted in Dropbox this thing too, and it may be a little harder to get it back, although I think they have ways of doing it.

  22. B

    Um yeah, I was gonna say if you're like long term there's a—there's a dot, I think it's like .archive folder in your Dropbox that has files you've deleted. They actually get moved there and I think they get that gets purged every few months or something. So

  23. A

    Yeah, yeah, but like you know it's not really like I always feel better when something is designed for that purpose, you know, like.

  24. B

    Yeah, totally for.

  25. A

    Backing up. Um, and there's other ones too, I think. Carbonite is another one I hear about. I have not tried it. CrashPlan didn't change its name; it's still CrashPlan. Okay? But something that is an actual backup service who kind of are staking their reputation on like... And to be fair, I don't think I've needed it, but once in the three or four years, I've had it like—I one time I needed to recover a couple files, and it worked great. And other than that, I've not needed it. And so in that way, it's kind of just insurance, but it gives me helps me sleep better at...

  26. B

    Night. Yeah, another thing that's really important is to back up in the other direction too, from the cloud. So I have a friend—she was... she's a reporter for, I think, The Verge. She's a reporter for some tech newspaper, and some hackers got access to her Gmail account, and they went on her Gmail and literally deleted all of her email, all of her photos, everything. Um, just gone. Um, I don't know if she ever got it back. I don't know if she was able to recover that by contacting Google over the phone. I'm not sure how that ended, but... but definitely like I have a Thunderbird instance on my desktop that just fetches all of my Gmail, you know, using IMAP. And that way, if something like that does happen, at least I have, you know, a local copy of.

  27. A

    It. Yep. Although I often wonder like if all my emails just got really deleted me, I might be better off. But yeah, that's a separate—it's a separate topic.

  28. B

    Yeah, she actually never called Google, and she was much happier and reached nirvana. Yeah. Um another thing that's related is two-factor authentication. You definitely want to have that turned on. That's good PSA within the PSA than me. I've only vaguely know about this. I mean, I have...

  29. A

    It, but so typically you have a password, which is some alphanumeric code, but then it's good to also have something that is on you or that you have. So sometimes it's like your fingerprint, which is not as great as you might think because there's no way to really change it and it turns out it's more hackable than you think. But then there's also like various ways of doing two-factor. The second factor is normally like a one-time password—so a lot of people you see like the RSA keychains for banks, which have like a little LCD on screen on them with a six-digit number that changes and it changes in a known way to an algorithm if you have a secret. But if you don't know the secret, then the pattern is unpredictable, right? And so it prevents people even if they get your, you know, your password, which doesn't change, they won't know this other one-time password that either changes every time you use it or changes based on a time-based schedule. And that gives you an additional layer of security that people need both. Um and then there are even more secure ones that do stuff a little slightly differently if you are really, really paranoid about it. Um and I've enabled the OTP for both me and my wife because it—it turns out it's actually really easy um and it isn't that much of a hassle because you can turn it on for a computer and it just stays on that computer for some number of days. You don't need to keep doing it. That's...

  30. B

    Right, and that.

  31. A

    Is somewhat of a security risk, but I personally make the belief that you're more likely to be hacked from an anonymous drive-by hacking where something is going on than someone coming and sitting down at your computer and, you know, getting on your stuff like.

  32. B

    That's possible too or stealing your computer or whatever. And you can try to go in and revoke.

  33. A

    It, and hopefully you have recovery stuff. But it's worth it to not have that hassle of needing to get a text message or use an app or use your RSA key every...

  34. B

    Time, right? I mean the odds that you know someone steals your laptop and somehow it's not password protected, or or they stole it before it was locked and they're not just in the business of selling it; they're in the business of logging in as you. Like all of these things are just like when you add them up, like the the joint probability distribution like looks very narrow. I mean, uh it's just highly unlikely, right? So so as Patrick said, most it's very important stuff people, you know, out on the internet getting your password.

  35. A

    Yeah, and if it's very important like if you do conduct business email, like you probably want that secured more than your personal email. They can be tragic if you lost early love emails between you and your girlfriend, but like I don't know is that a thing? I don't know anyways. But like it's not really.

  36. B

    the end of the world, right? Right like

  37. A

    But if you lost, you know, important business contacts, like that would be worse. Right? Yeah, exactly. Okay. Yep. The other thing I'll say back onto the topic of backing up—oh, and is for your phone. Like my wife lost her phone, and it turns out we got it back. But we thought it was gone forever. And so we did the remote wipe thing, and she lost since her last backup, you know that she did previously, you know I lost some number of pictures. And since then we realized it's really important to have for us to additionally on our phones, like Jason was saying, using the phone app to back up your pictures or like Google Photos has a thing—I think Facebook Photos will do the same thing where it's automatically uploading pictures at some resolution so that if you lose your device, it's not the best version, but at least it's something. So you still have those pictures and so that can

  38. B

    count as a

  39. A

    form of backup as well. One thing,

  40. B

    to keep in mind if you're on iOS, iOS doesn't allow services so all these like all these programs like BitTorrent Sync on iOS, Google Photos—you have to run them periodically yourself. If you're on Android, they'll run you every day or something. But but keep that in mind. So, you know I tell my wife, like I remind my wife every now and then that you know she has to go in and run the BitTorrent Sync, and it's pretty cool. It brings up a little status bar shows you it's transferring, and it'll it'll try to be clever about finding, you know, if you're at home, it'll send it to your home computer first, knowing that like your phone is kind of more bandwidth constrained—send it from your phone to your computer at your house, and then it'll send it to, you know, another computer or what have you.

  41. A

    Oh, I recently made the obvious realization that I was thinking between my kind of like server computer and my desktop for pictures and everything. And I was—I was like so happy with myself because I finally had wired connections instead of wireless, and I was like, 'Whoa! I'm getting eight megabytes a second sync speed.' This is pretty good or whatever it goes. So fast. And I realized, oh, you know, I think I used an old 10/100 switch instead of a Gigabit switch. So I switched it—oh man, too many switches—to a Gigabit switch, and I was getting like, I think 24 megabits per second or megabytes per second. I was just like, 'Yay! Like this is even so much faster because I had one but I just like you know had used some old one laying around,' not thinking like, oh, it'll just—it's just so much faster than wireless anyways.' Right? Right. Oh yeah, no, you realize

  42. B

    you hit another order of magnitude.

  43. A

    Yeah, another thing.

  44. B

    And we'll just—we'll move on from this, but the other cool thing about BitTorrent Sync is it provides an easy way to access your photos on your desktop. Like my wife, she's tech savvy and everything, but even a tech-savvy person, you know, getting photos from your phone to your desktop, especially if your desktop's running, you know, Windows and you have an iPhone or something, can be a little complicated. With this BitTorrent Sync, if you have it set up correctly, you just open the Sync app and wait, and then the photos are just there in the folder on your desktop. I mean, you don't have to do anything. It's really nice that way. You

  45. A

    sound like a sales pitch for BitTorrent Sync before or you leave thing. The open

  46. B

    source one, but yeah, the

  47. A

    Before we leave the topic completely, I'll also say another strategy people employ which is valid. They used to burn DVDs, but now I think storage is so big it's hard to do DVDs or even Blu-rays—I don't know—but now hard drives or SSDs or you know USB sticks are big enough. I guess a valid strategy would still be to download onto a USB drive and mail that to your parents or put it in

  48. B

    a box or yeah.

  49. A

    And then the other thing I was going to say is that when you could also RAID array your hard drives. That's

  50. B

    another valid backup strategy.

  51. A

    Because it helps again protect against a single hard drive having a problem, but then you're there, you're having multiple hard drives and not getting the full capacity of each because some of it is sacrificed to protect against errors. Yeah, so just to

  52. B

    tell everyone real quick about RAID. The way RAID works: um, there's some, there's a couple of primitive versions of RAID. There's several versions. The first version is what's—I don't even know what it's called—striping, I think. No, the first, the first version is just where it just takes your if you have two 1 terabyte hard drives, it just concatenates them so now you have a two terabyte logical drive, right? But it's actually these two 1 terabyte drives. And if you write to the sector, you know N over two plus one, you're writing to the beginning of the second drive, right? Um there's also mirroring, and they don't have to be the

  53. A

    same size or like really the same in any way, really.

  54. B

    Right. There's also mirroring. In the case of mirroring, they do have to be the same size, and you want them

  55. A

    to be the same performance or you'll get the performance of the worst one.

  56. B

    Yep. And every time you write a bit to one of the hard drives, it writes it to both. So it's—it's as it's just like a mirror. Um it mirrors everything on the left hand with the right hand. But then it turns out, you know, you really let's say you have three hard drives. Sure, you could do mirroring and I have three copies of everything. But statistically that's kind of overkill. So if you kind of do some probability theory, you can get, you know, 95 percent redundancy or you can guarantee that two or more drives have to fail within, you know, a few minutes. You can make that guarantee without having to sacrifice so much of your disk space. And so that's where these sort of RAID five and I think there's other ones, but RAID five is the most common. Yeah, so

  57. A

    What you're saying is the chances are most of the time you'll fail because a single drive starts to have a problem, and as long as if you use three drives, you can get the most of the capacity of two drives. I think is how it works out, right? And the third drive is used for kind of error checking the first two. And then as long as if only one drive has an issue, you get to keep all your data. You can take away the bad, you know, sick hard drive and put in a new one, and it'll essentially rebuild it, and then you'll be back to full protection. Exactly. If you lose two hard drives though, you have a problem. But the chances of that happening are, you know, far less. And even if you had them fully mirrored just two, you would be in the same case. And if you had three fully mirrored, well, that's great, but you have three hard drives but only one third the space, right?

  58. B

    Like exactly.

  59. A

    That's an inefficient system. So

  60. B

    Yeah, I have fully mirrored. I only have two drives. I'm thinking actually about buying another two drives. Um, and so in that case maybe I'll go to a RAID 5. It's actually kind of hard once you pick a RAID, you know, to switch to another one. I think you have to just, you know, like purge all the data and then bring it all back. But yeah, that's definitely that protects you from hard drive failure there.

  61. A

    Are also, I know Linux has some file system stuff I was reading about recently that tries to handle some of this for kind of like Network Attached Storage reasons where it's not handled at the per se just like the, you know, a RAID might want to be handled at the hardware layer and OS actually just sees a single drive but actually try to handle it at like the file system layer. But I like where you have a disk pool something is used for parity and they try to kind of be smart about where they stick where so that you can kind of just add or take away drives without having issues, kind.

  62. B

    Of like a Hadoop file system, but or like a MapReduce file system or something like that, but only on one computer.

  63. A

    This sounds really formal, but I'll take an action item to look into that and maybe try to get us better information next time. It's just speculation, an action cool, or we'll distribute it. Someone out there has to know about this. Maybe they can write in and tell.

  64. B

    Us? Yeah, if someone knows about some type of like, you know, a Do file system like thing where you can literally just pop in a hard drive and your file system magically gets bigger. Um, let us know. That'd be awesome. Um, that'd be that'd be really, really. Fantastic? Yes, cool. Um okay, so time for Book of the Show. Show show. My Book of the Show is uh Kobolds Ate My Baby. It's really fun. It's a uh it was out of print for a while. They brought it back. Really excited about that. I actually I had pirated this because it was out of print and I literally could not get a copy, and I was well, I mean, yeah.

  65. A

    So as.

  66. B

    Soon as it went back in print, I bought a copy. I'm very satisfied. It's it they call it A Beer and Pretzels RPG. If you don't know, like there's there's video game RPGs, but there's there's also true sort of role-playing games where you all sit around at a table and there's sort of this set of rules and there's one person who arbitrates um all of these rules, and everyone else has to sort of play these characters. And part of the rule sort of encourages you to, you know, assume the persona or persona of various characters, right? Um so this one particular every person is a is a wait, it's not.

  67. A

    Just personas, I think it's just.

  68. B

    Personas. It's personas or it's just.

  69. A

    Persona, persona and personas.

  70. B

    Oh, it's personas. Okay. Anyway, sorry. So no, it's fine. Learn something new. Uh so you know this year a Kobold um you have to sort of eat this baby. It's very hard to eat the baby. You always end up failing in just hilarious ways. But you know hopefully you get closer to the baby than anybody else. And along the way there's a bunch of little rules that make it kind of fun to play, especially people who aren't may not be into RPGs. There's one where um anytime someone says King Torg, everyone has to say All Hail King Torg. If you don't, you die. Your character dies. Um and so you just use that in funny ways to get people killed and things like that. Um it's just a bunch of like kind of like funny things like that they've all rolled up into one game. Highly recommended.

  71. A

    Very nice. I don't think I've actually ever played a pen and paper RPG before. I've really tried to do it once or twice, like I got like a Star Wars Beginner's Guide many years ago, and they had like an RPG, and tried to play it with my brother, and we never really understood or did it.

  72. B

    Right. So yeah, I played D&D a little bit, and then—and then uh um we were playing it in school, and the school actually banned it. We only played it twice. There was like a hysteria. Yeah, yeah, but there was it was that time where it was like associated with witchcraft, all sorts of craziness. Um so it got banned. To be honest, I never really enjoyed it—the D&D. I only really like pen and paper RPGs that are satirical and funny and sort of tongue-in-cheek. Like Cold Date My Baby is one of these paranoia RPGs. Another one, but any of the pen and paper RPGs that are serious, I just can't get into it. So yeah, I just never played.

  73. A

    Any of them? Oh, you should.

  74. B

    Try this. I guess I'm missing out. Like, it, yeah.

  75. A

    But you have to have the problem with all those—you can't just be one person or even want two people. Really like, it really needs

  76. B

    To be a group of people. That's right. Yeah. Yeah.

  77. A

    Don't have that many friends. Okay. Anyways, moving on. My book of the show is Firefight by Brandon Sanderson. This is the sequel to—oh no, oh no, I just it dropped out of my head. I have to look it up. Anyways, it's a sequel to his previous book that is called

  78. B

    Steelheart. There we go. Thank you.

  79. A

    Amazon, and Steelheart is the first in this I guess universe. I think there is a series they're calling it The Reckoners, and it's kind of a superhero universe. There are people with superpowers, but it's not like Marvel or DC superpowers. They—and it's an interesting take on what superpowers are and what it means. And these superpowers kind of, you know, like do people necessarily have to change by having superpowers? Anyways, it's a pretty light read. It's lots of fun. Um you should obviously probably read the first one, Steelheart first. And if you—which was a previous recommendation—if you read that one, this is a second one, Firefight. I also really enjoyed it. Um a little different kind of book than the first one, but very fun nonetheless. Uh and this is a good opportunity to show for a plug that uh if you would like to help support the podcast, uh you can listen to Firefight on Audible by going to audibletrial.com/programmingthrowdown, and you can get a free month at Audible, which means you get a credit, and for one credit you can download like any of the many many books they have. I actually pay for Audible on my own and listen to it on my commute because my commute stinks, and I like to listen to sci-fi, so I make it through a lot of sci-fi books, and I listen to them on Audible. I really enjoy it. Um you can get a one month subscription for free. After that, they'll charge you, but if you don't want it to be charged, just cancel after your first book, and you can get to keep it because even if you like Jason said if you don't like paying month to month—which I also don't like being committed to—the nice thing is you still get to keep all your books um that you've bought with your credit so you don't have to keep paying. Um and the paying for me works out month to month cheaper than, you know, buying it straight up or whatever. Um yeah, Audible.

  80. B

    Books are very expensive. Yeah, they

  81. A

    really can be which makes sense i mean if you think about like a movie is well i guess it's a lot more production it's like two hours three hours but an audio book can easily be 10 20 30 hours the book i'm listening to now is three books in one and it's 65 hours oh

  82. B

    Wow. Wow. So

  83. A

    That's like a week of commuting.

  84. B

    Right? No, no. That's oh wait, no, wait. 60 hours. That's probably a month of commuting, right?

  85. A

    Yeah, yeah. No, even more than that because if you say there's like 20 work days,

  86. B

    Oh, right. Yeah. Like, yeah, right? Right. Anyways, cool. It's a lot I enjoy.

  87. A

    It helps me pass the time, so yep. Nope. I just say it helps me pass the time, so.

  88. B

    I like we're also on Patreon, which is pretty cool. If you want to support the show, you can donate to our Patreon, and every time we produce a show, I will kind of automatically make a donation, which is like a pretty cool setup they have there. So, so I definitely check that out. We definitely appreciate your donations; that's how we keep the lights on. So yeah, and

  89. A

    You guys have been really good about supporting us and embracing our stuff. A couple people have written in and like, 'Hey, what's the deal?' But you know, if you don't want to—don't, it's fine. Like we don't require you to do that. We're not gonna charge people to download the podcast. Yeah, a couple

  90. B

    people said, you know, they want to support the show, but they—you know, don't. You know, they're not in a position financially to do that and things like that. And don't worry about it, man. I mean, we're gonna we're gonna do this show, and if you can support, that's great. And if not, you know, if this show helps you, that's really what—what it means. You know, that's really what we're doing it for is to help people out, and I don't feel like there's any pressure or anything like that, you know.

  91. A

    And if you don't like an episode, just download it and then turn it off. And you can feel good about really pressing that delete button really hard. Yeah, that's

  92. B

    Right? You can use the what is it on the new iPhone, the Force Touch? Oh, the Force Touch. And just like if you press it hard enough, one of us will get punched delete with a

  93. A

    grudge. Oh man, it's the time for.

  94. B

    Tool of the show. My tool of the show is Qt. Um sure not a lot of people know what this is. It is a cross-platform GUI framework. It does more than GUI; it does like threading and things like that. But basically, um you know C++ has a lot of sort of native thing. I mean, if you want to do Linux, you're doing some kind of GTK kind of thing. If you're on Windows, you're using—I don't even know—I guess Microsoft Foundation Classes or whatever they have now. I guess some kind of .NET thing. Um if you're on if you're on Mac, you're using, you know, Cocoa or Carbon. There's a bunch of different platform-specific things. And so if you want to make like a cool desktop app, um like if you take any of these cross-platform desktop apps, like Steam for example, um Steam uses Qt. So that way they can write the code once and it runs on Linux, it runs on Mac, it runs on Windows, and all three of them, uh, you know, it looks reasonable. Um Qt differs from wxWidgets, which is one I recommended earlier in an earlier episode. Um wxWidgets actually takes your code and transforms it into um something native. So in other words, uh, you build some form in wxWidgets, and when you compile your code for OS 10, you end up with uh Cocoa code. So it feels like you built a native app. Um Qt is different. Qt sort of has a layer in between, and Qt's goal is to try to give a uniform experience um across all the different platforms. So that's the difference. Like wxWidgets wants you to give a native but different experience on each platform, and Qt tries to give you a uniform experience on each platform, but it doesn't feel. Native. Um it turns out in my opinion Qt is way better. The reason is I've used wxWidgets. It sounds great in theory, you know, the idea that people think you built the app just for them or just for their OS. But in practice, people know—I mean, what you'll end up with a button where, you know, on Linux the button doesn't fit right, but you know you don't have time to adjust it for all the different OSs, or or on OS 10 you use a pull-down menu in a weird way where you wouldn't have done that. And so I feel like—I feel like the uh it's almost an uncanny valley where it's using native widgets but it's not laying them out in a way that makes sense, or there's some weird word wrapping, and actually it's actually worse than just doing Qt, and people know up front that this is going to be a different experience than a native app. Um I think it's great. Highly recommend you guys check it out if you're doing any kind of C++ GUI work, which.

  95. A

    I just generally try to avoid. Yeah, yeah, I.

  96. B

    Mean if you're gonna do it's necessary this.

  97. A

    Necessary, and I appreciate the people who do it. I just.

  98. B

    Yeah, yeah, if you're gonna do a quick GUI for some small project, use like R or something or IPython Notebook. But if you really have to build a GUI, use Qt.

  99. A

    My tool of the show surprise is a game. This one is an iOS game. I keep—I should look up every time, but I always forget whether there's an Android version of it.

  100. B

    Or not? Um I'll check.

  101. A

    Yep. And so this game is called Wayward Souls. It's a rogue-like and it uh is very much kind of like if we've talked about I think Spelunky before. Um it is on Android as well. It is on.

  102. B

    The Google Play Store. Yep.

  103. A

    So in the kind of theme of Spelunky or they're saying Mage Gauntlet, but basically it's procedurally generated dungeon levels, and you have—you can kind of choose what character you want to play as. You kind of go into the level, you fight some bad guys, and you die a lot, but then like you kind of get better as like a player. You learn what you're supposed to be doing, and then like you also kind of get gold that you can use to upgrade your characters and make them better equipped when they go back into the dungeon. Um and so there's kind of that combination which I personally like where uh you find things in a given playthrough that are making your character better, you know, some equipment that you lose when you die, but then there are also some things that you don't lose when you die and you kind of carry across. Um and I like that aspect as well because it helps me to feel like I'm making progress even when the level is just unusually difficult. Yeah, I've played this game.

  104. B

    As well. I think it's great. I like the idea that you know what you want is you want the suspense. Like you want to feel like so you want to feel such that when you die—you lose significant time. That's what it creates the suspense, makes you cautious, but at the same time you don't want to not make any progress. I mean, you don't want to just never see the ending of the game, and so this sort of gives you the best of both worlds.

  105. A

    Yes, yep. It's kind of like I think there's always this debate like quick save in games, like the ability to save anywhere in a game does fundamentally change how you play a game, right? And in some ways, knowing you can just go back to 30 seconds ago, you act very differently than if you know you're going to lose an hour's worth of work. But

  106. B

    At the same

  107. A

    time, based on where I am in my life. Like it's really hard to sit down and know I'm gonna be able to play for an hour and not quite make it to the next save point and then lose that hour, have to do it again next time. Yeah.

  108. B

    I mean, for me it's okay because as you said there's—there you always make some modicum of progress, so you always make some mediocre amount of progress no matter what, and so eventually you'll beat the game.

  109. A

    Yeah, well everyone's all good but Wayward Souls. I like it. It's cool, and it's you know it plays relatively quickly, and it's not that some roguelikes are very in-depth, and this one isn't like that. And so that

  110. B

    makes it enjoyable. This is definitely a hack-and-slash roguelike. Yep. Cool. All right. So

  111. A

    we're gonna talk on to Source.

  112. B

    Control Source Control. Um yeah, so basically source control is kind of about just keeping—they also call it version control. It's about just you know keeping history of some kind of project. So it's not only about backing up; it's also about being able to go back and forth in time and see sort of, oh what did things look like a week ago? Or I pushed out this build and my customers are really unhappy. Let me, you know, go back in the past week and see what went wrong. So it's very different than backup; it's extremely important especially if you're working on some kind of project. There's really two sort of strategies. Well, wait, sorry, before you go on, I also

  113. A

    want to say that like I think that's important we say source control because we're programmers, but like you really could use it as just straight version control for almost anything that has versions now.

  114. B

    Some things aren't.

  115. A

    Really great. Like binary files are hard, but like if you have a config file or I'm trying to give a good example of something—I'm too nerdy and programming-oriented to think of something at the

  116. B

    moment. Oh, if you're writing a book? Yeah, there we go. Yeah, you could source control your

  117. A

    version control your book, and it's a little different there because I think in a book you kind of always know you're making progress, but maybe you would want to go back. Like, oh, I'm unhappy with the direction I took; I want to go back to where I was before. And the thing in code is like Jason said is you introduce a bug and you want to be able to go back, or specifically you ship code to make a release that goes to a customer and they have a problem with that. You need the ability to go back to exactly what your source code was at that time and know that you're have the same thing you sent out. And so if you make a fix, you know what exactly you fixed rather than saying, oh, they called me a month after I did it and I've added three features halfway and now like, oh, crud, I either need to try to finish these features and hope I didn't introduce new bugs, or what—the right thing to do is to be able to go back to what you sent them and work on the bugs there and then make sure you bring them forward as well, or whatever your solution is. But that is what the importance of version control is versus backing up, which is just saying I don't want to

  118. B

    lose my work, right? And I, as I did write a book with a bunch of other authors and we used version control. And as you said in the beginning, you're just writing, and so it doesn't really make sense. But at the end where you're kind of coalescing the book or even if you wrote the whole book by yourself, you're going through rounds of edits, possibly with several editors who have different opinions. You'll often find yourself going back and forth with certain parts of the book, and having version control is extremely important. You could have an editor that takes you one direction, and then the other editors decide, oh, that was a bad idea. You need to be able to go backwards. And so as Patrick says, not just for programmers—anyone who's doing something with source files, and even artists. There's some specialized tools, but they're extremely powerful for doing version control on, you know, Blender models and things like that that handle sort of those binary files, you know, that semantically understand how those files work and do versioning that makes sense.

  119. A

    Yep. It's also important both for a single file—like I need to roll this single file back—or I need to roll all the files back together because especially with at least with source code, right? Like files depend on each other, and so if you only roll one file back, then the other files won't it won't work anymore because the other files aren't compatible at that point.

  120. B

    Yep. Yeah, exactly. Or potentially there's two sort of ways to do—yeah, there's two ways to do version control. One is lock, and the other is merge. The idea with lock is um this is mainly used for binary files for, you know, people are doing art and things like that. If Patrick and I are both making a bunch of art assets for some game, we just have a list of assets, and I decide, okay, now I'm going to take grass. I'm going to make all the grass for the game. I could just lock, you know, the grass texture file. When it's locked, Patrick um he could read the file, but he'll know it's locked, and it won't let him make any changes. Then I can go in, I could, you know, paint all of my grass, and then when I'm happy with it, I can unlock. You know, I can update that file. Now that file will unlock, which means now somebody else can lock it, um and it's uh now has my new content. And that way this makes it really, you know, on a for an individual file only one person can edit. But, you know, I could be editing—oh, go ahead. Yeah. Yeah. No, you

  121. A

    could be editing lots of files, but I was saying the advantage here is it makes it very explicit what you're working on so that it duplication of work is maybe easier to be avoided because I know Jason's working on grass and if I know we need—we both knew grass

  122. B

    need to be worked.

  123. A

    on. He got it to at first I know, oh, I should just wait on him to be done, but in like a source control, in a source code scenario, it may be that like hey, I just need you to add this other member variable to your class to track this thing, but you're doing like an algorithm rewrite and like, you know, I want to just go ahead and have you unlock it. I'll make my change, lock it back, and then you can lock it back. But like if I want to make this small change, I don't want to wait around for you to make your gigantic

  124. B

    change? Exactly. Yep. So so that yep, go ahead. Oh, no. You go ahead.

  125. A

    I'll just say that so that's where the merge-based tools come into play. Is to say that you don't lock a file like everyone's working on their changes and then basically whoever submits first—that's great, that's the new kind of current state of the repository. And then if you are also working on a file before that change, then you need to before you can fully have your change become the new standard, you need to merge against any shared files between the two changes. So, you know, I edit main.c to add blink and led. Jason's working on main.c to add a log statement at boot. I get my LED change in first. He goes to add his print statement, and it says, oh, the newest version is newer than the version you based your change on. You need to bring down the new version, merge in your change, and then you can re-upload it, and then it can become the new.

  126. B

    Version exactly. So notice that like to do a merge-based system, you must be able to decompose the file, and so that means you know it's all—it's typically only used for text. If you're doing some kind of binary asset, you would use a lock-based system, right?

  127. A

    And many of the source control systems are able to do much of that automatically, right? Like, hey, I want to JSON modify line 5. I modified line 33. Like we'll just go ahead and assume those two things are compatible as long as if both of them were able to build, okay? And we'll just—we're not going to force you the programmer to take any action; we'll just do it silently, or right? Some tools are very explicit. Like, hey, you need to resolve every change. Like you need to improve them, and

  128. B

    Even the ones that automatically try to do the right thing after they've done the automatic merge—they give you an opportunity to make sure things compile and things like that before you know the merge is committed, right?

  129. A

    Because you could change two unrelated pieces of code. Like I could delete a variable that's not currently being used, and then JSON adds some code somewhere else that uses that variable, and an auto-merge could have run into a Problem, right? Because it thinks my deleting of the thing is unrelated to his using it somewhere else. But if you build before you know kind of doing your stuff, you'll catch that. Like, oh, hey, this doesn't work anymore.

  130. B

    Yeah, exactly, exactly. And so definitely invest some time if you're going to use version control, which hopefully we've convinced you to do. Take some time to get familiar with a good diff and merge tool. I use Meld. I think Meld is pretty great. It's been up and down in terms of—I've had issues with it in the past. A lot of those issues have now been ironed out now that they're on GTK3, but but yeah, I like Meld, but you know, I'm not you know married to it. I'm sure there are others out there that are fantastic, but whichever one you pick, get very good with it because you'll be doing a lot of that. So it's

  131. A

    Also very important to point out that like when you're in university setting or whatever, it is really kind of optional to use version control. It's important to get used to it, and it does actually have advantages. But to be fair, if you're just one guy working on something or one gal working on something, it's not a big deal. But once you start having two, three, four people, it starts to become very important as a form of communication, right? To say, 'Here's the current state of everything.' It's not, you know, oh, Joe's computer has got the latest code, so you need to go get copy his stuff, bring it to your desk and like make changes, and then Sally needs to come get it from you because you now have the latest version that would break down really fast. Yep.

  132. B

    And even if you're working by yourself, I've often been working on things that were kind of prototypes that are very early stage, and I come to a fork in the road, and it's sort of like, 'Okay, I can do some kind of machine learning here to solve this problem,' or 'I can just do a simple counting.' And I'm not really sure what to do. And so I say, okay, I'll do the counting thing, and I do the counting, and about halfway through it, I feel like, oh, I start having regrets, like cold feet, and I start thinking, 'Oh no, I need to really use an SVM here.' But I've already written half of the counting. I'm just not—I'm not feeling comfortable with it, but I don't want to lose that half in case I change my mind again, right? So so this is exactly what branching is for, right? You would have you know a branching one branch that just does, you know, simple accounting, another branch that does some kind of SVM, and you can keep them going in parallel. And so even if you're working by yourself, what you don't want to do is delete something because you're not sure if you're going to need it, right? And so version control can prevent that from happening, but it

  133. A

    Does that overhead, and version control systems in my opinion are always somewhat complicated. Like it's not always straightforward because they're trying to—they all have a process that they're built around, and they kind of assume you're using their process, and often you aren't. Exactly.

  134. B

    So then it

  135. A

    Becomes like friction between you and the way you do it. The first time I used Git, I really had that problem. Was I wasn't following the process they kind of assume, and then it was friction because it didn't make sense to me. I was just doing voodoo incantations to make it work. Yep.

  136. B

    So yep, um and

  137. A

    Then I think it's also important to point out that as you do this and you have that there's tools are optimized for different processes. So like branching—certain tools may be better at branching than others—where branching here means, like Jason illustrates, you have two divergent code paths, and like a release, you can do releases as versions as branches. So I make a branch; this is my release branch. I'm going to send this out to the customer. If there's bug fixes, we're going to fix them on that branch, but we're going to start adding new features on the mainline code, and those two may diverge over time, and then there may be another branch for the next release, the Version 2 release. But you could still add changes to the Version 1 because you have customers that need that, but Version 2 maybe people want to pay to upgrade to that and get the newest features or whatever, right? You can have those handled as branches, but there are other ways of handling it too. And then how, like if what happens if you want to do a branch for experimental stuff and then ultimately you want to merge it back into the mainline? Like is that easy or hard? Different tools are designed for different use cases, and you run into certain things being easier and harder depending on the tool you select. That's very vague and abstract.

  138. B

    No, it's true. I mean, I think that it's the first time you try and use version control; it's not going to feel very natural. That's perfectly normal. I definitely have switched among many version control systems, and every time I change is very frustrating, but every time I change, I'm glad I did. You know, when I first went to Git from Subversion, I was very frustrated, but now it's—I've kind of understood the workflow. I'm very happy I switched over.

  139. A

    Yeah, so one way if you weren't going to use version control is like the classic we were in college, everyone's writing a presentation and everyone has different—like you're a group of three writing a presentation. Everyone writes their own slides, you all email it to one person before the deadline, and they try to compile it all together. But there are obviously some slides which are shared, and then a person is forced to kind of manually go between and resolve any conflicts. That's, you know, one example. But like that happens in source code too, and source control just kind of makes that process very explicit, which is good. You can also, like as we already said, go back in time, have branches, have multiple versions, and not have to, like, have Main.c.v1 or main right v1.c or you know what other naming schemes to handle it, and even be able to apply bug fixes to old code and still be able to send that to people. Also, if you just, like snapshot at your directory every five minutes, that potentially could work for a lot of these cases too, but that'll get really big unless you are only tracking the differences, but source control is built with that in mind, so they typically are pretty efficient about storing only the differences as opposed to the whole files.

  140. B

    Yep. So there are some cons. It's not—version control doesn't solve all the problems. There's some use cases where it doesn't work. One thing to keep in mind: version control keeps the entire history. This can actually burn you pretty badly if you do something like accidentally add a, you know, 100 megabyte binary file to the version control. You should try not to do that. If that happens by accident, you can use some, you know, voodoo black magic to delete the file. You know, you can't just delete the file because it's version control; like the fact that you deleted it is there, and the history is there. You actually have to do some black magic to go back in time and delete that file. What's that? You need to purge it.

  141. A

    You need to purge it from history.

  142. B

    Right. That's right. There are different names.

  143. A

    Depending on the source control, but yeah.

  144. B

    Yeah, yeah. I think in Git it's like a rebase. You have to rebase, you know, and remove that commit. It's—it's not pretty. But anyways, yeah, you have to keep the entire history of every file. Now it's compressed and all sorts of stuff, but at the end of the day, it's going to be pretty large. So that's something to keep in mind. Another thing is that it's not really designed for archiving. I mean if you have—if you want to keep a backup of all of your pictures, this is probably not the way to do it because there's just too much overhead in all these processes that you're never going to use because you're just dumping pictures in there. So for something like that, you want to use the things we talked about in the beginning, like SyncThing and Synced, all of that Dropbox, etc., yep.

  145. A

    So we'll do a quick who's who's of who's who of source control systems, you know, that we've kind of used or heard about, talked about. And we'll kind of go his—you know, kind of in chronological order. So you'll have heard some of these. A lot of people heard of CVS (Concurrent Version Systems), there's Rational ClearCase, Microsoft SourceSafe. A lot of people's first experience that are of a certain age—I don't know how to say that—like if you worked in software in a certain time, that may have been your first encounter with it. Razor? Yeah. Then we get

  146. B

    to those were all, you know, things that were used in the '90s, and most of them aren't used today. I mean, yeah, and I say all of those.

  147. A

    Are lock-based. I don't think most of those aren't merge-based. It's more recent and has become more dominant recently, right? Yeah. I won't think it was as popular previously. Yep.

  148. B

    So in the 2000s they had SharePoint, which is also lock-based, but SharePoint targeted, you know, artists and things like that. So

  149. A

    Microsoft Documents, yeah.

  150. B

    Yeah, that's right. Yeah, yeah, artists, editors, writers—people are creating that kind of content, and it's designed for teams of people where you know collaboration on a file level just isn't important. It's really more like if you and 10 people are writing a book, but you're each writing a different chapter. A SharePoint would be good for that. The 2000s also introduced Subversion, which is very popular even today. And that's where really people got into merging and branching and things like that. Subversion today is considered kind of primitive. The way Subversion—the way you create a branch in Subversion is by copying the entire repository. So it's you know, it's a little bit primitive by today's standard, but still, as I said, very popular.

  151. A

    Then more recently we have like Git, Mercurial, and these are interesting because they're both also distributed. So instead of having a central server where everything is kind of upheld, it's in a distributed fashion, and only by convention does one of them become kind of the gold standard. Yeah, and every client kind of has their own thing. You can work offline, you can commit just locally, and then upload to a remote one host on a server. But that's only again by convention; that doesn't have to be. And so that's another difference is whether something centralized or distributed, which has impact. And so Git and Mercurial are two both versions of that. There's also impact we didn't really talk about like how you architect—like whether you have a project or repository or whatever you want to call it in the various version control systems—but basically at what level do you track stuff in one organized fashion, or do you split it into multiple ones? And as you go to a really big team that starts to have a lot of impact too for performance reasons.

  152. B

    Right. One thing to know about Mercurial: Mercurial actually has some pretty cool functionality where you can actually check out part of the repository. In later versions of Subversion and in Git, you can't do that. You get the entire repository. And in fact, I—you know, the way Git works under the hood, I don't think it even has a clear concept internally of the directory structure and things like that. But with Mercurial, you can actually set up access control on per-directory basis and things like that. So I'm a big fan of having one source control system for an entire company. Wow, that's pretty brave. Yeah.

  153. A

    I mean, well, a lot.

  154. B

    Of companies are doing this. I mean, Slack has this. Pinterest is—I believe—works this way. This is just from talking to friends, but I'm a big fan of that. I think that you know, you can set it up correctly. People are administering stuff.

  155. A

    And there's still got to be some amount of permissions per directory, right? Like you don't want one team accidentally just blowing away all your stuff one day.

  156. B

    Exactly. So that's—that's where Mercurial comes in. You can get away with this. You can use subtrees in Git and have sort of one repository, but under the hood it's really a bunch of repositories, but to the user's perspective it's just one. But Mercurial natively just supports Access Control Lists on the directory level, and so I'm trying to learn Mercurial. I haven't learned it yet, but yeah, as Patrick said, I mean you could have—you know, one version control project per team, one project for the whole company. There's many different ways to architect that. They all have kind of pros and cons. And so that's definitely something that if you know you're interested in sort of more enterprise applications of source control, that you'd want to look into. Yep, and then.

  157. A

    Also, we didn't really talk about, but all of them is also it whether or not and how they integrate with your code review process, or whether your company has a code review process. It's not.

  158. B

    Always a given. So, yeah, you should definitely do code reviews. I mean, I think it's very important to have another set of eyes looking at something. And as you said, I mean if you're using a merge-based system, it seems natural to integrate the merge process with the code review process. And so that's what you know GitHub, GitLab—a lot of these sort of source control management systems—they say okay when you do the merge, someone has to approve your merge before it goes through, and that kind of works like a code review. Then yep, okay. But yeah, definitely you know the moral story here is don't be like us. We've lost things because we didn't back up, and we had to redo work because we didn't have version control or didn't use it. Since then, we've kind of learned from our mistakes. Hopefully, you guys can learn the easy way through us. I definitely use version control anytime you're writing source code. You know one thing about Git: you don't need a server for Git because it's distributed, as Patrick said. So you can literally just type Git init if you're on Linux or Mac. You probably already have Git installed by default. You can just type Git init in any directory, and now you have source control in that directory. It's that easy. So definitely use it for your projects; it'll save you a ton of headache, and definitely back up your photos, super.

  159. A

    Important. All right. Well, that's a

  160. B

    Wrap. Thanks guys. Cool. One last kind of thing here. Oh, so someone wrote in and told us that we're in the Top 100 podcasts on iTunes. This is in the U.S. I don't know what we are worldwide or in other countries, but thank you guys so much for listening and for your support. It's truly kind of at a loss for words. I mean, it's truly remarkable. We should say. I don't know how often those

  161. A

    change. So by the time this comes out, we may or may not be there.

  162. B

    Yeah, we could be kicked off by.

  163. A

    Then yeah, we have... We have screenshots, so we'll send them to you if

  164. B

    you don't believe. Yeah, it's... I mean, like when we started, we started this what six years ago or something, which had no idea that I honestly didn't think anyone but my mom and my girlfriend at the time would listen to this. And it's just truly amazing that we've come so far, and we have so many listeners, and we just really appreciate you guys taking some time out of your day to listen to this. And we hope that we could provide a good service to you guys. All right. So

  165. A

    Thank you. Thanks, thanks everyone.

  166. B

    all right bye the intro music is axo by binar pilot programming throwdown is distributed under a creative commons attribution share alike 2.0 license you're free to share copy distribute transmit the work to remix adapt the work but you must provide attribution uh to uh patrick and i and uh share alike in kind