Transcripts

Coding 101 10 (Transcript)

Shannon Morse: Coming up on today’s episode of Coding 101, Randal Schwartz and his Perls of wisdom. Haha, get it?

Netcasts you love, from people you trust. This is TWiT!

Bandwidth for Coding 101 is provided by Cachefly. At C-A-C-H-E-F-L-Y dot com.

Father Robert Ballecer: Welcome to Coding 101. It’s the show where we show you the secrets of the code monkey. I'm father Robert Ballecer.

Shannon: And I'm Shannon Morse and we have tons of awesomeness for you today. And I am super excited about our guest interview.

Fr. Robert: Yeah, absolutely.

Shannon: But first, why are we doing an interview?

Fr. Robert: Well remember, when we started Coding 101 we thought that we needed something between the modules right?

Shannon: Yes.

Fr. Robert: We didn’t want to just go from teaching x language to teaching y language. We wanted to give people a break to sort of reset and maybe clear out the taste of the last language. And more importantly, we wanted to give you something to look at as to why you're actually learning how to program. So we’re going to bring in visionaries, we’re going to bring in CEOs, we’re going to bring in experienced programmers who show you what they do with their coding knowledge. And who do we have this week, Shannon?

Shannon: This week, I'm super excited about this because I'm kind of a fan. This is Randal Schwartz with his Perls of knowledge. I just like saying that because I think it’s hilarious.

Fr. Robert: It is kind of cool.

Shannon: Hi Randal, how are you?

Randal Schwartz: Hi, hey.

Fr. Robert: Randal Schwartz the host of Floss Wednesday, the earliest show on the Twit TV network, thank you so very much for coming.

Randal: Oh yeah, and actually I got to sleep in a little bit today too which is really nice so [laughs]—

Shannon: [laughs] nice.

Randal: …I have to wake up in time for my other show. Yeah, no, great, thanks for having me on.

Fr. Robert: We don’t do sleep. Yeah we don’t do sleep a lot—

Shannon: Yeah, we never sleep here.

Fr. Robert: No, no, no but the reason why we asked you to come in this because you are one of the acknowledged experts in Perl, right? I mean, you’ve written a series of books about Perl, you teach Perl, you talk about Perl and more importantly, you program in Perl.

Randal: Well I program in a lot of languages, but Perl’s made me the most money over the last 25 years, exactly. I wrote the top 5 selling best books and 255 magazine articles. And yes, I ran a training company that was extremely busy during the late 90s as the dot com boom rolled out, it’s not so much – much more in moth balls now because there aren’t 20 people wanting to learn something about Perl and sitting in one place for a week anymore so I don’t do much of that, but yeah. Perl’s only like one of the 70 languages I list on my resumes so I've got plenty else to talk about besides Perl, too.

Fr. Robert: Well yeah, let’s back off because it’s easy to talk about a single language especially if it’s one that’s close to your heart. But we want to go beyond that. We want to talk about what actually brought you into programming in the first place because there are a lot of people who are trying to get into this game who are seeing these multi-billion dollar deals for apps and saying “Look, I've got a good idea, how do I program it.” What was the catalyst for bringing you into the world of the programmer?

Randal: Well I've got to say it’s my father and I've said this before in interviews. I really appreciate - he had a really strong work ethic, he said you know “Son, you're going to have to grow up someday and get a job” and so I figured “Okay, I’ll find something I’m good at”. And he was also a tinkerer, so we had a lab that we would share time in where we would assemble stuff that was on the cover of Popular Electronics magazine back in the early 70s and then stuff. And it was great being with him, I found though that I had a propensity both for the electronics and for math. I kind of liked math in school, and so one day dad brought home a bunch of books on computer programming and I started reading one of these books and it was on a sort of digital equipment corporation called Focal. And so I read this whole book all the way through and I went – and then I started writing stuff that was similar to what I would see in the book. And I ran down to the lab where dad was and I hold up the book and I held up this piece of paper and I said “This is what I want to do, I want to express problems as series of steps”, and he says “ Okay”. And so a few weeks later, I come home from school, I was just – I think I was like ten at the time. Yeah around ten. I come home from school and there was this book on time shared basics sitting on the table and dad off on a service call so I didn’t get to see him right then but mom said “Go read this book and dad says that’s for you to look at”. And so I read all the way through book and I start writing basic programs on paper again and still having no access to real computers . I mean you got to remember this is 1971 okay so really early days, right.

Shannon: Wow.

Randal: And so – ’71, ’72 somewhere in there. And so dad comes home and says “Do you think you understand that?” and I said “Yeah, I can write programs in that I'm pretty sure” and he says “Well, this Saturday, I've got surprise for you”. It turns out he’d gone to the high school nearby where I lived and arranged for the computer teacher to spend his Saturdays with me.

Shannon: No way.

Randal: So the first day I walk in there, you know I'm like 10, I maybe mixing up the years now but somewhere really early on. And the first day the guy introduces himself and he sees that I'm holding the timeshare basic book and I said -  and he was sitting in front of an ASR 33 Teletype, uppercase only 110 baud, you know this is classic old stuff right? And let’s start with page one I go “Well, can I just type in this program and see if it works?”

[laughter]

Randal: And I had this whole hundred line program that was type 1 to add, 2 to subtract, 3 to multiply, 4 to divide—

Shannon: Wow.

