 Yeah, this is, I am celebrating something like my 10th year using Ruby, and anyone that knows me knows that I really have the attention span of a NAT, so for me to be continuing to use Ruby after 10 years is a real testament to the language. One of the things I wanted to talk about today is why I'm still using Ruby after 10 years, and what it is that keeps me interested. But before I do that, I went to RubyKaigi, I was invited to the, there was a Japanese Ruby conference, I think it was two years ago now, I was invited to that, it's a long flight but I thought, you know what, I'm going to do that because I really, really want to thank, you know, the home of Ruby, and particularly I wanted to thank Matts and for creating it and giving me 10 really good years, and of course I turn up, I give my talk and Matts wasn't there, but I think all of us are really big thanks, whether we've been using Ruby for 10 months or 10 years, to Matts and also the other people in Japan who have created Ruby for us, and then for the rest of the community that's built it on. So I just really want to take this opportunity right now to thank Matts for that, I think it's been absolutely wonderful. So here I am, standing in front of Lone Star Ruby conference, and you know I used to say okay, here's one I'm going to talk about and everything else, but you know I think it'd be better if I had some kind of objective measure of what I was doing, and it's really fortunate that two years ago, how many people were here two years ago, great, okay, so two years ago you had one of the deepest commentators on the Ruby community standing in front of you, talking about the quality of the people in the community and the quality of keynotes given in the community, so I'd like to just set the tone for what I'm going to do here, it can only get better really. So why am I interested in Ruby, why do I keep coming back to Ruby? Well, one of the reasons for me, there's not the real reason, one of the reasons is that Ruby is this multi-paradigm language, okay, it's an OO language, right, in Ruby everything is an object, but unlike the majority of OO languages, it doesn't throw that down your throat, it doesn't force you to be an OO programmer, you can still write procedurally if you want to, or if you want to, you can write in a kind of prototype based style, I'm actually doing that more and more, where I don't use classes, but instead create hierarchies of objects and add things to those objects, it's a very liberating way of programming, it's actually a way JavaScript works underneath the covers, I do that a lot, and there's a whole bunch of people that try and tell you that Ruby is a functional programming language too, well Ruby is functional programming in the same way that a Trabant language is a car, right, it kind of helps, but it's not really there, but that's okay, but the other cool thing about Ruby is that it's all these at the same time, and one of the incredible achievements of Ruby is to take all of this plus syntax that's drawn from everywhere from Perl to Modular to whatever else, put it into one box, and actually make a kind of coherent whole out of it, and I think that one of the reasons that Ruby works for me is that Ruby doesn't tell me, think this way, instead Ruby works the way I think, I don't think OO, I don't think functional, I think hey, I want to get this job done, and Ruby helps me by just letting me do all the things I need to do at the same time, but the problem is that if Ruby thinks the way I think, that also means it's imperfect, and that is why I like Ruby, because it is grossly imperfect, it's gloriously imperfect, now is that a big deal? I think it's a massively big deal, let's look at some famous people quoting about imperfection, it is absurd to look for perfection, there's that sting song, to look for perfection is to live here in hell, it's the idea that you can never really achieve it, you can just waste an awful lot of time doing that, the pursuit of perfection often impedes improvement, you know that, you're sitting there saying oh I gotta do this and this and this and this, you just think of all the reasons you shouldn't do something or you can't do something, rather than just getting on and doing it, I love this one, perfection is slow death, I can't change anything, I'm just gonna gradually just like die away, perfectionism is the end of your creation, obviously, out of perfection nothing can be made, every process involves breaking something up, if you have these things where you can't change them because they're perfect, you're not gonna get anything, there's no redecoration in the pristine chapel, you can't change stuff, no good work whatever can be perfect and the demand for perfection is always a sign of the misunderstanding of the ends of art, I wanna come back to art a bit later on, perfectionism is the voice of the oppressor, ray, yeah, but seriously, you can oppress people with this idea of perfectionism because in perfectionism there is only one way, yeah, any mediocrity can be trusted to be always at its best and then the essence of being a human is that one does not seek perfection and I think Ruby is if anything the most human language, the most human programming language that we now know and then we have this wonderfully ironic syntactically and semantically perfect sentence, perfection has one grave default, it is apt to be dull and it's true, no one wants to live in a perfect world, fortunately Ruby is not perfect, it has some little edge cases, I wanna show you some of the trivial ones now and then we'll move on to some of the big ones, first of all the Ruby language itself is gorgeously messy, okay, you are now the Ruby interpreter, the Ruby parser, what is this line of code? No, it's actually one thing, it's a method that takes a block, indeed, I mean a lot of people think oh is it a method that takes a block or is it a method with an empty hash parameter, yeah, that little sort of like excitement of uncertainty, we can make it certain by doing that, yeah, nothing better than putting some parentheses around something to make it less uncertain, so that is clearly a method that takes a hash, right, what's that? This one's a syntax error, surprisingly or not depending on how optimistic you are, but here's the one fun one, what's this one? It's a method that takes a hash, so by removing the hash literal characters you can actually turn it from being a syntax error into a method that takes a hash, cool, is perfectly valid Ruby, okay, of course anybody who writes that, you need to tell them about methods and stuff, it's too long a line, but this is perfectly valid Ruby, let's just look at the middle of it, let's just look at that, alright, what does this mean? I'll give you a clue, if Ruby knows that M is a variable, that is somewhere it's seen an assignment to M, what does this mean? Come on, shout, yes indeed it is going to, okay, what he said was it's going to send the divide operator slash to M passing N as a parameter and then it will pass the slash operator to the result of that and pass that O as a parameter or it's going to do M divided by N or divided by O, okay, that's if it knows that M is a variable, however, life gets interesting if there is no prior assignment to M, now what does that mean? Okay, and what's its parameter? Okay, so the theory is that this is a call to M passing it a single parameter, which is a regular expression with the compile wants flag, the slash O at the end, any variance on that? Name error, well this is a method, well actually no it's not a regular expression, this is interpreted as call the method M, then divide its return value by N and then divide the whole result by O, alright, so there's still some surprises in Ruby even for experts, but, okay, I'm English so I get to be able to say this, but wait there's more, we all know, right, that languages in which white space is a syntactic construction are evil, right, let's add one, count it, one space, now what does this mean? Now it is a method call where we pass it a reg X, by adding a space we've changed it from a method with no parameters to a method with one parameter and we remove the need for two variables, that's a powerful space, but we can take it further, let's add one more space, now what does it mean? You cannot have a regular expression starting with a space which is a method parameter without parentheses because that's interpreted as a call to M divided by N divided by O, alright, but you know what we put that space in the wrong place, we meant to put it after the N, now what does it mean? Back to the reg X, alright, but you know what, we like laying our code out nicely, we don't like all this jumbled together stuff, so let's put a space before and a space after, hands up, who thinks this is a method with zero parameters that's then divided the result of? O of three or four, how many buildings still is a method that you pass a regular expression to? Alright, so we have about eight people that think and the rest of you clearly don't, what is it? This one's a syntax error, we have a language here where in five characters M slash N slash O by adding spaces in different places, we get three different meanings, now if James Gosling had designed a language that did this, he would jump up a very tall building, if Anders Halsberg had done this he would shoot himself in the head, before he would apologize first, can we do Van Rossen? You know, it would go insane if his language did this because this is obviously not regular, what response do we get? Well I anticipated it, I'm looking at him right now because you know what, the particular set of rules that were used to do this work 99% of the time, they are heuristics that make your code read naturally and if every now and then there's this ambiguity, big deal because the idea in any human communication is to maximize our chances of communicating and if every now and then to do that we introduce ambiguities, then we do it, we don't all speak in Esperanto, Ruby's really not too good at following rules either, I mean let's look at something really simple, everybody knows that languages have keywords, right, so in C sharp keywords are predefined reserved identifiers have a special meaning to compute a compiler, they cannot be used as identifiers in your program, Java, here's a list of keywords in Java programming language, you cannot use any of the following identifiers in your program, Python, the following identifiers are used as reserved words or keywords in the language and cannot be used as ordinary identifiers, do you spot a pattern? Ruby keywords, the rule is are a list, I don't think it's complete, I just stole this from David Black's RDoC keyword thing, here's a list of Ruby keywords, just look at three or four of them today, three of them I guess, let's start off with just a simple case, is piece of code, I assign the string cat to the variable C and then define a method on that particular object, so I say def C dot begin, why not, begins a keyword day, who cares, this is Ruby, we define a method dot begin on C and then we call it by saying C dot begin, guess what, the result is let's start up the old cat, it works, so I guess begin is not too much of a keyword really, in that kind of sense, we can take it a bit further, this is just a little bit obscure but not really much, so we're going to open up class object, what you mean your language doesn't let you open up the basic object, and we're going to define an instance method on object and what's that instance method called, we're going to call it def, why not, and we're going to use the new Ruby 1.9 syntax which allows me to pass blocks to blocks, alleluia, so I'm going to define this method, takes a block, and what's it going to do, it's actually going to call define method to define this, in fact in this case, as a global method on any object, okay, so what can we do with that, well given our cat object, I could say C dot def hello do and define a method, so I don't have to have, you know, I can use def to define methods, why not, that's kind of cool, and then just call it, but I don't even need to see on that, I don't think I just call hello, so that's kind of neat, right, suddenly whole new realms of ugly metaprogramming, open up before our eyes, because we could do something like this, self dot def if do condition block, block dot call if condition, and then we could write self dot if to less than four do test is okay, I don't know about you, I think that's kind of cool, you can write Ruby code that looks like that, only is it cool code, it's kind of syncopated, Ruby has this thing about doing things the right way, its thing is, there is no right way, right, I mean it takes, there's more than one way to do it and explodes it, so say you want to output the number zero to nine, one per line in Ruby, how could you do that, well you could write something like this for I in one to nine do output, this works perfectly cool, you could say ten dot times do, again perfectly cool, works fine, you could say zero dot nine dot each do, absolutely fine, still does exactly the same thing, you could say put test, oh this is getting cleverer now, right, because we know that if you call put test with an array, it outputs each of the elements of the array one per line, so if you take the range zero to nine, convert it to an array and then pass it to put test, it outputs zero to nine, one in your line, not particularly obscure, perfectly valid, yet another way to do it, or you could just say put s star zero to nine, and again that works perfectly well, none of these is better than the other, none of them are particularly clever, but the cool thing is they all exist, so you get to choose which one expresses what you want at that point, and you say but wait a minute, they all do the same thing, how could one express better, I don't know, but they do, if you look in Rails applications, you will typically find that inside a view, people will write a loop like that, inside the main body of their code, they will write the same loop, like that, why? Well, part of the reason is that that's how David Hannamar-Hanson did his views, and everybody basically just cargo-cultured that, oh you use a four in a view, without really thinking about why, but most people I know do that, in fact Chad Fowler has recently stopped doing it, simply as a protest, because he didn't know why he was doing it so much, but the fact that you have that ability is really, really cool. I love this quote from David Levin's book, The World in Six Songs, the best poetry, the best art in any medium is ambiguous, ambiguity begets participation. What does that mean? It means that the instructions for building a lawnmower, probably bad because they're pretty ambiguous, any set of just basic instructions that just says do this, do this, do this, or the sky is blue, the grass is green, it's not poetry, because there is no room for you in it, there's no place for you to get involved, but once I give you some ambiguity, our vegetable love shall grow faster than empires and more slow, then you can sit and you can think about that, try and work out what he means, what are the subtleties in there, what are the puns that are being played on, even a humor relies on ambiguity. If you go to Wikipedia and look up ambiguity, you'll find the Groucho Marx joke, last year in Africa I shot an elephant in my pyjamas, how he got in my pyjamas I'll never know, it's just there because that switch in meaning brings you in, ambiguity is incredibly important, a language without ambiguity is a dead language, and Ruby is not a language without ambiguity, so that's some syntactic stuff, it goes beyond that though, progress in Ruby, the way Ruby has been developed is incredibly messy, the language is messy, the progress is messy, as a publisher we have books, authors like to put those little quotes at the top of chapters, I have banned two, you may no longer write the following two quotes, one is journey of a thousand miles starts with a single step, right gone, the other one is this one, perfection is achieved not when there is nothing more to add but when there is nothing left to take away, okay, and a lot of people go look at that, including me actually 10 years ago, oh yeah that's cool, that's cool, and that's one kind of perfection, chopping stuff away until you have this perfect little diamond in the middle, but another kind of perfection, a bigger kind of perfection is just to encompass everything, if you are everything then you're by definition perfect, and I think that's the approach that Ruby's taking, because Ruby is busy adding stuff, right, we're not aiming for the perfection of the minimalist, we're aiming for something that works, you can look at this in many different ways, here is the size of the RubyTable download over time, so back in 97 with Ruby 1.0 it was down around about a mega and a half, now we're up to about 40 meg, yeah, and if you look at that graph, well it's not too easy to see, so let's put it on a log axis, on a log axis that's pretty much linear, and if something is linear on a log axis, what does that mean, yeah it means that by Ruby 2.0 it'll be roughly a terabyte download to get the interpreter, which is cool because we'll all have high speed then and everything else, you can also look at in terms of number of methods in the core, so I just did a quick eGREP on the source code to do this, number of methods is going up roughly linearly, but that's a lot, back in Ruby 1.0 it was a couple of hundred, now it's pretty much a couple of thousand, that's a lot of methods, and many of them do almost the same thing, is that a bad thing? Well, no, because Java packages them up to separate libraries, these are all built in, yeah, we're better than Java, I don't know if this is a good thing or a bad thing, I know it makes learning the language a bit harder, but it also makes it kind of cooler to have them all lying around, Ruby 1.9, major, major change, incredible change in Ruby, in Ruby 1.9 we have new things like fibers, we've got enumerators, unbelievable character encoding, I would guess probably if you look at the number of source lines in the interpreter, probably more than half of them now are to do with character encoding, and I think we've probably got the most sophisticated and general character encoding mechanism of any language in the planet, it is scarily complete, Ruby 1.9's got performance improvements, whole new interpreter built into it, really cool stuff going on, and of course it's got a new regular expression engine on Igaruma, which is really, really fun, these are advancements that are worth having, all these changes, all these extensions are things that are worth it, and we should embrace, we shouldn't be afraid of changing just because it makes things bigger, because if nothing else, Ruby 1.9 now allows me to write this, isn't that gorgeous? I mean everybody knows that that does, right? There you go. This, this is an example of our Igaruma regular expression, right? It's kind of hard to read that way, but you can take the same regular expression and turn it into this, perfectly valid. It's a regular expression that matches palindromes, words that are the same forward and backward, and it works like this. It says a palindrome is either nothing or a single character or any character, a palindrome, and then that same character. Yeah? That's the definition of a palindrome. Note here that we'll be able to define functions in our regular expression and call them. Note that we have the equivalent of captures that are at a particular scope. So here I've captured some character. Here I say that character in my same scope, not the nested version of it, not the 1.1 higher, but the one in my scope. If Ruby is a functional programming language, I would say that this is where it is, because this is the kind of pattern match that you quite often see in languages such as Haskell and Clojure, right? It's really cool. And this is all built into Ruby. So coming back to this idea of imperfection, coming back to this idea of messiness, I think messiness is cool, because it keeps things interesting. And that's what I really like in a language. And that's one of the reasons that I keep coming back to Ruby, because it's interesting. I keep finding new stuff. That business with the spaces and the method calls, I didn't know that until about four weeks ago. And I was just playing around and I bumped into it. And I was like, whoa, I didn't know that. It's cool. It's interesting. It keeps me on my toes. The last thing I like about Ruby is the fact that the people are messy. I was kind of thinking to myself, oh, okay, I'm going to Austin. I can use kind of like a Western theme, forgetting that Austin isn't actually in Texas. But when we first started, we, when Matz first started with Ruby, it was kind of like this. It really was a couple of people setting off into the unknown. No idea really where they were going, just some idea that they wanted something a bit different. And it wasn't easy. It took a lot of time and took a lot of courage to do what happened. But gradually, over time, other people came, or possibly just the horse died, and people formed a town, and people started to congregate around this idea, around this ideal, around this movement. And so, you know, you heard the story that the first Ruby conference, the first international Ruby conference was held in a bar in Florida, and there were like 30 people in attendance. It was kind of like that. And that was about it. You know, a small group of people, everybody knew everybody else in the community. Probably back then, most people in the community would have named the majority of other people in the community. And we just kept bumping into each other. It was really cool. And as the number of people grew, we started putting a little bit of structure in place, or at least we started building things for ourselves. And so, it turned from being just like, you know, huts or tents into something which was identifiable. And it grew a bit like that. And it kept growing like this, and it was very, very steady, very, very linear growth. If you kind of plot the growth of Ruby over the like 2002, I don't know what, 2003, 2004, whatever, it's a pretty slow, linear growth. People would come into it. They'd go, oh, that's cool, and they'd tend to stick. But you had to search it out. It wasn't in your face. And then in the same way, well, something happens. In the West, it was gold. People found gold, and that changed the entire equation. And we had our own little gold rush. People found rails, and suddenly, it turned from being this little town into, well, there goes the neighborhood. Everybody starts piling in. And it really was the Wild West, because the people that came in weren't people that you knew. They weren't like people that were added one at a time, so you got the chance to know them. 10,000 people arriving overnight. The infrastructure couldn't deal with it. It was very traumatic. It was a big change. It has fundamentally and irrevocably changed Ruby, just because of that one year where the world exploded. And it really was rough and ready for a time. But after a little bit of time, some structure evolved. Here is the annual gold doesn't scale race in... This is actually Deadwood, as in the HBO series. But you can see, we now have hardware stores. We have sort of banks, all this kind of stuff, people wearing hats and ties, as the thing changes, as the needs of the community changes. And now, Deadwood looks like, well, not now, sorry, the turn of the century, which is what, maybe the 40 years in, Deadwood looked like that. So why is that relevant? I started off just jokingly mentioning Zed Shaw's appreciation of my RailsConf keynote, I guess it was. Just after he keynoteed here, he wrote a rant. He wrote a rant, Rails is a ghetto. And I was honored to be a part of that rant. There was a section in that rant, I believe it was called Dave Thomas' Fat and His No Sammy Sosa. I didn't understand it, but at least it was true. The rest wasn't, but the rest was pretty vicious. And I had never had something like that happen to me before. And it kind of, I mean, really, it took my breath away. I was physically sick reading that. And what surprised me about that was, first of all, the attack itself and the viciousness of it. It wasn't just me, the entire whole bunch of people. But it was also what happened afterwards. Because up until then, I thought I was part of the Ruby community. And I thought that I was kind of like participating in it and I was contributing to it and everything else. But actually what happened was a couple of people stood up and said, this is bad, this is wrong. But there were also a lot of people that said, yeah, you take these people down. These idiots who think they should run the world, you should just get rid of these people. And there was a whole bunch of stuff like that. And that was the most hurtful thing. Because that said to me that if there is a Ruby community, then I'm not part of it. These people don't like me. This is weird. And I'll be honest with you. I mean, I think a lot of people say, oh, it's just rants. These are big boys. They can take it. I know other people that have had attacks like this. For me, it took me probably about nine months before I slept properly again after this. I know other people who have had this kind of stuff done and they say the same thing. It's not trivial. It's not trivial at all. And in fact, the only reason that I'm kind of cool with it now is that I realized that my fundamental assumption is wrong. The fundamental assumption I had is that there's a Ruby community and I'm part of it. And that's just ridiculous. Maybe when there were a small group of people, when there were 50 or 100, then there was a community of people who were founded around Ruby. But here's the reality. The reality is Ruby is a resource around which communities can form. Saying that there's a Ruby community is like saying there's a screwdriver community. There isn't one. And that was the mistake I made. So now I see the world differently. I see the world very differently. And when I travel around, I talk to people, I give studios and everything else and I try to take pictures of what I see. And this is where I think the real Ruby communities are plural. It's all these people who are doing cool things with Ruby. Well, I don't know what he's doing with Ruby, but the rest of the people are pretty cool. Groups of people literally around the world who self-form, who self-organize, who give up their time to come and do cool things with other people. And they use the language as an excuse for doing that. Some of them are cooler than others, obviously. A whole bunch of very, very interesting people I love to spend time with. That's Chad Fowler a year ago. He looks very different now. Let's go back to that one. Moment of silence for that one. Oh, damn, I can't go back to it. That's unfortunate. Sorry about this. If you haven't heard, that picture in the middle there was why the Lucky Stiff. And was it this week? Last week. Last week, why he just disappeared? Which is kind of weird. He took all his sites down, he took all his code down, took his blog down. So, he might miss. I'm not 100% sure what's going on there. It may just be a stunt. I don't think so. But he had an interesting, orthogonal way of looking at life. And I'll miss him being around. But the community is out there. The community is made by guys like you. And the cool thing about this is that if you don't assume that there is a Ruby community, but if instead you say, okay, the people in Ruby are just as messy as the syntax of Ruby, are just as messy as the semantics of Ruby, are just as messy as the development process of Ruby, are just as messy as everything to do with it. If you just accept the fact that people are messy, if you accept the fact that in the town of Deadwood it started off with prospectors, but pretty soon they had hardware stores, they had teachers, they had banks, they had lawyers. They had a whole range of different people all doing different stuff. There was no one community anymore. There were lots of communities of interested people passionately involved in what they were doing. If you accept that, then messy can be fun. And that's why I'm still doing Ruby 10 years, and I hope to be doing it for as long as it's still fun. Thank you.