0:00:00Hello and welcome to Developing Perspective. This is the second in the interview series
0:00:04that I'm doing here on Developing Perspective where I sit down with an interesting iOS or
0:00:08Mac developer and talk about their experiences, some of the lessons they've learned, how they
0:00:12work, how they work productively, and hopefully help us all kind of learn and get better at
0:00:16our development as a result. These interviews are longer than 15 minutes, so a little bit
0:00:20of a break from the normal pattern on the show. I try and keep them under an hour, but
0:00:24I just wanted to let you know that I had time. Otherwise, I hope you'll enjoy. Sit back,
0:00:27and today I have Bill Dudney with me.
0:00:30All right, it's my pleasure to introduce Bill Dudney of many things, and I'll go ahead and
0:00:35Bill, introduce yourself, say what you're doing, what kind of work you do.
0:00:39Sure. So my name is Bill Dudney, and I've done a whole bunch of seemingly random stuff
0:00:46starting back in college when I first touched my first NeXT computer in, I think it was
0:00:5089 on system dot 9 which was really cool a lot of fun I did a bunch of objective
0:00:56C and did much worse in school the semester I bought my next computer and
0:01:03so that led to a bunch of whole a whole bunch of next step stuff until 97 I got
0:01:08into Java did that for a while and then decided I was fed up with the whole IT
0:01:13space and got back into the Mac and I was building a Mac app when the iPhone
0:01:18It first came out and my wife built a couple of web apps for the initial iPhone and yeah,
0:01:27they did amazing.
0:01:29We had a bazillion plays on the games that she wrote and made a bunch of money off of
0:01:32Google Ads, which was crazy.
0:01:34Like who makes money off of Google Ads on iPhone games?
0:01:38So anyway, so then when the SDK was announced, I decided it was time to stop messing around
0:01:42with the Mac app I was writing and go build the apps that she did that were the most popular
0:01:47in web technologies to rebuild them in native technology.
0:01:51So I did that and then at the same time I had gotten involved with the prags writing
0:01:57the iPhone SDK book right after I finished the core animation book.
0:02:01And so then I finished that book up and then since then I've written, I don't know, probably
0:02:06another four or five apps for both iPhone and iPad and then many of those have been
0:02:11mine and done a couple for clients and teaching at the iPhone studio or iOS studio as it's
0:02:18known now for pragmatic programmers and pragmatic studio and so a lot of random stuff, speaking
0:02:24at conferences and teaching people all over the place.
0:02:27And a brief stint working in the Mothership?
0:02:29Yes, it was a blast.
0:02:31I loved Apple.
0:02:32It was a very cool place.
0:02:34But it was hard to be away from the mountains and I really missed being able to teach.
0:02:38I didn't think that it would affect me as much as it did, but it was really hard being
0:02:44inside Apple where I couldn't blog about Objective-C or I couldn't talk about iPhone SDK or whatever
0:02:50with people outside because everybody always thought, even if I was just saying something
0:02:55random that I thought was interesting, I didn't want that ending up on Mac rumors, right?
0:03:00So I had to button my lip and not talk about it when I was outside of work, and that part
0:03:04was frustrating.
0:03:05Again, like I was telling you earlier about teaching, I love standing in front of a group
0:03:10of people and saying, "Whatever, blah, blah, blah, this cool thing about iPhone," and then
0:03:15go and watch what cool stuff they come up with and watch the light bulb turn on and
0:03:20stuff like that.
0:03:21That's just a blast and I love doing that and I really missed it.
0:03:24And I missed the mountains, so it was hard to be in California and not in Colorado.
0:03:28Okay.
0:03:29Cool.
0:03:30So speaking of Colorado, so that's where you're right now in Breckenridge, right?
0:03:33Yep.
0:03:34Maybe you can kind of paint the picture of when you go to sit down to work, when you're
0:03:39wanting to be productive, whether that's writing for your book or working on apps for yourself
0:03:43or for clients, what does that environment look like when you really want to get to it?
0:03:48Yeah.
0:03:49So my most productive time, what I try to do is I'm an early riser, so I get out of
0:03:53bed 4 or 4.30.
0:03:55I spend a half an hour sort of getting caught up on what happened the previous day.
0:03:58I read a couple of blogs and look at stuff on the net and whatever.
0:04:02And then by 5 a.m. I have my coffee brewed and I'm sitting in front of my computer and
0:04:06it's usually dark because you know at 5 in the morning it's dark or whatever.
0:04:11I like the room to be dark.
0:04:12I keep all the shades closed even during the day when it's bright outside and I you know
0:04:18just sort of that's the time after that half hour of sort of waking up and drinking my
0:04:22first cup of coffee.
0:04:23That's when I get in the zone.
0:04:24And then I'll usually work for about two and a half to three hours till around 8 o'clock
0:04:29when the family's awake and everybody's ready to eat breakfast or has already eaten breakfast,
0:04:33then I'll go over. It's been 15 minutes with my family or whatever saying good morning
0:04:36and then I come back and I get back to work. And again, that takes about 15 minutes after
0:04:42that's over to get back in the zone, but that's how I get there is sort of have the room dark
0:04:49and quiet and just sit in front of my iMac and have the brightness of the computer illuminate
0:04:56the room, but that's about it.
0:04:57So you run an iMac?
0:04:59Are you a single monitor kind of person?
0:05:01So I have two monitors and I usually keep design oriented stuff on one monitor and then
0:05:07Xcode on another monitor.
0:05:10I try to keep email hidden or quit for a couple of hours at a time.
0:05:16Although sometimes when there's stuff cooking with clients or whatever I definitely have
0:05:19email going so I can respond right away.
0:05:21But I find that to be really distracting.
0:05:23email things beep and you got a four unread messages I start getting nervous and scratching
0:05:29my chin and fighting the urge to check to make sure nothing's going on or whatever.
0:05:33Yeah, four is I think like any number below five is the worst. Because I find at least
0:05:38for myself if you have like every now and then you see someone just a screenshot of
0:05:42their computer and you'll see it's like two or three hundred unread messages or whatever.
0:05:45At that point it doesn't matter.
0:05:47Exactly. It could be four thousand, right? You just whatever.
0:05:49- It just doesn't matter.
0:05:50But what do you, from a computer,
0:05:51if you only have four or five,
0:05:52then I find that that's, or one is even worse.
0:05:55- Yeah. - What is that?
0:05:56- Yeah, it's always-- - I know what it is.
0:05:58It's one thing right there.
0:06:00- It's very hard to not look at that, yeah.
0:06:02Yeah, so if I have it quit and it's gone,
0:06:04then I find it doesn't distract me.
0:06:07But I also have to have my phone somewhere
0:06:09sitting on a cloth so the way it vibrates
0:06:12when the mail come in, it doesn't make me think,
0:06:14should I launch mail?
0:06:15I think I'll go launch mail
0:06:16and make sure that's not something important.
0:06:18- Yeah.
0:06:19And so in terms of other than Xcode, what tools and apps and things on your computer
0:06:24do you typically use when you're working?
0:06:28So I always have to have some sort of, when I'm writing, I have some sort of text editor.
0:06:33I've been using TextMate.
0:06:34I've been playing with the free BB Edit thing and then even just TextEdit to edit XML or
0:06:44markdown stuff or whatever for stuff that I'm writing.
0:06:47When I'm working on the book or a book for Prague, I'm usually writing in XML.
0:06:54And a lot of people complain about that, but I don't really find it to be that distracting.
0:06:57I guess it's sort of like I have the four or five tags or whatever that I use all the
0:07:01time.
0:07:02Sure.
0:07:03So it doesn't really get in the way for me.
0:07:05Some people, it drives them nuts and they can't ever like get over the hump of being
0:07:09able to just use those four or five that they use all the time.
0:07:13So yes, so that's either TextMate or I think it's called Text Wranglers for listening.
0:07:19Yeah, so people who make BB editors.
0:07:20So you're editing that just in a regular, just a raw text editor with syntax highlighting
0:07:24and all that.
0:07:25Yep, exactly.
0:07:26And so, I mean, the bulk of what goes into a book is text, right?
0:07:30And so there's only a little bit of markup around, you know, this is a class name or
0:07:35this is an Objective-C method name or whatever.
0:07:38So I find I'm really, I'm using those four or five tags, paragraph, Objective-C method
0:07:42in Class Name a lot and the rest of them, you know, there's a ton of flexibility in
0:07:46there in terms of how you can organize stuff and tag it and everything, but yeah.
0:07:52Other tools that I use, I use OmniGraffle a lot to draw pictures, and I do that for
0:07:58both. So when I'm doing either training for Pragmatic Studio or I'm doing public speaking
0:08:03at conferences like CocoConf or whatever, a lot of what I try to do with my presentations
0:08:09is be very visual. I hate going to presentations where there's a thousand words on the screen
0:08:14and I hate sitting through those and I don't want to make presentations like that. So I'm
0:08:18typically doing something very visual. It's either, you know, a screenshot of something
0:08:23going on on the screen or it's a OmniGraffle drawing or whatever. So that's a tool that
0:08:29I use a lot for doing those things. Sometimes it's really helpful for me to use OmniGraffle
0:08:35to sort of sketch out an idea to, like when I'm thinking about, especially if I need to
0:08:40conceptualize the classes of something. Sometimes I'll draw pictures, you know, I hate UML.
0:08:46I used to be a big proponent back in the Java days of doing UML. So I try very hard not
0:08:51to do anything that's even remotely resembling UML. But what I'll do is drop a box, name
0:08:56it, whatever, you know, some class name, and then write some notes about it, and then sort
0:09:00of use that to visualize the interconnections between the classes and how they're going
0:09:04talk to each other and divide up the responsibilities and stuff.
0:09:07Yeah, I always find that I just do that in Xcode.
0:09:12My approach for whenever I'm kind of, if I'm going to sketch something out, I'll just do
0:09:16file new class just ten times and kind of, I don't know, I always think in code I guess.
0:09:22For me that's where I start playing with it is.
0:09:25And for me, more often than not, once I've got a couple, like once you get your beachhead
0:09:31of like, "Okay, this seems to be working, and I'll just keep running in Xcode."
0:09:34Oh, yeah.
0:09:35So I find that, or I guess it's on a whiteboard, but...
0:09:37Yeah.
0:09:38So I find sometimes I do that, and sometimes it's really productive for me to start an
0:09:42Xcode and creating new classes.
0:09:45What I find a lot of times is I'm most productive if I do that and then delete all that code,
0:09:51or at least push it aside and start over from scratch.
0:09:55Because what I'll do when I'm like, "New file, new file," and I'm connecting these classes
0:09:59and just basically hacking to see how I think I want this thing to work, is I get to an
0:10:04idea where I'm like, "Aha!
0:10:06That's the way it ought to work.
0:10:07Oh, but I have all this garbage that I've created."
0:10:10I was creating a relatively large XML parser that was taking XML and turning it into Objective-C
0:10:17objects and then vice versa.
0:10:20I asked to have written it three times because I wrote it the first time like, "Oh, this
0:10:23is horrible."
0:10:24And then I started writing out in OmniGraph what I was going to do.
0:10:27I was like, "Oh, this is horrible too."
0:10:29So I pitched that and then I went back to code and created a whole bunch of code.
0:10:32"Oh, this is all horrible, but if it did this…"
0:10:34Right?
0:10:35So it was like the third time was the charm.
0:10:37I talked to a lot of people who have a hard time pitching that code.
0:10:40They're like, "Oh, I just spent a week writing all that code."
0:10:43You know, but if you've got to maintain it for six months, oh, I'd much rather pitch
0:10:47that week's worth of bad code and start over.
0:10:49What kind of version control do you use?
0:10:52That's one thing that I've often…you always hear about, like, for example, Git or Mercurial
0:10:56or one of those.
0:10:57"Oh, the lightweight branching is great," for exactly that kind of reason, where you're
0:11:01creating these experimental or thought branches rather than having it be a big, heavy operation.
0:11:07Is that the kind of way you do it?
0:11:09So, you know, I try to love Git, but it's like, how can we make the simple stuff as
0:11:16heinously complex as possible and then make the really difficult stuff possible?
0:11:22I hate that mentality.
0:11:24I'm really glad that it's free and that it's open source and I love GitHub because you
0:11:27can share stuff and whatever.
0:11:29I love that.
0:11:30I just find Git to be so insanely complex to do really simple stuff.
0:11:34I'm working on a project with my son and in order for us to share code I have to commit.
0:11:39Oh, but wait, commit doesn't do it.
0:11:40I have to commit minus A. Oh, wait, I've got this other thing because he committed one
0:11:44file.
0:11:45Now I've got to pull.
0:11:46Now I've got to commit again.
0:11:47Now I can actually push it.
0:11:48And that just drives me up the wall.
0:11:51But the client wants that, wants it in Git.
0:11:53So whatever, I'll do it.
0:11:54It's just not my favorite.
0:11:56So I just use subversion or I sometimes use get, but it's behind the Xcode make a snapshot.
0:12:04So that makes it really simple to sort of revert.
0:12:07I find if I'm doing a lot of hacking where I go down a thought branch and I pitch it,
0:12:12I want to make a snapshot so that I keep that around but it's not in the normal stack of
0:12:18stuff.
0:12:19I guess I've heard that that uses Git behind the scenes.
0:12:23But I don't care, right?
0:12:23Because it's so simple.
0:12:25Oh, look, here's the list of snapshots.
0:12:27It can get out of hand, and I wouldn't use that as my version
0:12:29control system, because it's all flat and just ends up
0:12:33in one long list.
0:12:33But just as a thought experiment thing, I like doing that.
0:12:37Because it's simple to do.
0:12:38It's so much simpler than Git, push, commit, blah, blah, blah,
0:12:41whatever, dance.
0:12:42Oh, sure.
0:12:42I think at Git, I've been using it for so long
0:12:45that I think it's just grown on me.
0:12:47I have the Stockholm syndrome of it now.
0:12:49the problem. It always feels a little heavy-handed for a lot of what it does. And I don't use
0:12:57Git, I think, in a way that I read all these, like, you know, whatever, Pro Git or whatever,
0:13:03Git flow, all these like methodologies and things where you have like 27 branches for
0:13:07all like anytime you start a new concept, you create a branch for it and all this. And
0:13:12for me, I've always found that to be so it's like I'm spending all this time and work building
0:13:17something that doesn't actually work.
0:13:20It's like I'm just playing around outside of my actual job and what I'm trying to do.
0:13:26So the only closest thing to that that I ever do with Git is, one thing I love is that you
0:13:31can branch after you've made a bunch of changes rather than having to do it ahead of time.
0:13:37That whole concept blows my mind where I'm like, "I think I'm going to do something experimental,
0:13:42so I'm going to make a branch."
0:13:43That's never how my mind works.
0:13:45I think about the problem I'm working on.
0:13:50I'm just working on the problem.
0:13:52I'm not really cognizant that halfway through that, I went in this crazy experimental direction
0:13:57more often than not.
0:13:58So what I love is that you can be developing on whatever branch you're on and then you
0:14:04can take your working copy and just say, "Okay, maybe I shouldn't have done it this way."
0:14:13You can just take that, put it off in a branch, and then just go back to where you were before,
0:14:19which is something that I've only seen in some subversion or something.
0:14:25It's much more difficult, in my experience, was to play with those kind of things, like
0:14:29to take your working copy and stash it off somewhere.
0:14:33Do you find yourself going back to those branches?
0:14:36I find that what I typically end up doing is I'm going back to them to grab a method
0:14:41or to grab a little snippet of code rather than necessarily--
0:14:46and I think it's like what you were talking about before,
0:14:48where it's often you'll end up--
0:14:51in order to arrive at the good solution,
0:14:53you end up having to drive through all these crazy twists
0:14:56and turns.
0:14:57And often you'll have these tiny little nuggets in between
0:15:01that I actually want to keep, but I
0:15:03want to get rid of the bulk of that
0:15:05and just put those back into a good framework.
0:15:07And so that's what I'll end up doing.
0:15:09Yeah, maybe I need to read ProGet or something.
0:15:13Because I don't--
0:15:15I've never found those-- I mean, I have--
0:15:18on almost all of my projects, I just have master.
0:15:20And then I have these little stashes of code
0:15:24branching off the sides, just to--
0:15:28rather than having this broader process.
0:15:31And I've never found-- and a lot of that, too, I think,
0:15:33is because it's just-- you have to have a different flow when
0:15:38you're working with a team of people, like five or six people.
0:15:40And so, I mean, I think we're both fairly similar in the sense that we're not doing
0:15:45these big corporate projects where it's like you and a team of ten people and you have
0:15:49to have a whole process.
0:15:51And you even have like, often you'll have like the guy on the team, the poor guy on
0:15:55the team whose job it is to manage the version control system.
0:15:59The guy who's doing the merges and builds.
0:16:01I mean, that's not a good job.
0:16:03Pain, yeah, pain.
0:16:05I guess some people are built that way, but it's not me.
0:16:07Yeah.
0:16:09But cool.
0:16:10So that's-- and then in terms of--
0:16:12do you find you use different tools when you're doing--
0:16:16so like, if you're going to be working on code for one
0:16:20of your training things and your book,
0:16:22and you're doing all the source code,
0:16:24do you build that in a different way
0:16:26or using different things than you would if you're actually
0:16:29writing production code?
0:16:31Yeah.
0:16:32So what happens with that a lot is when you're teaching somebody something a lot
0:16:37of times what you have to do is put aside the complexity that you know needs to be there
0:16:43in order to make it good code in order to illustrate the point
0:16:46that you're trying to get across.
0:16:47So if you're trying to teach someone about, I don't know, NS arrays or whatever,
0:16:53you might do something in where you're trying to get someone to understand what an NS array is,
0:16:58especially if they're new to programming.
0:16:59And, you know, there'd be different things.
0:17:01if it's someone new to programming versus someone who's an experienced programmer but
0:17:04is just trying to learn iOS.
0:17:06But if you're trying to teach someone NS array, for example, and they don't know anything,
0:17:11you might approach NS array in a completely different way than you would already knowing
0:17:15how to do iOS programming and you're sort of in the culture of iOS.
0:17:20You want to bring people in slowly from a conceptual space of "I don't know anything
0:17:25about programming and I've never broken down a problem into small pieces like that" to
0:17:29get them to understand what an array is and how it holds a list of things and they're
0:17:33ordered and whatever, where you would never do that if someone was an experienced programmer
0:17:38and they're coming from Java or wherever, and they already know what a list is in Java.
0:17:43You just need to help them translate from list to Java.
0:17:45So I find I build more than probably the average iOS developer.
0:17:51I'm hitting Command-Shift-N in Xcode just all the time, because in class we build, I
0:17:57know, 15 different projects from scratch that we then end up at the end combining the ends
0:18:02of those three or four different trails into one big app where we take that stuff and reuse
0:18:07it and whatever.
0:18:09And so, you know, every time I teach a class I create 15 or 20 projects at home.
0:18:14Every time I'm writing a new one-hour presentation for CocoConf or if I'm, you know, I'm doing
0:18:19a full day talk at SwipeConf in Australia in a couple, like a month, talking about core
0:18:27graphics. That's another place. You know, I create a brand new project from scratch
0:18:31and I do stuff in those new projects that, as a new developer, how many times, I mean,
0:18:36as an experienced developer, you create one project and then you work on it for years,
0:18:42right? And so I do a lot of that stuff that's probably out of the norm for someone. But
0:18:48On my iMac, I'm always running Terminal and Xcode and TextMate, OmniGraffle most of the
0:18:56time, not always, but most of the time.
0:19:00And those are probably, those are the three big things, Xcode and Terminal.
0:19:03And yeah, I'm always doing stuff in Terminal.
0:19:07I tend to be, I don't know if it makes me a neckbeard or not, but I tend to trust the
0:19:11command line for subversion or get a lot more than I trust Xcode.
0:19:17And I don't know if that's just me being curmudgeonly or whatever, but I tend to do all that stuff
0:19:22through the command line instead of through the Xcode tools.
0:19:24>> Yeah.
0:19:25Well, I never use the Xcode tools for version control.
0:19:28I've been bitten by them a few too many times.
0:19:30>> Yeah.
0:19:31>> But what I find for Git especially is Git Tower.
0:19:33There's an app called Tower for your...
0:19:35I think it's just called Tower actually, but it's just a Git client.
0:19:38Because I find what it does...
0:19:40The one thing that I like that it does...
0:19:41Because Git has that weird two-phase commit to stage and then actually commit.
0:19:46It makes that process much more obvious, especially coming from a subversion background.
0:19:51Okay.
0:19:52Well, I'll have to get that then.
0:19:53Because I'm so used to, yeah, in a subversion background, we're just like, you just like
0:19:57SVN commit.
0:19:58Right.
0:19:59And you're done.
0:20:00If you've added new stuff, it adds it.
0:20:02And if you, you know, it reverses having to do this sort of selective, which can be great,
0:20:06but it's...
0:20:07Yeah.
0:20:08Right.
0:20:09It introduces a huge level of complexity that, you know, with subversion, I was used to pleasantly
0:20:14ignoring that complexity.
0:20:18So switching gears slightly, one of the things that I definitely wanted to talk to you about
0:20:21is so you obviously do a lot of training and teaching for adults, for people who are coming
0:20:29to your classes or going to conferences or those kinds of things.
0:20:33But I know also that your son's a developer and those kinds of things.
0:20:38And one thing I've always wondered about, I have a son, he's three right now, so it's
0:20:43It's a little early, probably, but I've always been thinking about how do you teach programming
0:20:48to kids?
0:20:49I was curious how you've done that in terms of, as an educator, it's one of these things
0:20:55like in my mind I have this dream of my students changing from my company to Smith & Son.
0:21:04How do you actually start it?
0:21:08So my oldest is definitely...he's got that personality where he wants to take everything
0:21:14apart and he wants to learn everything.
0:21:18Yeah, I mean, it's phenomenally fun to work with him, too.
0:21:22I've done two projects.
0:21:24One project is completed, it's in the store and has lots of positive reviews and stuff,
0:21:28so it's really cool.
0:21:29And then another one we're working on right now together, and it is insanely fun working
0:21:33with him.
0:21:34If you can make it and sons, it's awesome.
0:21:37Or and daughters or whatever.
0:21:38It's so much fun.
0:21:40But it's definitely a personality thing, I think.
0:21:45'Cause we have a lot of kids and other kids,
0:21:49he's now 15, I forced him, and he would say I forced him,
0:21:55to go through the book called "Learn to Program"
0:21:59from Chris Pine, published by Pragmatic.
0:22:01Phenomenal book.
0:22:02It's focused on Ruby, so if you are definitely focused on iPhone, it might not be the right
0:22:06book if you want to learn how to program for iPhone.
0:22:09But if you want to learn how to program, it's a fantastic book.
0:22:13So he finished it.
0:22:14This is like he was 10 or 11 years old, so it was three, four, five years ago.
0:22:18When he finished it, I looked at his work and he did all the right stuff.
0:22:21He'd get all the programming done and he handed me the book and he said, "I never want to
0:22:25do this again."
0:22:27So you know, I mean, it's just a personality thing where my older son just ate it up and
0:22:31and he loved that kind of stuff.
0:22:33He was reading Stephen Cochan's Objective-C book
0:22:36when he was 11 and doing all sorts of crazy stuff.
0:22:39But to start with, the place he started was Lego Mindstorms.
0:22:43And I can't say enough good about Lego Mindstorms.
0:22:45They are so awesome, especially if your child is into Lego.
0:22:50Just so many cool things you can do on the mechanical side
0:22:53from building the robots.
0:22:55And then you can also go and program them using,
0:22:58they have a visual programming environment,
0:22:59which is a great place to start.
0:23:01teaches you loops and branches and stuff like that.
0:23:04Drive forward for five feet, stop for five seconds,
0:23:06drive forward for five more feet,
0:23:08put on a sensor, a touch sensor, and if you
0:23:10feel a push on the touch sensor, then turn around,
0:23:13things like that.
0:23:14When you say visual programming, so that's sort of like you're
0:23:16dragging in components and wiring them up physically,
0:23:20rather than doing it in code.
0:23:23And it looks like LEGOs, which is kind of cool.
0:23:25So you drag out a block that says,
0:23:27if the touch sensor is hit and then it has a branch on it,
0:23:32and that branch then says turn the motor
0:23:34to reverse for five seconds.
0:23:36That kind of stuff.
0:23:37And so you drag these blocks out,
0:23:38you connect them by drawing lines
0:23:40similar to the way you do an interface builder.
0:23:42And so they have places where inputs come in
0:23:44and places where outputs go out.
0:23:46And so with that then, the person
0:23:49can understand the basics of programming, branching,
0:23:53and looping.
0:23:54And to a certain extent, variables,
0:23:56although it's not very focused on that necessarily.
0:24:00It would be like a sensor, and then that sensor has an output.
0:24:03And so it's kind of a variable, but you don't really
0:24:05get the feel for it.
0:24:07But from there, you can go-- staying on LEGO Mindstorms,
0:24:10building your robots, you can use something called Not Quite
0:24:13C, which is most of C, but it doesn't have a preprocessor
0:24:17and a couple of other things to simplify the compiler.
0:24:20And it will-- I think it uses GCC behind the scenes.
0:24:22It compiles down to assembly language for the processor
0:24:26that's on the Lego Mindstorms.
0:24:28And it also has an environment that'll push it over the USB or IR port
0:24:32to the device and then you can run your programs that you wrote in C.
0:24:36So that was part of the progression that my oldest took, is he first did
0:24:40Lego Mindstorms with the visual programming,
0:24:42then we got not quite C on it, and then at the time I was really into Java in
0:24:462003 or something, and so we got
0:24:48there was a Legos Java VM that ran on it, and we went down the path of
0:24:53trying to make that work but the tools on the Mac were not very good and so we
0:24:56ended up abandoning that but I think on the PC side that that works so you could
0:25:00through a VM you know with Parallels or whatever be able to do that and then he
0:25:06spent a little bit of time with squeak and scratch which are both small talk
0:25:09based environments from the MIT Media Lab both of those are really cool and
0:25:14then from there he just one day he said I want to write games and he started
0:25:19studying OpenGL and then that led him to linear algebra and so.
0:25:23I mean, he's got that personality where he'll just rip apart everything and he wants to
0:25:27understand stuff.
0:25:28We were talking the other day and he said, "You know, I really wish I had a time machine
0:25:33so I could go back in time and have enough time to learn everything."
0:25:38So it's definitely a personality thing.
0:25:43And I also did...
0:25:45So we homeschooled, so we're part of a homeschool community in Breckenridge, and we did a class,
0:25:49lot of people are asking how did you get Andrew into programming and stuff, friends and stuff.
0:25:53And so we did a class with like, I think we started off with nine kids and we ended with
0:25:59six. Three of them had to drop out for various reasons. But we spent an entire year, once
0:26:05a week for two hours we spent doing programming. And that was just complete basics. This is
0:26:12an array, this is an if statement, this is a for loop, and that kind of stuff. And yeah,
0:26:19What that taught me was that every kid is different and some kids are wired to do programming
0:26:27and some kids aren't.
0:26:28Not to say that they can't learn it, it's just some kids' personality style is they
0:26:32like to take things apart and figure out how they work and then see if they can put them
0:26:36back together.
0:26:38And some kids don't.
0:26:39I mean, you know this in adults too, right?
0:26:40You talk to some people and they're like, "Oh, awesome.
0:26:43I put gas in my car and I stick the key in the ignition and it runs."
0:26:47And other people are like, they're ripping apart their motor to find out how pistons
0:26:50work or whatever.
0:26:51So, you know, kids are the same way.
0:26:53So it is interesting.
0:26:56And it's difficult to push.
0:27:00You can pull, but it's really difficult to push.
0:27:03And so it's a fun adventure, though.
0:27:06It's really cool watching, especially when you get the kids whose, the light bulb goes
0:27:09on, they're, you know, hacking at two o'clock in the morning, sending emails.
0:27:13"Hey, I tried to get this core animation thing to work and I couldn't and this is my code."
0:27:18And I was thinking back to when, as you're talking, it's like I was trying to think how
0:27:23I got into it.
0:27:24And I think my first, the closest, the first time I ever did anything that would be considered
0:27:28programming was I think Logo?
0:27:30Is that what it was called?
0:27:32The Little Turtle?
0:27:33I think it was on a Sinclair Spectrum.
0:27:35Wow.
0:27:36Which was, I mean, I have no idea when that was, I have no idea what age that was, but
0:27:41I just remember making the turtle go around.
0:27:45- Yeah, that's awesome.
0:27:46- And then it was basic on the old Windows that shipped,
0:27:50I think it shipped with the old Windows 3?
0:27:53- Yeah, way back in the day.
0:27:55- It was QBasic or something like that?
0:27:57- Something like one of the basic derivatives.
0:27:58- And I just remember that was,
0:28:00and from as early as I can remember almost,
0:28:04it's like you have that aptitude for it,
0:28:07and it just stuck.
0:28:10And it's like now that's how I make my living.
0:28:12That's kind of a crazy thing to think about.
0:28:13It started off with making turtles go around a screen to--
0:28:17Isn't that crazy how that stuff unfolds?
0:28:19My first was a Commodore 64.
0:28:21And I wrote this awesome-- remember--
0:28:25it wasn't Minecraft.
0:28:26No, it was Missile Command, where you had the things
0:28:29and you could choose which base.
0:28:31Kind of style.
0:28:32There's incoming nukes and you would shoot missiles
0:28:34from the ground.
0:28:36And I think it was called Missile Command.
0:28:38Anyway, so I had one that a balloon floated across the sky and you had to shoot the balloon.
0:28:42I had a single missile base at the base.
0:28:44And so I spent hours and hours and hours, till two or three in the morning, writing
0:28:48this program and I had it on a cassette, right?
0:28:51Because that was off the Commodore way back in the dark ages when there was barely electricity.
0:28:55Well, this tape got eaten by the tape machine.
0:28:59I was so mad, I put the whole thing back in the box and shoved it into my closet and I
0:29:04didn't program again until I was in college.
0:29:06That was a crazy thought, but I remember the same thing, that Sinclair Spectrum.
0:29:11I remember when I played games on it all the time, you put it into your tape deck and hit
0:29:17play and you wait while it loads the program onto the computer from your cassette player.
0:29:22Isn't that crazy?
0:29:23Yeah.
0:29:24At least it wasn't punch cards, right?
0:29:25You can read stories about people with punch cards.
0:29:28At least it was relatively convenient to make copies.
0:29:32Yeah.
0:29:33You could just put it into--
0:29:36Tape to tape.
0:29:37And you tape to tape, high-fi, and off you go.
0:29:40Yeah.
0:29:41Yeah, those were the glory days, right?
0:29:42Now it's kids these days.
0:29:45Kids these days, I tell you.
0:29:47Yeah.
0:29:48So shifting gears again slightly.
0:29:51One thing I was always curious about for someone
0:29:53who's been working on-- who's been doing this for a while,
0:29:56and especially from the progression from back
0:29:58in the Mac days and Xcode as it's progressed
0:30:00in all the different ways.
0:30:01it's like how many how's your debugging process like and how do you go about
0:30:07when you're when you hear when you hear bug how do you go about trying to nail
0:30:12it down and find it and what's your mindset and your approach for that so
0:30:16the first thing I do is is think through the problem and and what I try to do the
0:30:23end this is something I tell all my students is apply the scientific method
0:30:27And that sounds sort of glib or whatever, but so many people don't.
0:30:31They just sort of start randomly sticking log statements in their code and break points
0:30:36and clicking around until they find something that they think is the problem and they apply
0:30:41a change that they copy from Stack Overflow or who knows where, and they click the Go
0:30:45button and the bug is gone in the path that they expected.
0:30:50And what I find happens, and I'm guilty of doing that too, right?
0:30:53It'd be the same thing when I'm in a hurry.
0:30:56What I find when I do that is I've masked the bug.
0:30:59I haven't actually found and fixed the bug, I just changed its behavior and so now the
0:31:02bug is still there but I don't see it because the path I've been following is fixed.
0:31:06And so I first try to think through, okay, what's the real problem?
0:31:11And then I start putting things into the code to force that, you know, to test that hypothesis.
0:31:16It's either true or it's false.
0:31:18And if it's not true, then I have to rethink.
0:31:22Or if it's partially true.
0:31:24So for example, if you expect the box to be pixel-aligned that you're drawing with core
0:31:29graphics on the screen, and for some reason it's showing up fuzzy, well then you can go
0:31:33through and say, "Oh, well duh, the obvious problem is I'm not rounding my rectangle to
0:31:37integer or half integer boundaries or whatever," right?
0:31:40So then I go through and I look and see, "Well, I'm actually doing that.
0:31:44Okay, well now what's going wrong?"
0:31:47So then I would form the next version of the hypothesis to say, "Okay, well, I must be
0:31:52changing that rectangle somewhere else, right? So then I might put a watch point with LLDB,
0:31:58put a watch on that variable, or whatever like that to sort of track down what's really
0:32:03the problem. And then I try to go as far as I can to prove to myself that that really
0:32:07is the issue before I apply a change. Then I apply the change and test to make sure that
0:32:13it really did, leaving all that logging or debug statements or whatever that I put in
0:32:18with the debugger and so forth, leaving all that stuff in place until, okay, so the behavior
0:32:24stopped manifesting itself, but did I actually fix the real problem or did I just mask it?
0:32:29So I try to put enough instrumentation in my code, meaning things like log statements
0:32:34or breakpoints that I turn to continue and put log statements inside the breakpoint,
0:32:39put enough of that stuff in so that when I think I've fixed it and I run, I can see the
0:32:44real issue.
0:32:46Another thing that I found really helpful is if I'm doing something like a networking
0:32:51code or something that is happening in the background and it's happening repeatedly,
0:32:55you're downloading 100K of JSON or whatever, and if you put a breakpoint for every 4K that
0:33:01comes down, you have to continue, continue.
0:33:04It gets so tedious that I just don't do that.
0:33:06So what I do is put in log statements and wrap that in a hash if def debug or something
0:33:12like that so that it would only happen when I have the debug thing on. And then I leave
0:33:16that code in there forever because I find a lot of times I am being an idiot with writing
0:33:21networking code and it just sucks in a whole number of ways. And so I put that instrumentation
0:33:27in there, flip on the switch that turns on the logging, and I watch that logging that
0:33:31comes out to determine if I'm really, if I'm getting it right or if I'm doing something
0:33:36wrong. And I'll put statements like, "Is this thread the foreground thread?" And if it
0:33:42is, and I print out an error message saying, "Hey, idiot, you're running your networking
0:33:45code on the foreground thread. You're going to host somebody." And then I always run that
0:33:51with that test flag turned on to print out those logging statements before I declare
0:33:56a branch or a whatever or ship it or make it beta or whatever, just so that I get some
0:34:00sanity check that all that stuff that I put in is doing the right thing.
0:34:06are like things where I'm observing bad behavior. Another thing that I try to do every time
0:34:12before I ship something is run instruments against the code and not just like leaks because
0:34:19a lot of people that I run into run leaks, but I run leaks, the allocation instrument,
0:34:24I run time profiler, I run the core animation instrument and check my frames per second
0:34:28on all my animations and stuff. And I try to do that again before I ship anything off
0:34:32to beta or any other release that anybody else is going to see. And I use the allocations
0:34:39instrument to look at not just am I growing constantly in memory, but how many I expect
0:34:46that I'm parsing JSON so I have a thousand strings because there's a thousand strings
0:34:50coming out of this JSON file. Do I have 12,000 that are transient? Huh. And I scratch my
0:34:56head and start looking at why is that going on. And what I often find is when I do that
0:35:02stuff, I find problems in my code that would have never come up unless I had done that.
0:35:09Because it's not technically a bug. All I'm doing is taking electrons from the battery
0:35:13and increasing entropy in the world, right? Which is a bad thing. And so those are sort
0:35:20of the big things. I put breakpoints and I tell the breakpoint to log and autocontinue.
0:35:26I put breakpoints in and then examine the program at a particular spot in the breakpoint.
0:35:31And then I put logging statements in that are wrapped in some sort of flag that says,
0:35:34do this log or don't do this log, and then use instruments a lot.
0:35:37Yeah.
0:35:38Interesting with instruments, it kind of makes me think of it's like it's the difference
0:35:41between a program working and it working well.
0:35:45Because it's often, at least I find it's relatively easy to make something work.
0:35:50You can get it, it's like you can get the intended result to happen.
0:35:55But the challenge is usually, it's like the difference between the, like a college professor
0:36:00who always said there's always a naive implementation,
0:36:03and then there's the right implementation.
0:36:06And almost always, it's like you can make something happen.
0:36:10Like you say, and it will work fine.
0:36:12And I often find this especially,
0:36:14but it's the difference between when
0:36:16you're developing the simulator.
0:36:17And essentially, you have infinite speed
0:36:20and infinite memory.
0:36:21And everything's-- your connection's always wonderful.
0:36:26And it works in those circumstances.
0:36:29And then you'll run it on-- you're doing your compatibility
0:36:32testing.
0:36:32You'll put it on an old third gen iPod touch.
0:36:35And you're just like, oh my goodness, what is going on?
0:36:37This is not my code.
0:36:38Who wrote this horrible stuff?
0:36:41This is not going to work.
0:36:43But instruments is a great way to find those kinds of things
0:36:47that it's working.
0:36:48But animations is another one.
0:36:50Where it's like, it's working, but it's at 30 frames a second
0:36:54or whatever.
0:36:54And so you're doing something, or you're
0:36:57being non-optimal in your implementation.
0:36:59- Yeah, and I love that, especially when you flip on,
0:37:02I'm just that kind of person who is,
0:37:05I don't know, it irritates me if I expected a thousand
0:37:10strings to be allocated in pitched, and there's 12,000.
0:37:13Like, what is, like, that's just wrong.
0:37:16Something's messed up there.
0:37:17And it's the same thing of like,
0:37:19looking at the VM tracker.
0:37:21Okay, when my app is running and it's in a steady state,
0:37:24I don't want to have more than 12 meg or 14 meg
0:37:27of dirty memory. I just set that as a goal for myself on any app that I ship because
0:37:33it's one screen full of information, which is probably about 3.5 meg on an old iPhone
0:37:40on a new one. It's probably whatever that is, 10 meg, something like that. And then
0:37:43a couple of meg for data. And that's it, right? Because the data that displays that stuff
0:37:48on screen should only be a small amount. So, you know, especially if you're using Core
0:37:54data or whatever to fetch your data, you have no excuse to fetch all the customers in China.
0:37:59And hopefully that's a billion people who bought your product.
0:38:01But you should never fetch all that into memory at once.
0:38:05And so I love looking at that and sort of digging into those problems.
0:38:08And probably would have made a good tester or one of those QA people who breaks everything.
0:38:14But I like digging into that and finding stuff.
0:38:16It's really fun.
0:38:18One of the things I used to do at Apple that I really loved was helping people who would
0:38:22come in with their apps and say, you know, whatever, this app looks really cool but it
0:38:26doesn't perform very well. And you look them in the eye and say, have you run instruments?
0:38:32And you can tell, because some people hesitantly say, yeah. That's the person who ran leaks
0:38:38like two weeks after they started the project and not again. Most people say, what's instruments?
0:38:45And so you sit down with them and you start showing them in their code. You've never looked
0:38:48at their code before, right?
0:38:49I don't even have access to their code.
0:38:51And I look and say, oh, yeah, see here you're doing
0:38:53networking on the main thread.
0:38:55Oh, and see over here, you're allocating 4 million strings
0:38:57and throwing away 4 million strings.
0:38:58What are you even doing?
0:38:59Like, were you dropped off a turnip truck?
0:39:01What are you talking about?
0:39:03I was never rude to people.
0:39:04But it's really fun to go look at that stuff.
0:39:08And oh, look, this animation's running at 15 FPS.
0:39:11And everything is transparent.
0:39:12See all this red?
0:39:13This really shouldn't be here.
0:39:15So it's fun.
0:39:17I definitely noticed that every time I've gone to a lab at WWDC, almost always the first--
0:39:22and it doesn't even matter necessarily what the problem is I'm having.
0:39:26I've never really ever had a debugging or a work session with one of the people at WWDC
0:39:32lab that didn't involve launching instruments for something.
0:39:36And it's one of those things, though, for the first-- probably the first year or two
0:39:40of being an iOS developer, I never ran it, ever.
0:39:45just never, other than like you say,
0:39:47every now and then running, it's like if I have a leak
0:39:48that I'm trying to track down, it's like,
0:39:50oh, I'll run the leaks tool, that's what it does.
0:39:52But it is, it's this, and it's, for me,
0:39:55it's always one of my highlights of the actual sessions
0:39:58at WWDC are like the what's new in the developer tools
0:40:02instrument stuff, because it's one of these things,
0:40:05like the first time you ever see them,
0:40:07all the little, like the magic check boxes,
0:40:09is the thing that always like blows your mind,
0:40:11where you hit the box and all of a sudden,
0:40:12everything turns green, that's wrong.
0:40:14for whatever definition of wrong is.
0:40:18I have to do off-screen drawing, so it turns this color.
0:40:21It's transparent, so it's doing this.
0:40:23And it's just this amazing thing where
0:40:25it's able to show you the problem in a way that almost
0:40:29doesn't seem possible.
0:40:31That somehow, it's like, how does it know
0:40:33that's where the problem is?
0:40:34And it's like, well, that's--
0:40:35It's awesome, isn't it?
0:40:36It's like they wrote the frameworks on the one end
0:40:37and the tools that debug the frameworks.
0:40:40It's so cool.
0:40:40And the power of DTrace, too, right?
0:40:42I mean, it's like the incremental cost of having that in there and turned off is nil,
0:40:47virtually.
0:40:48It's almost nothing.
0:40:49And so you can just spread that stuff everywhere and then flip it on like a switch.
0:40:54You could even – I haven't actually done this in any production app, but you could
0:40:57build your own D-Trace stuff and stick it in your app and then you could run it against
0:41:01instruments and see if your app is doing what you expect.
0:41:04Yeah, I just love instruments.
0:41:06It's like a – I tell my students in class, it's like a code spelunking tool.
0:41:12Like, you see the surface of the mountain and it's very pretty, but when you go spelunking
0:41:17into that mountain, you see the guts, you see what's inside of it, and that's what you
0:41:21get out of instruments is you get to see what's really happening.
0:41:25And we often, within so many different things that we do in life, we have a plan and we
0:41:31start executing it and so many things distract us from the one path that we have laid out.
0:41:36That's what happens with code is you start with this plan, this beautiful abstract design
0:41:40that's perfect in your mind, and then real implementation gets in the way, right?
0:41:45And you end up with all this messy junk.
0:41:47If you don't go back and look at it with instruments, you know, I mean, do you remember what you
0:41:52wrote six weeks ago?
0:41:53I don't even, right?
0:41:54It was yesterday.
0:41:55I forget the stuff that I wrote yesterday.
0:41:57So I just love instruments as a tool to be able to help you figure that stuff out and
0:42:01see what's really going on.
0:42:04The OpenGL ES tool, I don't know if you got a chance to look at that or if you play much
0:42:07with OpenGL.
0:42:08And I'm by no means an expert.
0:42:10My son is big time into that stuff, but I love the OpenGL expert and the other OpenGLES
0:42:16tools.
0:42:17You can tap one button and it captures the entire frame, all the buffers that you're
0:42:20drawing data into and shows you them graphically.
0:42:24All the textures that are bound, how they're bound, flip a switch and it will start running
0:42:30your code through an analyzer that basically turns off the fragment stage.
0:42:36Does the performance change?
0:42:37Okay, well then your fragment stage is probably fine.
0:42:39turns off the vertex stage, oh look at that, the performance went up to 60 FPS, I bet your
0:42:44vertex shaders are hosed.
0:42:46And so then it points that out to you without you having to go through and tweak all that
0:42:50stuff yourself.
0:42:51It's just amazing, it just blows me away how cool it is.
0:42:54Yeah, I've only ever seen the OpenGL stuff in like the WDC sessions.
0:42:57It's one of those things that I've done, I've written almost every kind of game, or almost
0:43:03every type of app you could imagine, and used almost every framework, except things with
0:43:08with OpenGL and games. The one area that, like when I'm talking to a client or whatever
0:43:13kind of experience it is, I can do anything except for games. Anything 3D. I'm an entirely
0:43:202D person.
0:43:21Yeah, it's one of those things I would sorely love to do something. I don't even care if
0:43:27it's a game. I just want to do some OpenGL stuff. I love it. I play with it. Every time
0:43:31I have free time between books or classes or whatever, I end up spending time doing
0:43:35Open GL stuff, it's really, really cool.
0:43:39Cool.
0:43:40And I guess the last thing that I kind of wanted to talk about is just in terms of like
0:43:46lessons you've learned or perhaps even better coming from your position as an educator,
0:43:51what are kind of some of these common mistakes or problems that you see people doing over
0:43:56and over again that would be good things to make sure you never, ever do?
0:44:01Yeah.
0:44:02Some stuff that I see brand new people to the platform do and and it happens across the board and I don't know that
0:44:11There's a few people here and there who don't fall into the trap, but most people do and that's really
0:44:17Thinking about what you're doing before you go to do it. We're so trained with Google now that or whatever search engines
0:44:25- I want to
0:44:28Change the background color of a text field
0:44:31What's the first thing people do they don't go read the docs or engage their mind they search on Google find something on Stack Overflow
0:44:38And copy and paste it sure I'm as guilty as the next person of doing that
0:44:42But I see people do that and that's their development approach and they never get to the point where they actually understand
0:44:49What the background property is on a view and they don't understand why it might be better to use background property than to use draw rect
0:44:56They never like
0:44:58process that stuff because they're so conditioned to
0:45:02google copy-paste done ship it kind of stuff
0:45:06um... so that's the number one thing i would encourage people to do is please
0:45:11you know i i understand that needs to happen from time to time but especially
0:45:15when you're learning stop that
0:45:18or it's fine if you go google it and look at it on stack overflow but never
0:45:21copy the code from stack overflow
0:45:23the read the docs on background property
0:45:26And then when you get there and you scratch your head and you say, "Huh," there's a little note at the end.
0:45:30The last phrase in there says, "This is more efficient than drawing a background color in DrawRect."
0:45:35What's DrawRect? Go dig into DrawRect.
0:45:38And that sort of like, "Find the path to peel back the onion," is the most important thing to make you a good seasoned iOS developer.
0:45:49Now that we have Arc and storyboards, I think there's fewer problems that are typical, like
0:45:57people always get stuck on.
0:45:59I still have a lot of people who, from Google or I don't know where, but they get this idea
0:46:04that interface builders shouldn't be used and they should write everything in code.
0:46:08And that's another one of my soapbox things where I just stand up and say, "Look, you
0:46:12gotta pull your head out.
0:46:13That's ridiculous.
0:46:14What are you talking about?"
0:46:16Because a lot of people read these blog posts that say, "Oh, Interface Builder is so slow
0:46:20and whatever."
0:46:21Oh, it just makes me crazy.
0:46:25If it's slow today, it's going to be better tomorrow.
0:46:27And if you write all that code, you're going to be saddled with thousands of lines of code
0:46:30that could be easily represented visually.
0:46:34And then other stuff that people consistently mess up.
0:46:41Even with Arc, I see people struggling with understanding the memory management, and I
0:46:47think the biggest reason that people struggle is, again, that engaging their mind to not
0:46:52just read the docs, but to build puzzles to understand what's going on with retain, release,
0:46:59auto-release, whatever, so that they can understand what's really going on there.
0:47:06It's always one of those funny things.
0:47:11I always find this with myself.
0:47:13There is all these shortcuts that you can take in development, whether that's just grabbing
0:47:18code on Stack Overflow or tools or techniques that you'll find on a blog post.
0:47:24I always think about the most is like these shortcuts that it's almost like you have to
0:47:28have a driver's license before you can use those.
0:47:30I like that analogy.
0:47:32Because if you're sitting there, it's sort of like when you're learning to drive, at
0:47:36least with me, when I was learning to drive, it's like two hands on the wheel, whatever
0:47:41it is, it's like at nine and three or two and ten or whatever you're supposed to do.
0:47:45All of these things that are important for helping you really grasp and have a solid
0:47:51command of the skill that you can ease up on once you're proficient in that task and
0:47:58in that skill.
0:48:00I think I find that myself.
0:48:01It's like there's all these things that you get into trouble
0:48:04when you start doing things that you-- anytime
0:48:07you have code in your app that you don't understand.
0:48:10It's probably even the simplest way
0:48:11when I think of that situation you're describing.
0:48:15I've certainly seen in my consulting days
0:48:17a lot where you see this code and it's like, what does this do?
0:48:18It's like, I don't know.
0:48:20I got that from Stack Overflow.
0:48:22It seemed to work when I put it in.
0:48:24And it's this problem of it's like I often--
0:48:28And when I'm finding the little nugget from Stack Overflow
0:48:31or from someone's blog or something,
0:48:33hopefully what it is is I'm seeing something and saying,
0:48:36oh, right, that's how you do it.
0:48:39It's helping draw that connection between two
0:48:42frameworks that I'm not familiar with,
0:48:44or helping me find the bug in my code where it's like,
0:48:47oh, that's right.
0:48:49Any time you use this class, you have to also do this thing.
0:48:53all these little, like, the little, like,
0:48:55the either undocumented or poorly documented
0:48:59little, like, tricks that you have to do to make things work
0:49:01great.
0:49:02And if you start throwing too many of those in that you don't
0:49:05understand, then debugging becomes impossible.
0:49:08Yeah.
0:49:08Yeah.
0:49:09Yeah.
0:49:09Because like, what's the old saying?
0:49:11It's like, don't write code that's-- don't write
0:49:17code that's too smart.
0:49:18Because debugging is harder than writing code.
0:49:21And so if you write code that's at your limit of intellect,
0:49:24you'll never be able to debug it.
0:49:25Because debugging is harder, so by definition,
0:49:28it's impossible to debug code that's
0:49:30at your limit of intellect.
0:49:32So write code that's easy and understandable,
0:49:34and then you can actually debug it and work on it.
0:49:37So I certainly see those types of things.
0:49:39I find a lot of times-- and I've been joking about this recently
0:49:42on Twitter-- is that I look back at everything
0:49:46I wrote six months ago, or even six weeks ago,
0:49:49think, "Who's the idiot who wrote this code?" And on the one hand, I think that's positive
0:49:54because you're always learning new stuff and you're always learning new ways to approach
0:49:56things or think about things or whatever. And where I see people fall down, though,
0:50:03is that they buy into that and they say, "Oh, six weeks ago I was dumb," or "Six months
0:50:09ago," or whatever, but then they never go the next step of, "Oh, I'm going to figure
0:50:13out why that works the way that it does or whatever.
0:50:17So yeah, it's an important thing.
0:50:20I think it's too easily overlooked with the ability to make progress on whatever it is,
0:50:27the feature you're trying to implement or the app you're trying to get shipped or whatever,
0:50:30to just copy and paste from someone else.
0:50:32Oh sure, and all the little lies we tell ourselves, "Oh, I'll fix it as soon as I ship."
0:50:36Right.
0:50:37As soon as that--
0:50:381.1 will have that fixed.
0:50:39Yeah, I'll totally fix that and I won't be cheating on that.
0:50:42That never seems to happen.
0:50:44Yeah, yeah, yeah.
0:50:45Well, I wanted to thank you for taking the time to be here on the show this week.
0:50:52And before you go, I wanted to sort of give you an opportunity to talk about how people
0:50:55can find you, follow you online, those types of things and projects and things you have
0:51:00upcoming that you should know about.
0:51:02Sure, thanks.
0:51:03Yeah, that's awesome.
0:51:04So the Pragmatic Programmer's book on the iOS SDK has been fully updated to iOS 6.
0:51:11We did a beta cut right before we started putting iOS 6 content in there.
0:51:18The book that's currently shipping covers iOS 5 where it's updated for iOS 6 and then
0:51:23as soon as it goes public, we'll ship a beta version that goes public and then it'll go
0:51:27off to the printers and it'll be a couple weeks after that before the paper hits, which
0:51:32I'm really looking forward to.
0:51:34It was a fun book to write and it was really cool to sort of go in and rethink the way
0:51:38we wrote the book the first time.
0:51:40So it's a very different, completely rewritten book, so that was a lot of fun.
0:51:46I'm also working on a book that I'm self-publishing through the iBookstore on C, the language,
0:51:54and all the stuff that, as a proficient Objective-C programmer, that you've looked at and thought,
0:51:59"What is that pointer thing?
0:52:01I'll just pass nil for the error because I don't really understand ampersand error."
0:52:05Stuff like that to sort of help you understand, "What does that ampersand thing really mean?
0:52:08What are pointers and stuff?"
0:52:10kind of some people look at me like I'm kind of nuts but I'm basically going to take you
0:52:14from the type system of C and understanding the basic types and then how they sort of
0:52:20evolved into objects how we ended up with with Objective-C objects by talking about
0:52:25structs and then we're going to implement a really simple version of the Objective-C
0:52:29runtime so you can send messages to your to the struct that you built which is kind of
0:52:34on the one hand sort of nutty and very nerdy and behind the scenes kind of you'll only
0:52:38enjoy this book, I think, if you like to understand how things really work. But on the flip side,
0:52:44I think it's also going to help a lot of people who are proficient at Objective-C but want
0:52:48to take their development to that next level to understand stuff more deeply or whatever.
0:52:54So that will be--it'll definitely be done by the end of the year. I'm working on a lot
0:53:01of really fun HTML5 CSS interactives to sort of show off the code and help people understand
0:53:06how stuff works. So that will be by the end of the year roughly. And then I'm also, speaking
0:53:12of teaching kids, I'm working on a series of books to help kids understand how to program
0:53:17games on the iPhone. And so that'll be like very basic programming all the way up to,
0:53:22you know, doing game type stuff. So I eventually, my goal is to make it all the way to OpenGL.
0:53:30So you have basic programming all the way to loading an OBJ file or a COLLADA file and
0:53:35displaying it on screen and having your bad guys shoot guns at each other. But that's
0:53:40probably a two-year effort to get all that stuff written. So, you know, it's a... and
0:53:44it's also a sort of a background thing.
0:53:46Great.
0:53:47So, yeah. So that's the two big things that I'm doing that are sort of personal and then
0:53:50still doing a little bit of consulting here and there and doing a lot of teaching.
0:53:54If people want to find you online, where to go.
0:53:56Oh, yeah. So I'm @bdudney on Twitter. So you can follow me there. I have a blog at bill.dudney.net,
0:54:02I've been a slacker and haven't been updating nearly as much as I would like to.
0:54:06But those are the two big places where I do most of my public stuff.
0:54:10Great.
0:54:11Again, I just wanted to thank you for taking the time and I really appreciate you talking.
0:54:17Sure.
0:54:18It was a blast.
0:54:19It was a lot of fun.