Randal: …And then it would ask for the two numbers then do the operation then go back to the beginning loop. And I type it all in and my very first program had no bugs. It worked perfectly and it blew the socks off the poor computer teacher. And, but that fall, for like probably ten weeks in a row, I was down there playing with this ASR 33 Teletype, typing basic programs that I was inventing. And from there I actually ended up at that school on the – two years later and I was like mornings before school, I was in that little tiny ASR 33 Teletype room. And then for lunch every day I was there for two hours, afterschool every day I was there. I’d found books on the program language, I brought in program to type in and I wrote a lot of my own stuff and I looked at everybody else’s code, shared stuff around like that. And by the time I got into high school, I was actually teaching the programming classes.  I knew more than that computer teacher who’s different school that I got moved to so. And also during my high school phase, I ended up working and in 1977 I wrote my first program for hire and I got paid thirty bucks an hour at age fifteen.

Shannon: Wow.

Randal: So it was like I knew this where I wanted to go. I didn’t go to college – immediately from there into the working world and spent seven years at three different companies and then I've owned my own company for I think I think it’s 27 years now, 28 years, something like that so yeah. So that’s the early phase and hopefully that answered most of your question.

Fr. Robert: Randal, that tells us how you got into it and I think Web4242 in the chat room right now is saying  Look, well Randal has the tinker gene”. I think that’s true—

Shannon: He does.

Fr. Robert: That’s how our generation kind of learned programming because no one else was doing it. There were no courses in how to program when I was growing up. It was just, if you wanted to play with computers, you got it, you found some way to learn how to do it and you try to make it do something.

Shannon: There were courses for me but it wasn’t until high school that I was able to actually do things like that. So for me it was a lot like you. My dad was really supportive of my interest in computers so he brought home a computer and he brought home some books and he just said “Here, go at it, if you like this stuff  just keep at it and one day you’ll make a career out of it.” That’s really cool, I like hearing that parents are supportive of what you do.

Fr. Robert: Yeah.

Randal: Absolutely and I've got to say there are people who try to get into programming thinking that, well if they don’t have this tinkerer gene, that they could sort of learn it. But it’s sort of like forcing yourself to paint by numbers and still calling yourself and artist. And I see that all the time, you know, when I'm hiring people. A lot of times as a consultant I'm brought in to sort of interview people that are going to be filling in the jobs that are around me so I get a lot of being on that side of the desk for hiring people. And I see people who I really wish they weren’t in programming you know. And I don’t mean that with any disrespect, there's probably something that they could do much better. Especially we saw this in the late 90s with the original dotcom gold rush. Is that there were a lot of people getting in to, particularly Perl, that didn’t belong there and so a lot of bad Perl code was written, a lot of bad PHP code still continues to be written. And it’s by people who aren’t quite there. You know if you're not naturally driven to be a programmer, I would advise you to stay away. And I don’t mean that because I don’t want competition, I'm just saying it’s better for all of us.

Shannon: Well I have a question for you.  You mentioned that your very first program you ever wrote, it worked flawlessly, it was perfect.

Randal: Yes.

Shannon: How did it make you feel when you made your first error because I know for me it was extremely aggravating and it took me a really long time to fix?

Randal: Uh I don’t put bugs in my programs.

[laughter]

Randal: No, actually it’s weird, I program very incrementally so I’ll take a – even a large application, if I'm trying to change into something new. I’ll only add two lines of code that I understand exactly what’s going to happen as interfaced with that and if I'm surprised by that I go “Well why was I surprised”. So then I put in some more debugging  prints. But I debug by adding print. That’s really the only way I'm ever going to debug. I don’t like real debuggers, I don’t like IDEs, I don’t like any of that stuff. I'm an Emacs guy, you know I’ll code and Emacs all day. But I’m very careful to only add a little teeny bit of feature and functionality and then I run it again, and one more functionality and then I run it again. Perl of course is really good at that. My latest new language that I'm really getting a kick out of is Dart, and that also does the same sort of thing. You add a few lines and you run. Now it has an IDE and it can tell me how to autocomplete, you know what method calls I can make on these things but you know I find it doesn’t help me all that much. I kind of already know what the object is going to be in that variable and I already know kind of the method call I want to make on it. So having an IDE that manages that doesn’t gain a lot for me.

Fr. Robert: You know Randal when I was still working in the industry I used to hear an analogy a lot, it was sort of like a kitchen. A good programming shop was run like a kitchen where you may have one or two or maybe even three in a small shop individuals who actually know how to program. They have the passion for it, they were bitten by the bug, they got that tinkerer gene. They're the ones who come up with the roadmap. The know how x suite, x piece of software, x piece of code should work. And then it was okay as long as you had those chefs, those five star chefs in your shop, in your kitchen. To have programmers who maybe have the technical aptitude but not the passion, you know. They're not the ones who would naturally figure out fifteen different ways to do the same thing, they just want to make it work. And if you have a shop like that, then it’s okay to have people who may be good at coding but don’t have, as you said, that natural knack for it. Would you agree or disagree? Would you say “No everyone who’s programming needs to have that natural innate way to program”.

Randal:  No, I agree with you there right. I think in a large shop it’s fine to have you know two or three leaders. People who have been programming since ten or even earlier now and I didn’t have the opportunity to go even earlier than that. But I think as long as you have a few people like that there, the risk though is that if you two or three people like that and one of them thinks that they're brilliant and likes to keep demonstrating that then you actually have a negative space than of a positive space. But if you have two or three people who are willing to share, wiling to even have their own code reviewed, which says a lot about a person, you know if I'm willing to have every line of code that I commit to our repository reviewed by other people, which I still am because I miss things occasionally you know. Particularly like – I'm typically hired for a period of six to twelve months at a company to come in and make everything go faster, better or make everything more reasonable, whatever. And I don’t necessarily know all the coding conventions they might have like the reason they have this set of serpentines is because they want to talk to this device in a certain way and if I publish code, and then I made a change and then I'm not up on all the local nuances the folklore would like to call it within the company then I need to have that code reviewed. So the first thing I do when I go in a new company is establish a protocol, which is like “You look at my code, I’m going to look at your code. You know that’s just how it’s going to be before we start shipping it live.”

