I have finished my first web application in Ruby and Rails. Yeay! I am far from grasping its entire potential, but what I've seen so far has left me tickled. The first thought I had was: wow, you really have to get yourself out of the way and just run with it! Coming from a mindset of having to will your machine into submission, it is quiet a mind twist to surrender yourself to a framework. So, first and foremost, To Rails to me is... to get yourself out of the way!
Everybody talks about how Rails gets a lot of stuff done for you. But seriously, you must have had to go through some major pain before really appreciating what this means. For example... where do I start?
Environment: Do you know how many times I've had to install Apache/Tomcat in my life? With each installation, all the configuration and tweaking around... painful. Do you know, with all the many little ideas of mine that I could have developed a prototype for? Man, if that meant going through this pain for the possibility of little payoff, forget it (I'm not lazy, I simply have tons of projects with bigger payoff probabilities). I love it that everything, including database setup, tests, and configs, are self-contained right in the root of the project. And I didn't have to re-install anything, not once. I even totally forgot there was a server running, I swear.
Folder structure: Just like self-documented code, having a self-documented folder structure can make a huge difference in how productive you are, when developing with other people's code but also even with your my own code. It is also a good indication that you have an idea before hand of what you are going to be developing (if you're not there, go back to the drawing board). I remember when I developed my first serious Java application, I went all over the internet to try and find out how people suggested the folders should be organized. The way I saw it, when I found a good practice guideline I could then employ it forever. And that was indeed the case, but only after studying many different possibilities, since I found a gazillion different but good ways that people were doing it. Can I say I love that I don't even have to think about this with Rails?
I haven't gone deep yet, but some other interesting observations. In the case of Ruby itself, I can see how some people can be very confused with the use of the Boolean type. Coming in with experience in C, where any integer number but zero means "true", I got it immediately how any object that is not "nill" or "false" means "true". Another observation I made is that some aspects of Ruby are not completely unique. I worked with CodeIgniter, a framework for web applications in PHP (I think Zend is similar as well), and the idea of requiring a specific folder structure and working in a RESTful type of way (with actions and resources) existed there as well. But the fact is, when I was working with CodeIgniter I hadn't yet recognized what was happening: one way to put your application together, whether the data was behind a (REST) web service or sitting right here on your machine. Sweet!
Other sweet things that I hadn't had the pleasure to encounter before: I never visited the world of SmallTalk, so I was having a blast with the additional development environment right there on my command line, something totally dynamic. And being the lazy that I am (ok, I am lazy for somethings in that I don't like to do boring, repetitive stuff), I loved being able to generate models, complete with attributes and all related db schema, and all associated fixtures and test files, all with one little line in the command prompt. Hooray! And! Also generating right from the command line the controllers and actions, and views for each of the actions, and again, all associated helpers and tests (both unit and functional!) with one line! And! Not really having to be committed to any of it (I have a commitment issue with technology), it was super easy to drop or change anything! Loved it!
Not all is sweet heaven though. RoR makes me ponder a lot about an issue that worries me in regards to technology. As time goes by, technology is making many things easier and easier to use. This means that people who are not involved in building technology and are purely consumers of it are having to think less and less about some of the things they are doing. Think: calculator, versus understanding arithmetics. What happens when developing software becomes so simple to develop, with frameworks and patterns and recipes that make the job easy to get done by anyone? Will the common denominator be shifted to a lower level? Where will the mental challenge be? I am not worrying about where my next job is going to be. I am fretting about the possibility of ending up with a pool of thinkers that is ever so smaller. Who will I enjoy talking to then??!
One last note about Rails. I am a huge fan of the written word. No matter what language you chose, it is extremely limiting to communicate your thoughts in the written word. Ok, if you want me to be totally technical, it is also very limiting to communicate your thoughts and ideas verbally in any language, but because it can be done fairly fast, you can deviate, and do a lot of trial and error, and possibly get your point across successfully, depending on my things (your audience, your articulation, your understanding, your level of caffeine intake). But try putting it in writing, and all of a sudden you don't have the right combination of words to express it. Okay, this totally sucks (the hindrance in communication) but it serves a great use: it forces you to think about your idea from many different angles, just so you can find a way to write it down cohesively with the tool (language) that you are using. With that said, it is great that Rails makes it so easy to do the test cases that you should be running, because it automatically puts them in there for you and all you have to do is to complete writing them. Ideally, you will use that process (of completing the tests) as a way to uncover the way you are going to code the idea behind your software before you write the code. I am looking forward to trying RSpec and start thinking in terms of BDD.
So, when you completely forget about the things that have been setup in the past, and don't have to think about how to do or structure something now so it won't break your app in the future, it leads to a very Zen, or "in the moment" way of programming. It is a complete submersion in the experience of... coding. The only thing you have to think about is what you are going to code, how you are going to code, and then code. It is not like it, it is meditation itself. Can you imagine bringing your meditation practice with you to work, how cool and awesome that must be?
Hey, wherever you are, there you are.
As a happenstance, I had just figured out I have a problem and am so happy to get the sense it will be painlessly addressed with RoR. When you work to make a living, even if you work for yourself, you have a set of goals to accomplish that end up constraining you. You try to get the job that is going to be satisfying and will provide the types of challenges that will help you grow in the direction that is interesting to you, but as proactive as you can be, at the end of the day you have a job to deliver to someone. And so I just figured out that there is no 1 job that is going to provide me with all the learning and contributing opportunities that I am looking for. I will still have to be proactive in making my day job as awesome as it can be, but I have to look for a complement out there somewhere. If it's not obvious, I'm talking software. On this front, it is so amazing to find RoR at this stage. My inner geek is very happy about finally coming out, AND at a time when (@development = pain) => false.