 Finally, intended as a talk for folks who are going to be hacking on stuff, and the idea was to talk a little bit about what you can learn from Ruby about building applications that can then give you lots of users and give you a great user base because the Ruby community is kind of fantastic, and so there's a lot of things that you can learn from that. But since that isn't quite the target audience here today, I'm just going to talk about why Ruby is awesome and skip all the other stuff. How's that? Okay? All right. So I want to start with a quote, and this name should be familiar to you by now because this is what Winston was talking about, so Matt is the creator of Ruby, and so this is what he says about why he created the language. Often people, especially computer engineers, focus on the machines. They think by doing this, the machine will run fast. By doing this, the machine will run more effectively. By doing this, the machine will something, something. They're focusing on machines. But in fact, we need to focus on humans, on how humans care about programming or operating the application of the machines. We are the masters and they are the slaves. So the point that he's trying to make is he's writing a language for people to use, right? Not for machines to use. So it's meant to make people happy. You're meant to be happy while you're developing in Ruby. And so Ruby is optimized for happiness, all right? There's lots of ways to use Ruby to optimize for your own happiness. No? Nothing? Okay, your developer's happiness. I'm more of these. If you've got theme builders, plugin writers, things like that, right? And you use the base. I think all of you need to go watch Despicable Me right now, like right this minute, okay? How do you do this? Okay. Obviously not. How do you optimize for happiness by using Ruby? So what do developers like to do the most? They like to build things, right? They like to hack things. They like to extend things. So the first thing you want to think about if you're building an application and the first thing that Ruby does really, really well is to make things extendable. What do I mean by this? So there's something in Ruby called metaprogramming. It's not just a Ruby thing, but Ruby does this really, really well. It makes it really, really easy. What do I mean by the same metaprogramming? So let's say I have something like this. I have an object, a cap, and what I want the cap to do is a whole bunch of things. But I don't really feel like writing a method each time I want the cap to do something. I don't really feel like saying define method, say, define method, like define method, eat, right? So what I can do is I can just do this, and Ruby is going to do this for me. So what metaprogramming basically means is that you are changing the way you're creating methods on the fly, as the code is being interpreted. So you can create your own methods. So I can now say cat says meow, and it will say meow. I can now say cat, I can tell the cat to look itself, and so on and so forth, right? So this is a very powerful idea. This feels like it's really simple, but this is a really powerful idea, because this is basically what powers Rails. It makes Rails a really awesome framework. So Rails has a lot of things like, has many, belongs to all kinds of things, all kinds of declarations that are not native to Ruby. And the reason that you can do that is because Ruby makes it really, really easy for you to write doing specific language, to write stuff like this. So Ruby is very, very cool that way. So if you are thinking of building a project, you... I'm obviously not suggesting you write your own programming language that will allow you to do stuff like this. But what I'm suggesting is that you want to think about how the stuff that you're writing will be easily extendable by other people. So Ruby makes itself really easily extendable by giving you the option to basically change the language to do whatever you want. And I think that's like the ultimate, ultimate extendability feature. But there's also other stuff you can do to make your stuff extendable. For instance, you can open source it, right? So you can just release it to the world and have people contribute stuff to it. Of course, that doesn't mean that if you open source stuff, then people will come, but it will be the first step along that journey. You could consider an API, you could consider putting in plugins. So RubyGems is kind of awesome. For those of you who are not that familiar with the Ruby community and the Ruby ecosystem, RubyGems have something like four billion downloads to date, and there's a RubyGem for practically everything, I think, if you look hard enough. So it's really cool because what it allows you to do is it allows you to reuse a lot of the code that other people have already written so you don't have to come up with all the stuff yourself. And the cool thing about RubyGems is that they're also really easy to write and package and distribute to other people. So it's a very easy way to get started and to start feeding things back into the community. And that is also cool from like a meta perspective. So it makes the Ruby community very vibrant and very active because it's so easy to contribute stuff. So there's always lots of people contributing new things. You could also consider user configuration. I was going to talk a little bit about how you could do user configuration with Ruby, but there's actually a great guide on how to do that, so I'm just going to point you into that instead. You can look up practicing ruby.com, which is here, and there's a great guide about writing configurable applications. So it talks about how to use... You can do this with Ruby specifically, you can do this with Ruby on its own, you can do this with YAML, and there's a whole bunch of different tips to make your application configurable so that you can release it to a larger audience. Again, to make the stuff that you're writing extendable. The second thing... If you wanted to... Good, okay. The second thing that Ruby does really, really well is it makes things expressive. Here's what I mean by expressive. So this is not expressive. These two are doing the exact same thing. Essentially, each loop is doing... This is Java, this is Ruby. So what this is doing is basically iterating over... It's a loop that's going over the same thing three times and it's printing out the value of X. So what Ruby does is it says, okay, take the number one up to the number three and do that. That's pretty straightforward, right? And that's what we mean when we say expressive. So expressive means it's really super easy to read, I was talking about this a little bit earlier. So Ruby is a very natural language. It's very predictable. Okay, and the cool thing about being predictable language is... Okay, so how many of you use Google instead of bookmarking things? Okay, for those of you in the front, there's one hand in the back. So I'm one of those people. Instead of bookmarking things, I just go to Google and I type in the search term because I know that Google is going to give me what I'm looking for if I type in those specific keywords, right? That's what I mean by predictability. I know that if I type wiki ruby, I'm going to go to the ruby wiki page, right? It's going to be the first result. I know that if I type just ruby, Google is smart enough to give me the Wikipedia page up, you know, up towards the top because it privileges that information. So it's a predictable kind of experience for me. And the ruby syntax is built along that principle. It's the principle of least surprise. So if you go through a ruby tutorial, for example, and these are a couple of good examples. So ruby monk and try ruby are great starting tutorials. I really, really like ruby monk. And what both of these guys do is instead of telling you, okay, try to use this method now, they will tell you to guess the method. So they won't tell you what the method is. They'll say, okay, what do you think the method should be? And they ask you to try it. And the point being that half the time you're going to get it right because it's very easy, it's very natural, it's very predictable, okay? Predictability doesn't mean that it's very consistent to what you're familiar with. So if you're coming from like a Java background or a PHP background, which is what I came from or a Python background, then maybe a little bit different. But it's consistent to its own world. So once you get used to that syntax, just like once you get used to how Google does things, it won't change. So it's a very comfortable environment. It's very consistent in its own domain. Rails is kind of the same. So Rails, and Winston was talking about Rails a little bit earlier, has a philosophy of convention over configuration, meaning that there are certain things that are there that are same defaults that you don't have to think about anymore. So rather than making things really configurable, it emphasizes that there are certain conventions, there are certain styles, there are certain norms, there are certain rules that you should follow. There's a Ruby style guide as well, which you can refer to, which spells out a lot of these things. So there are style guides within the community, just like there is the Go formator that also formats stuff for you. And the point of all of these is to make it a consistent experience for everyone. So if you are collaborating with a whole bunch of different people, then using the style guide will make sure that you guys are sort of... that you have the same code experience. Making things modular is a really great idea for making stuff popular because it simplifies decision making a lot. So if you're writing things in a very modular sort of architecture, it means that you're communicating less about the stuff that you have to do. So you're working on one thing, so your friend is working on something else, and all you have to do is send the output to whoever is working on the other stuff. So if I change all of my stuff here, it doesn't affect what the person who's working on their stuff is working on. And this is cool because this means that everyone can sort of work independently. So in Ruby, there's a lot of different examples of that, but what I wanted to highlight for you guys, because what we're talking about earlier is stuff like this. So Ruby is an interpreted language, right? Which means that you don't have to compile it. It's something that is compiled on the fly and interpreted for you, right? So the traditional interpreter used to be MRI. Now it's called something else. It means this is interpreted to C, to standard C libraries, but that's not the only way to do things. So you can also write Ruby, and you can have that to be interpreted into Java, which is JRuby, and that's super cool. So what JRuby does is it not only allows you to use Java libraries and to use Java code, but it's also better in terms of concurrency than the regular Ruby interpreter. So if you care about stuff like that, that's kind of cool. Or if you want to put Ruby on the mobile, you can also do that with MRuby. That's a relatively new project. The point being that you can use the same language, but on top of different systems, and this makes your decision making a lot more simple as well. So you don't have to decide, okay, if I want to write something in Java, then I have to learn a different language. Ruby makes it very simple for you. Number five, document everything. And I mean everything, including the kitchen sink. So if you are aiming to build a community around a project or something that you're developing, document not just your code, obviously that's important. And if you're writing things in an expressive way, documentation is still important, but slightly less important. But also document your style. We talked about that, how style is really important. Document the decisions that you're making in the project. Document your mistakes. I really wanted to put this picture up there. It's just really cute. But it's important to document the stuff that doesn't work well and the stuff that you've decided not to do, because then you don't make the same mistake again in the future. And it's a good idea to make that easily accessible. So a lot of open-source software projects, Ruby included, have a lot of this information up there in the open mailing list and things like that so that you can go through it and you can have a look and you can see that, okay, this has been done before. People have said that this is not a good idea. Let's not do that anymore. So it saves you a lot of time. And the last thing is make it easy to learn. So I think personally that Ruby is pretty easy to learn for all of the reasons that I've told you guys already. And if you are developing an application, it's also something to think about in terms of future development. So you want to make sure that your code base is not this monolithic thing that after you come back to it, after a few years, no one really knows how it works anymore. So because that makes bigger changes a lot trickier in the future. But if you follow the steps earlier that I mentioned, it's probably a little bit easier. And yeah, so if you want to learn Ruby, go to either tryruby.com or rubymump.com. Both of those are really awesome. The next after this will be the last breakout about PHP by Lester. Do you have any questions? There's like five minutes. Sorry? Okay, those are two different questions. So Ruby and Rails are two different beasts in my opinion. So I think that Ruby is really easy to get started with because it's a very natural language to learn. So personally, Ruby is a relatively new language for me. I came from a PHP background. Rails is a slightly different story. Rails is an amazing framework that allows you to do all kinds of awesome things. But it also has a steeper learning curve. So Rails is awesome. I wouldn't say it's not easy. I would say that it has a lot of assumptions behind it. So it requires a little bit more reading, a little bit more of getting into. Whereas with Ruby, you just sort of hit the ground running in my opinion at least. Are you a developer? Not yet. So no programming language? A bit of scissors. A bit of scissors. Okay, I mean, like you have seen earlier, they all read like English. So they are pretty easily understandable. I think it just takes time for you to get used to syntax, etc. Then of course you need to brush out the computer programming general concepts. If you give yourself one month intensive training, I think it works for all languages as well if you should be able to pick it up very easily. So Ruby is the language itself. You can go to tryruby.org and just learn all the syntax. It's not difficult. Rails is a little bit more complex than I had said, but there are also a lot of tons of tutorials and guides online as well to help you get started. In fact, you can get instant gratification in 10 minutes to build a block easily with Rails. If you want to know more, come to Rails for something. Yeah, that's what we got here. But in general, it's not that it's difficult. It's just that Rails has a few more assumptions about it. So you need to know a little bit more about model view controller, things, and you need to know a little bit more about... Is it like WordPress or what? Just take one or two months. You can do more with Rails, but with Rails after you have learned Rails. So WordPress is really like a CMS only. Yeah, so WordPress is really... It's better here. I'm trying to get some more WordPress here. Yeah, yeah. Rails is really like... you can do a lot more things with Rails. Rails is designed as a proper applications report. So it's designed to allow you to do amazing stuff, not just vlogs, like Vincent said. So Twitter was... Is it still running on Rails? Some parts of Rails is still on Rails. Yeah, so you can build massive, massive things that run fairly well, but it requires a little bit more of getting into it. I would start with Ruby and then move on from there. Do you use PHP or no? That's a true question, right? The right tool for the right job. Right? Yeah, so sometimes... The right tool for the right job. So the entire Rails and Ruby work does not have any PHP code in it? Yeah, Rails is written basically in Ruby. And Rails... What's the question? Some of the server side is like PHP, right? So if you are using Ruby on Rails, the server side will be Ruby. Everything will be Ruby. And the reason it works is because of the metaprogramming abilities that Ruby has. So it literally allows you to do almost anything you want with the language. You can extend the language in so many different ways, which is what makes Ruby awesome. So you can build your own framework if you want to. But at the same time, if you are building a web application, you can't run from HTML, CSS, JavaScript. So we're not saying that if you use Rails, you don't need to do CSS, HTML, JavaScript at all. You still need to do that, because front-end, definitely, you have to do those things. Just that your back-end will be powered by Ruby, just like you do with using code, and your back-end will be powered by code. Rails is not the only way to publish stuff on the web if you want to use Ruby as sort of the primary environment. You can also do things with Sinatra, which has a slightly smaller learning curve than Rails. It's not as powerful as Rails, because Rails is really this massive, awesome thing. But Sinatra is, I think, a little bit more accessible and teaches you some of the same basic concepts. So you can start with Sinatra, move on to Rails. That's another way of doing it. You can check out Sinatra as well. And if you have more questions, come find us at the Meetup.