Fr. Robert:  Let me ask you a little bit about that because as a consultant, as someone who actually comes in and puts out fires and makes things work when things were previously broken, I know sometimes it can be difficult to come into a team that’s already been established. You know, you’ve got the cook, you’ve got the hierarchy of how it’s supposed to go, you come in because typically there's a deadline that needs to be met or because things aren’t going as they should go. And when you sit down and you establish that protocol, you’ve got to get a lot of blowback right? I mean these are people who aren’t used to having someone look over their code. These are people who aren’t used to having peer review of what they’ve written. What do you need to be able to do that because at the same time that you need to know all your stuff, you also have to have the confidence to walk into a situation like that and say look “You can look at everything I write, I just need to be able to look at everything you write.

Randal: Well, I do start by saying, especially like during the interview process although the interviews for me typically end up being “Let’s go meet at a bar and have a couple of drinks together and then we’ll hire you tomorrow.” You know it’s typically how it is with me, which is good, I like those type of interviews. But typically I’ll say things like “You know, you’re not going to hire me because of the successes I've had, you're going to hire me because I've seen failure and I've got the scars to show for it up and down my arm.” And so when I'm actually in with the team, I'm actually in you know talking to the engineers that are going to be my peers for some period of time, I can typically bring up “You know, what worked in a different company that I was at was not to do it this way but to do it that way because that led down to the direction of chaos and failure. And you may not see that now in not having code reviews as being a problem because you're all good great programmers, which you are obviously you wouldn’t be working here, but I’ll tell you going down that path is going to lead to some destruction.” So  I get to be the forecaster of evil.

[laughter]

Randal: And they’ll listen to that, they're not going to listen to it as the best practice is code review, they're going to listen to it as, you know if we don’t do code review and somebody misses something, we could bring down the whole production system. And that is a better sales, it seems to work a lot easier.

Shannon: So I know that you are pretty experienced in several different languages but what was it that really turned you on to Perl? Why was it Perl as opposed to any other language out there?

Randal: Well I got involved in Perl very early on. I was coding all my stuff in, believe it or not, EMACS lisp and SED & AWK. I've been a UNIX guy since 1977 as well so one of the early UNIX adopters. And so were – I was working for Techtronics at the time I think, which was the largest employer in Oregon at least it used to be but now it’s like a tiny employer. But I was coding stuff and I was – and I’d seen – I’d been using patch and rn, which are two of Larry Walls tools very frequently. And I love the rn man page it’s a wonder to read if you haven’t actually seen it. You can probably Google for an rn man page and just read it; it’s fun. And this Perl 1.0 came along and back in the early days Usenet had come along in 45 parts that you had to download each one and make sure it got to your Usenet thing and then you assemble parts 1 through 45 by running one of them and it would find the rest of them and it then it’ll pull itself together. And I kind of liked this Perl thing, it sort reminded me of a super Awker, a super Sed and I’d been using those quite a bit. You know I set it aside after a while and said “Okay, this is kind of cool” I still wrote some things in Emacs lisp and some more Sed scripts and some more Awk scripts. But Perls came along and it was about the man page for Perl 1 I think it was about six pages, the man page for Perl 2 was like fifteen pages. So it was getting longer and I went “Oh it’s got more features and this is interesting”. And so I pulled it down and I started writing everything that I’d been doing in other languages. I started writing it all on Perl, and it just felt right. I had the right combination of regular expressions as a first order citizen and all the things that really fit the problems that I was solving. And so when Larry announced that he was going to do Perls 3, and it was actually going to be big enough to actually rewrite rn in Perl. It was going to have that much features so it could scale well, it would have the ability to talk to sockets, we’d have all sorts of binary data manipulation stuff. I went “This is cool”, so he was looking for volunteers at that point and I was a remote volunteer for him to join a testing group so that Perl 3 alpha version would come to me and I would make sure it ran in the systems that I had access to and I would give feedback about the features and things like that. And it really suited me well so I actually started invading comp unix questions and comp unix shell, which were two usenet groups back in the day. They're still there, I still hit them every once in a while but there's a lot less traffic in them of course now and everybody’s gone to the web. But I started invading those and I started answering Perl questions – or answering those questions that were posted there with Perl answers. And I did it enough that I actually came in one day and somebody posted a question at the bottom they said “No Perl please”.

[laughter]

Randal: And at that point I knew I succeeded. So I answered that question, first in the shell, it was like seven lines and then in one line in Perl.

Shannon: Wow.

Randal: And I said – so I said “This is why I'm coding in Perl because there’s less typing for me you know?” I type pretty fast but I’d rather type less. And Perl did that for me. And so when Perl 3 for real came out, somebody suggested to Larry that he’d need more documentation. I mean the man page had gone from you know fifteen pages to over sixty pages. They said you need more documentation and I knew what they meant. I knew that he meant that they need more tutorial information because it was still referencing sort of man page. And I volunteered, raised my electronic hand again and I said “You know I'd been a tech writer for many of the last dozen years or so, and that’s actually how I got started. I shifted from programming to writing but – and I had a whole shelf of books at that point for other companies written including Techtronics and stuff. And I said “I could help Larry out with something for online.” and I just made it for something online but somebody at O’Reilly and Associates that publishes all the animal books wrote me privately and said “Well if you're going to write something we might as well publish it.” And I was thrilled, I was dancing up and down and went “Oh my god, a book with my name on the cover, this is cool” and that cemented it with me and Perl. I mean I became now thrust in the center of the Perl community and not just one of the guys who just happens to be using it. And you know, that lead to a training book deal and that led to me running the largest Perl training company in the world for a while. Perl has been very, very good to me.

Shannon: It really sounds like it was a true calling for you—

Randal: It seemed to be.

Shannon: And you have books about it too.

Randal: Yeah, the book again was a – I didn’t go around pitching a story. O’Reilly contacted me and said we should write up what you were going to write about online. And I said “Okay that sounds like fun, I've done this before.” Like I said I had a shelf full of books already, they were just ghost written for technology companies and so it was really nice to shift into being something – it was really legitimately mine and Larry Walls. So, we’re showing a picture of Learning Perl, which was my second book but that’s okay. The first book was Programming Perl but yeah, that Learning Perl still outsells Programming Perls even today. So I'm still making a few bucks, it’s not as lucrative as you think it might be. At one point, I was actually making the car payment with my royalties so it wasn’t like huge. It wasn’t – you know what car I drive.

[laughter]

Shannon: It’s totally worth it though.

Randal: Yeah.

Fr. Robert: It made the payments on that ’72 Pinto, it was fantastic.

Shannon: That’s really cool. I would love to be able to write books about programming one day. I'm still pretty far away from that part though.

Fr. Robert: Now Randal, let me ask you this because we got this a lot, especially at the start of Coding 101 and I'm sure you run into this all the time. Coding, programming and programming languages can be a little like a religion for a lot of geeks, you know. They have their favorite, they have the one they believe is always the best solution for everything. And sometimes I hear over and over from people that everything is always better in a particular language. And we got this when we started the show, which is people were saying “Well why are you programming in C#?” and it didn’t matter how many times we told people “Look, we’re going to be moving through many different languages. The modules are going to switch. What we’re really trying to show you is the thought behind the programming. We don’t care what code we’re using at the moment. What we want to teach you are the skills you need to break down a real world problem into something a computer can actually understand.” Now do you see that a lot? And again, I’d like to the situation that you walk into an environment where there might be an established programming regime and saying “Look, I've got a better programming language for you to do this in. I know you're really stuck on this one but it’s so much easier for you to write it in Perl. Or it’s so much easier for you to write it in x language x.” Or when you come in to a shop do you just adopt whatever language they use?

Randal: Well, you know I really MySQL and my current client is using that rather than Postscripts like a sane person would but you know I'm actually going to be able to list that on my resume after this gig. I'm going to be able to list optimize low MySQL queries and I didn’t know that before. It’s actually something that people internally have actually talked about, shifting to Postscripts but the problem is you’ve got a site that’s up 24/7 and how do you migrate all your data and get everything to happen all at once so they're probably not going to do it. Now you say would I introduce Perl to a group? Well it turns out my clients are sort of self-selecting and they're hiring me because I'm the Perl expert so luckily everybody I've been around is using Perl. Now there’s different frameworks below or within Perl, and I've had problems with the last few clients selecting what I consider to be the wrong object relational mapper, that a popular but wrong I think in a lot of ways. And what’s funny is as I discuss the issues with them they go “Yeah we've ran into those issues” and I go “Yeah this is why I don’t recommend this for green starts anymore. These issues you want to be using this ORM over here and it’s a much better one.” So I'm typically brought in far too far down the line to make those kinds of sweeping recommendations so yeah.

Fr. Robert: Right, yeah I was just about to ask you that, how many times do you actually win that argument where they say “Oh, that is a better way to do it” and then they switch. It sounds to me like—

Randal: They don’t switch, they're stuck. That’s part of the problem is like once you're entrenched you’ve got thousands of lines of code that look a particular way, all you can do is put nice wrappers around everything and that sort of solves a few other problems but not the fundamental problems. Actually, if anything what I do is I frustrate people because I tell them “You know there’s a better way, go look at this” and they go “Oooh, we should’ve use that”.

Fr. Robert: That can’t be a good feeling if you're running a startup and the contractor that you’ve hired to come in and fix things tells you “Well yeah you could make it work with the way that you're working right now but it’ll be faster—

Shannon: This would be better.

Fr. Robert: ...and better and more efficient to do it this way but you're too far along in the process to do it.

Randal: Well let’s just say that I have to have in my contract that I will not take any piece of code, no matter how anonymized and post it to the and post it to thdailywtf.com.

Shannon: Oh that’s horrible.

[laughter]

Randal: That’s almost everything I see every day if I could go there.

Shannon: Okay so he mentioned this to me earlier and I had to ask you because it was kind of weird. What is this thing called the Schwartzian Transform? What is this?

Randal: I did not name that. I am not that vain. What happened is that, you know when Perl 5 came out one of the biggest features it had was the ability to have complex data structures that were pointers of lisps that contain pointers to hashes that contain pointers to lisps and stuff. So you get this really complex data structure. Now this made me really happy because as an EMACS lisp guy I had been dealing with these complex sort of structures back in the early days and so now it’s back again. So everything I knew from lisp I can apply it on Perl and I was on a break during one of my teaching gigs. My teachings typically last 3 to 5 days and I would have like – you know like I would do one hour of lab one hour of lecture one hour of lab. When I was doing the labs I would go and check out Usenet. And somebody asked a question in the Perl group about why this was working so slowly. Why was this sort working so slowly and I said “Oh, that’s because every time Perl has to compare two other items, you're doing this complex regular expression match against one of the items during the same one against the other one and then comparing the pieces of those. The problem is of course you don’t just compare one item once, you compare it against some other things too to kind of figure out where it’s going to go in the ultimate sort orders.

Shannon: Ah.

Randal: So you're doing the same calculation that’s expensive over and over again. You really need to compute that once and then sort the original item based on this derived data from it. And I quickly code it up in a few lines of Perl. Let’s say here’s the original data, here it is with its derived key, here’s the sorting based on the key but it also moves the original date around as well and then here’s the things dripping out the sorted key and then back to the original data. So it’s like five lines of Perl. And I didn’t have time to explain it much but I went away and the next break I came back, back online I saw that Tom Christian sent, also a fellow trainer and fellow book author, had written up this very complex analysis of what I had done. And he also pointed out that it had a bug. I actually took off the new lines and when I placed them I forgot to put it back on in the end but that was okay, it still worked. Just didn’t work the way I wanted to. So he wrote this in like ten or fifteen different drive steps very carefully from the original problem all the through doing explicitly with arrays and doing it more and more implicitly until he got down to the last step. And last step’s now let’s circle back to that Schwartzian transform.

[laughter]

Randal: Meaning it in some sort of degrading way. I actually now know this because, I’ll tell you in a minute how I know, and so I was amused by the whole posting. It was a great posting. And it explained a lot of things, it actually became part of his sort of F.A.Q.s that he would distribute with his training stuff. And then about a week later somebody had a sorting problem and somebody else said and answering at said “Oh you need a Schwartzian transform here”. And then somebody else had a problem and somebody else answered it “Oh you need a Schwartzian transform there”. So the meme started sticking, and I had nothing to do with that, I had nothing to do with that. And all of a sudden you can tell Tom must’ve had fumes coming out of his ears because he said “Oh I should never have given that clever of a name, let’s just call it the black prince form”—

Fr. Robert: Too late, too late.

Randal: Too late, right black meme is a play on my last name, Schwartz in German so yeah, so that was too late. Exactly, too late.

Fr. Robert: Sorry, it’s going to stick. You know I've often found that that’s really the difference between a programmer and just a coder you know. A coder will look at a piece of code and see does it work, does it output what I want, yes I'm done. Whereas a programmer’s always looking for the short cut, the programmer’s always looking for a better way to represent the problem. And it sounds to me that that’s exactly what you did. You looked at something, you said “Wait a minute, this is not the right mathematical way to do it. I would never do this if I was actually calculating this in my head. The way I would do it is this and if I could think it in my head, there must be a way to express that in code.” How often when you do these contracting jobs do you walk in thinking “Well I'm going to find all the inefficient ways that they have written x function and I'm going to figure out a faster way to do it”.

Randal: Well that’s typically what I'm getting hired for, for the last two – three clients in particular. When I would check in on forest grove it would say “Making things go faster”. I'm really, really good at having a good sense of – initially of just like – okay this is inefficient here, this is efficient here. In particular Perl code of course because that’s what I'm most familiar with but even things like, you know SQL queries, things like that. I have a good sense that somebody doing something that’s a little crazy. And then I have tools I can bring in after that. But I like to say that within the first week of my most recent client, I made a three line code change and improved the speed of their website by 30 percent. And it’s for knowing which three lines to change that they hired me for. But it’s the same sort of problems typically, it’s like computing something too often, not caching the result of something, computing something needlessly, using inefficient algorithms. But it’s not always the algorithms it’s more like just not stepping back a couple of steps and going “How am I really using this data and is there a way that I can derive some of this data in a different way. I mean, what wiggles what in there you know. If I change this data, which changes over here and is there some way I can remember that so I only have to do it once.”

Fr. Robert: Right, now Randal we want to talk a little bit about something that I actually asked you beforehand because I want to make sure you were comfortable with this.

Randal: Oh yeah.

Fr. Robert: You are, I think the only host on the Twit TV network and definitely the only guest we’ve had on Coding 101 who at some point had a felony on his record.

Randal: Um-hmm.

Shannon: Oooh.

Fr. Robert: Yeah, yeah now this stemmed from a 19 – was it 1995 case brought against you by the state of Oregon. Not a financial case by the way, it was actually a criminal case—

Randal: Yes.

Fr. Robert: …stemming from your time as assistant administrator from Intel.

Randal: Yes.

Fr. Robert: Doing some very standard system administrator stuff—

Randal: Um-hmm.

Fr. Robert: …but – and I’d like to think that this is one of the very first cases in which the law didn’t quite understand what people in computer science did.

Randal: And still doesn’t.

Shannon: So true.

Fr. Robert: This is one of the very, very first great examples of “Wait, he got in to trouble for what?”

Shannon: Um-hmm.

Randal: Yeah, yeah exactly.

Fr. Robert: Can you explain how this happened, what happened and then talk a little bit about how your record got expunged.

Randal: Yeah, so 1990 through 1995 – 1993 actually, from 1987 to 1993, there we go. I was a contractor at Intel in seven different slots. One of the things about being a contractor is you're always looking for, you know doing the items one through ten that the boss wants but also looking for item eleven that shows that you're still valuable in some way because you're bringing something to the table, you're not just being the code monkey that’s doing the that are on the table. And I would do these sort of odd projects from time to time right. I would see something that needs to be done and just go ahead and do it and I got really practiced at that. Well the particular thing that we have in question is I was running crack, which is a standard tool for evaluating the strength of passwords in the Unix system. I was running crack against the password file of the current group that I was in. Well the only like five passwords and in didn’t show up anything. And crack – crack I think 3.0 had just come out so I was actually just testing the new version of crack. Again I done all the stuff for the day and I thought, well I’ll try this one out. Well, I still had access to the previous group, where I was one of the key system administrators and I’d move on to the new group. But they still gave me access previously – you know the previous system because I was still maintaining some code for them.  And I ran crack against this much larger password file and something like, I forgot the number now, something like 67 of the passwords were guesseable. Now this shocked me to no end because when I was in that group, I was running crack against the local password file and I made sure, anybody got guessed I would – and this was complex things like you know like the word hello the ee changes to a three, it would find stuff like that. And the o changed to a zero. So it would find these sort of normal, you know combination of things. People’s first names, pet names, thing like that. It would look for all that stuff.  And it was really good at doing that. I actually met the author of crack a few years ago, cool guy. So I couldn’t imagine that 67 passwords were gueassable. Now what I didn’t realize at the time was one of the passwords was the vice president’s and his password was president with the s changed to a dollar sign. And I suspect that’s why I got prosecuted because I actually embarrassed somebody. Now I was going to go over the group and say you know to the people taking over my job essentially, the other group but I then realized “Wait a second, I'm going over to tell them they're not doing their job, how do I do that?” I spent a few weeks kicking back, trying to figure out how to do this best. In the meanwhile, somebody at my new group noticed I was running crack and running it against the password file of the old group and didn’t understand my motivation. I was simply just trying to do one of these things again where it’s like you know the eleventh item on the one to ten list. And never intending any harm to anybody, not trying to do anything at all. But you know the problem is they showed up at my house, they took my computer s away, they only returned them like four months later. Imagine having all your data in your computers and then not having them for four months. It was just really crazy. And they didn’t arrest me until they put out a warrant for my arrest four months later which shows you that they had to figure out “Wait, we've accused him of being bad, he’s only done exactly what he told us he was doing and with the intentions that probably that he told us he was doing it. So now what do we do?” Well it turns out Oregon’s computer crime law is overbroad and vague. Basically, if I pick up your cell phone and I change the background color on the screen, that’s a class C felony, hundred thousand dollars and five years in jail.

Shannon: Wow.

Randal: So the law is way out of proportion in this thing so I got basically nailed with a law that makes criminals out of anybody they want to prosecute. And I got three felonies eventually in ’95, convicted on me and it was devastating, I got to tell you I was suicidal for two times because here’s the thing, since ten I wanted to be a programmer and I said “Who’s going to hire me now?” But luckily I had a lot of friends come forward and they brought me into their companies and stuff so it was quite a transition period. And in about ten years later you're eligible for expungement in Oregon so I applied for that and so technically I can now tell you I have never been convicted of a crime in my life.

Shannon: [laughs]

Randal: But it doesn’t matter as far as the feds go apparently so I can’t get like a global entry. I have troubles going to Australia and Canada still. I can go anywhere else in the world, I just can’t go to Canada and Australia. It’s just very, very weird.

Shannon: Of all places.

Randal: Yeah, of all places.

Fr. Robert: Now, you know Randall, this is interesting. You bring up a very great point and actually I think there's a lot of programmer out there. And especially a lot of programmers who might know Snubs because Snubs has a couple of the program of show and one of them specifically talks about security.

Shannon: We’ve dealt with banks telling us that we can’t have a checking account with them because the name of our show. It’s called Hack 5 and people have told us that we can’t get jobs because of the name of our show. My friend had a problem getting a loan for his house because of it and it’s just ridiculous how feds and how a lot of government companies look down at us just based on the fact that we know how to do these type of things. It’s just kind of irritating.

Fr. Robert: And the thing that hits me the most is something that Randal alluded to which is these overbroad laws which, that’s one thing, most laws are overbroad they try to catch all the outliers. But the very selective way that they are applied – and it always seems as if it’s not every hacker who going to prosecuted, it’s going to be the hacker who insulted or embarrassed the wrong person, that the book is going to get thrown at.

Randal: Exactly.

Fr. Robert: And I know you touched on this on Floss, which is why it’s a great program to watch even though it’s early in the morning on Wednesdays at 8:00 on live.twit.tv, it’s something that you should watch because they talk about cases like this. I think what I’d like to hear from you is looking back on your experience now and knowing that there’s a new generation of programmers and there’s a new generation of people who are going to be curious about the networks that they're connected to, there's this little air of insecurity about “Well, this seems really easy but someone’s telling me that this is a crime.”

Shannon: Um-hmm.

Randal: Um-hmm.

Fr. Robert: Like for example, I'm on a network and a system administrator knows absolutely nothing about security and for some reason I can access all the files of all the executives because it’s a standard Samba share with no protection. But for some reason, if they accidentally click in to one of those folders they're now guilty of a felony and that could held against them. I actually hear these stories every once in a while. I get people who have freaked out and are writing me saying—

Shannon: Me too.

Fr. Robert: … I accidentally did this and I'm afraid that someone’s going to check the logs and I'm going to get fired and persecuted. But there doesn’t seem to be that much momentum. There is no political will to fix the laws that haven’t caught up with technology.

Shannon: Yeah, and it always seems like if you're the person that’s trying to help the company, you're trying to bring this problem to them and say “Hey, I found this vulnerability, we need to make sure that it gets fixed.” If you're the person who found that vulnerability, they're going to go after you.

Randall: Yeah, there's no safe harbor for whistle-blowers in this arena and that’s where the problem is. And also remember that the laws are written and paid for by the people who pay for our government, which is big companies that have good lobbyists. So of course the laws are going to be biased towards now the individual but towards protecting the corporation, the corporate status quo. I love to keep saying persecuted instead of prosecuted. I don’t think we mean too much persecution these days but is sort of may feel like it actually but no.

Fr. Robert: Well, I come from a background where we persecute everyone.

Randal: Exactly.

Fr. Robert: That’s my preferred word. But it really is persecution right? I mean it’s persecution of people who have an understanding of system that others would prefer they not have. What boggles my mind sometimes is when I look at these laws and when I look at how they're applied, I almost want to ask the question “Are you trying to unlearn stuff?” Because that’s not possible, this knowledge is out. People will know how to do this. So your law by its very nature is moot. You'll never be able to enforce this the way that you want. All it looks like is a tool for revenge when someone points out you doing something stupid.

Randall: Yeah, well I think these laws – the federal law actually was better than the state law in this case which made it interesting and it’s why the feds didn’t prosecute me. Because the feds actually had a threshold a floor threshold of how like must be more than fifty thousand dollars in the damage or something like that. The state law was absolutely no floor for actual costs incurred or you know damage done or anything like that. Nothing like that, I mean just – when we got one of the pretrial hearings we got a judge to admit that it’s just changing the background color on the screen without authorization is in fact within the purview of this law. And it’s insane, that’s part of the case law now in for Oregon which is that this really, really stupid that they rope me in with is now part of the case law in Oregon. And most western states have almost exactly the same wording because it turns out the phone company of the west coast got this billed passed in something like eleven different states. And the pacific bell, they're all broken up into other things now but when we researched the law in Oregon it turns out it was fifteen minutes of discussion in committee and no discussion on the main floor of the Oregon legislature for this law. And it was attached to a cable theft bills so people thought they were voting on this whole thing of protecting you know our fundamental infrastructure. By the way these laws came out right around – right after the time of the movie war games.

Shannon: Oh no.

Randal: And I said if they ever make a movie about my life I got to have Matthew Broderick play me because I think that would be the ultimate revenge for all this. I was convicted because the law that his movie inspired and therefore he should play me in the movie.

Fr. Robert: Shall we run a crack.

Shannon: Do you want to play a game.

Fr. Robert: Actually, there is one little note of hope. I remember there was just a case, a federal case I believe two months ago. Maybe you’ve covered this on Floss, about a criminal complaint being dismissed against the system administrator because even though they were able to prove that he accessed folders that he wasn’t supposed to have access to, they weren’t able to prove any real monetary damage. Is that a trend? Are we heading in that direction where the courts are catching up and they're realizing it’s not enough that just to prove that someone poking around where they weren’t supposed to be, you have to be able to prove that there was malicious intent.

Randal: Yeah but you know it’s hard to prove either positive or negative about intent unless you look at the circumstances. I know I've been really versed in this with my case. So you really need to have some objective tests as well. That’s why I think the federal law’s a lot better because it has a damage floor. And we need to get legislators to write the laws like that so they can be tested. It isn’t just we intend for something to happen because it’s really hard to prove intent. You can’t do it and I was you know at a jury of my own peers but you know what do my peers mean in this case. You know there wasn’t a single computer programmer on the bench or in the jury. I know that because we did [?], we wanted to look thought these guys and none of them were even close to my skill levels so I didn’t understand this. We brought in a lot of expert witnesses. One of my expert witnesses at my expense makes this really nice movie showing what firewalls were and how passwords protect things and stuff. And the judge disallowed it because the state doesn’t have that kind of money to make that kind of video. It was insane, the whole was just like eleven days of hell is what it was. Especially the ending of course because I found out I was convicted. I'm not familiar with the particular case you're talking about but there has to have been something in the law that said there was a floor of damages or they wouldn’t have been able to prop it out. They would’ve just said “Well we’re going to do it based on intent and stuff like that” and so we need more laws that are closer to what is actually happening “Are you really being damaged by me, you know, hitting your website or doing anything like that?” By the way, just hitting a website in Oregon may be illegal based on based on this law because you are altering the computer without authorization necessarily “Where’s your authorization? Where is your written authorization to visit the O? The Oregonians web page. Where is it? Do you have it, do you have it on you? No, you don’t so there are going to come after you, yes.

Shannon: It takes me a lot to just sit here and not like get up on my legs and just start jumping going “Yeah, that’s right man. Put it to the big guy”.

Fr. Robert: I am almost sorry that we got into this because seriously, I just want to talk about this for the next hour—

Shannon: I do too, I could go on and on. I'm so passionate about this.

Fr. Robert: There’s so much, oh.

Randal: You could always bring me back, you know this doesn’t have to be my only appearance.

Fr. Robert: Yeah next time we can just rant about how the law hasn’t caught up with tech.

Randal: Oh yeah.

Shannon: But let’s move on.

Randal: Sure.

Shannon: We get this question a lot. A ton of times we’ll have our fans email us and say “I really want to get into programming. I really want to get into coding but how do I do it like where do I start?” That’s a huge thing for everybody I think.

Randal: Um-hmm. It is.

[laughter]

Randal: Is there a question in there? Is that a yes or no question?

Shannon: Yes, how do – well if I was just starting to get into programming, how would I get into it? Where do I start?

Randal: Wow, I think I would find something that interests you that can be broken down into a series of steps and find a programming language that seems to fit the arena for that. I used to recommend everybody to go grab a Squeak Smalltalk, which you could also do the MIT Scratch which is similar because it’s actually based on Squeak Smalltalk underneath. But I've been having a lot of fun lately playing with the Dart programming language. And I think that’s a great place to get started now, runs in your browser, it’s just hit 1.0. I think it’s going to be the next big language for client site app but it also has a really great server side component as well. It compiles the native Java Script on all the modern browsers, so you can build this really complex application and then push – you know debug it with the native tools and then push a button and out comes Java Script and it just runs. And it’s really, really fun, really amazing so I’d play with that. It’s a decent language, it’s got all the traditional stuff like you know, classes, libraries, objects, getter and setters that don’t have a different syntax. You don’t have to shift from a method call to a getter setter syntax. I don’t like other evil language like Java. So it’s a nice language. It’s a really nice language and since Google’s behind it and they're rewriting – I'm told by a little bird that they're rewriting all their major apps like Google Mail and Google Web stuff. All their major apps are going to be rewritten in this over time. So it’s got some sticking power and actually probably going to be writing a book about it. Maybe make some training classes on it but I'm definitely – I'm already commissioned to do a commercial app in it already so Dart seems like fun. Go check it out.

Shannon: Now, both of us are pretty new to this show, doing Coding 101. Do you have any suggestions for us as hosts of this show, trying to get people interested in programming?

Randal: I – let’s see. What have I yelled at the screen when I've been watching your previous shows.

[laughter]

Shannon: Have you yelled at us at all?

Fr. Robert: I think we’ve actually heard it. It was trickling through the chat room as—

Randal: Here’s the problem, I'm both a professional programmer and a professional teacher, having did all the courses that I've taught. One of the things I've learned, and I know that a lot of your shows work this way, but one of the things I've learned is what to leave out. And how I say that is, you know everybody’s starting at some place, and they want to end up somewhere else and, and if you draw a straight line between them, you might go “Well then I just need to know this and then this and then this and then this and then this.” and then you're over at that destination. And a lot of people, when they write about stuff including programming or try to teach things, they sort of go off on these tangents all the time and so it makes it longer. And it also distracts me like “Well then do I – if I'm not quite understanding this, is this the sidetrack or is this the main line? Because if I'm not quite understanding this, will the next part just be harder?” You know is it building on this. So it’s not a problem to take detours but it really helps the listener, the student, however you're dealing with this to inform them “Okay, just hold that thought for a moment, we’re just going to go off on a little bit of a side tangent here for a second just to kind of illustrate a couple of new principles, but you won’t need this for the rest of what we’re doing today.”

Shannon: Right.

Randal: And that really helps. If you can be very clear whether you're on the track or whether you're taking a tangent and informing the listener which of those two you're on like “We’re going to build on this, now you know I'm back on the main track.” But if I were like “Just for a moment I want to show you something really clever about how to pass variables into a subroutine.” You know, but let people know that you're taking that tangent and it really, really helps people stay on track.

Shannon: Thank you so much for that suggestion. That was actually really good.

Fr. Robert: So we’re just going to tell everyone, we’re going to be on a tangent for the next two weeks, just so you know that. Oh Randal thank you so very much for coming on. We’re running out of time, we’re actually running into the next show right now but it is an absolute honor and a pleasure to have you on as a special guest and I understand that we've already extended an invitation for you to teach our audience all about Java, which is a programming language you love.

Randal: Oh, oh, oh,oh,

[laughter]

Randal: Stab me, stab me first.

Fr. Robert: We were hoping for that but if you could tell our audience where they can find you. Of course they could find you every Wednesday morning at 8:00 on Twit TV for floss but where else can they find you?

Randal: Oh my god, all over the net. If you Google for my name, I think there's like 1.4 million web pages that mention me now. But my most frequently posting to Google Plus as Randal L. Schwartz, you can check for me there. I talk about – typically about programming, a lot of humor things there. I also talk about my incredible health increase in weight loss through low carb high fat. I post a lot of articles related to that and nonconventional wisdom in terms of nutrition. But I also tweet at @merlyn m-e-r-l-y-n. I'm at twit.tv/floss for the Floss weekly show. And I'm everywhere, if you just mention me somewhere around the net I’ll probably find you because I have all these little spies that go around and check for things for me, so it’s cool.

Fr. Robert: There you have it ladies and gentlemen. That’s Randal Schwartz, the bad boy of Twit TV. Thank you so much. Now, remember you can always find out more about our show Coding 101 by going to our show page. Just go to twit.tv/code or Coding 101 and you’ll find all of our episodes along with our show notes along with the code repositories, so you can follow us along. Follow along with us when we do our actual coding episodes. And it’s a nice way for you to jump in and make sure that you understand when we are on topic and when we’re leading off into one of those tangents.

Shannon: That’s so very true and you can also find us over at Google, over at our Google Plus community. That’s Gplus.to/twitcoding101. And I also just put us on twitter as well, I don’t know if I told you that.

Fr. Robert: Yeah we’re on the tweeters.

Shannon: Btw we’re on the twitter now, it’s @twitcoding101 super easy to remember, so you can find us over there and you can ask us all sorts of questions if you’d like.

Fr. Robert: And it’s not just G Plus and it’s not just twitter, you can also find us on the youtubes. Go to youtube.com/slashtwitcoding101 and again you'll be able to find all our episodes and that’s also where we’re going to be doing announcements of any special events that we’ve got coming up in Coding 101. And there are event coming up because we’re approaching that time of year where we get an influx of Google IO and maker fair. And all the little things that may not fit into a regular episode of Coding 101 so make sure you subscribe, make sure you check back, make sure you watch us on the youtubes.

Shannon: And last but not least is our Twitter accounts, you can find me over at twitter, I'm twitter.com/Snubs and padre is…

Fr. Robert: @padresj. I also wanted to make sure everyone knew that next week we’re getting back into coding. We had our two weeks of wild card, two weeks of awesome, but now we need you to learn and we’ve got a special guest, our new code warrior is Shannon…

Shannon: Woohoo, my very, very good friend and now kind of a co-worker as well, his name is Dale Chase. He works over at Revision 3 aka Discovery Digital Media and he is going to be our Python expert.

Fr. Robert: Python so – and the reason why we chose Python is because we wanted to give you something that you could use on those brand new Razz Pies that you're going to be buying. We know that you're going to get them. Also, also, please, please don’t forget that we do this show live every Thursday at 1:30 pm pacific. You can join us at live.twit.tv and as long as you're watching this live why not jump into our chat room and irc.twit.tv. It’s part of the experience, you'll see us drawing from the chat room, you’ll see us answering questions, it’s how you interact with us as we’re teaching you the secret foo of the code monkey.

Shannon: I think about – that about ends this episode today. It was a good one, we really enjoyed talking to Randal Schwartz as well and I’ll go ahead and end this one with end of line. Bye!

All Transcripts posts