Rails and Ruby and other such nonsense
I've fallen head over heals in love with Ruby on Rails. It not only is a joy to use, but is making me such a better software developer.
I first started programming when I was oh 10 years old or something like that. BASIC. Good ol' BASIC. No not, Visual Basic (yuck!!), good ol' gwbasic (also a Microsoft product). It taught me the bare essentials of programming: variables, branching/conditionals, looping, yadda yadda -- you know, the serious basics. I think most would agree you can only go so far with BASIC.
I then moved onto C (many years later), where I started learning things like memory management, libraries and linking, compiling, basics of how a computer works (C isn't called "the portable assembly" for nothing)
I didn't stay with C long as I got wind of this "object oriented programming" and was curious. Interestingly enough someone on a newsgroup pointed me to a paper on Apple's website that explained what OO was and also included a brief intro to Objective C. The paper was very enlightening, but I decided to pursue C++ instead of Obj C because it was the language at the time (some would say I made a poor choice, I might agree).
Wow, C++ was a breakthrough for me. I bought (and cherished) Koenig's Accelerated C++. That book was impossibly hard for me at the time but I stuck with it. Read the chapters over and over, did the examples and played with them until I understood what was going on. That book made me a man as far as programming goes :) To this day I get it out and read it from time to time, along with his other book, Ruminations on C++. I seriously put Koenig up there with the Gang of Four, and Kernighan and Ritchie for software greats, the man knows his stuff, knows how to express it, and really understands software development at a very rich level.
It was with C++ that I learned about modularity, the idea that "classes represent concepts", what it means to be a data type (still my favorite thing about C++, you can integrate with the language just as strongly as the language features themselves), why parts of your program should know as little as possible about other parts, etc etc etc.
Java was next, and I was in love. Java will always hold a special place in my heart. I think I liked Java so much because it lets you focus on the problem at hand and the nasty upkeep and bookkeeping that lower level languages force you to do is gone. You're left with a beautifully clean surface on which to express your ideas. I also loved the quality of Java's development tools (still second to none to this day), Ant was very refreshing after dealing with make for so long. Eclipse redefined what an IDE should be to me, etc etc.
Funny thing is, Java didn't teach me very much. Probably what I took away from Java more than anything is the value of writing readable code. Expressive variable and method names may take longer to type, but it's so worth it. You never have to stop and remember what some terse method name means or why this function call has that odd side effect. Clear, english based names really got its start in Java (as far as I know) and I think that's a very valuable contribution to programming.
I moved on to .NET which I still code in to this day (for my profession, not for fun). .NET hasn't taught me much either, it's basically Java in Microsoft clothing. Don't get me wrong, .NET is very good for what it's shooting for: safe, rapid software development focused on the Windows platform for the corporate world. .NET is fantastic for that. Better than Java. Better than anything else out there. Period. But C# pretty much is Java, and it still keeps one in that now old-school OO mentality. Where functions are passive and data rules. Where types are strong and restrictive (oh I hate generics in .NET now that I code in Ruby!!!) Someone out there wrote a nice journal entry about how verbs are second class citizens in Java and C#, and I couldn't agree more.
And of course there are many other languages I've learned, played with, seriously used over the years. Perl, Python, Scheme (great stuff), various assemblies, Visual Basic (not so great stuff), javascript, etc etc...
Now I'll talk about my current darling language: Ruby! Yup, I'm one of those guys, and you should be too :) It all started when my girlfriend wanted me to write her a web application where she could record her daily diet and exercise. Sure! No problem! Looking in my programming toolbox I grabbed the best tool I had for the job: Tomcat and Java. JSP is great! Servlets are great! Right? Luckily, I had also decided this little app I was making for my girlfriend would be a good candidate for learning some AJAX stuff. So I bought a book on AJAX and started reading it. It mentioned, and highly praised, Ruby on Rails. Hmmm, sounds interesting.
I worked through a Rails tutorial on Apple's website and was very impressed. I decided to rewrite the foodlog webapp in Rails. At this point the Java based foodlog was up and working, but it was buggy, took a good while to write, and not extensible at all really. In contrast, the Ruby version took about 10 hours to write (keep in mind, my first ever exposure to both Rails and Ruby), and it was almost completely bug free, MUCH MUCH MUCH cleaner code, highly extensible, offered true user authentication and logging in (the Java version didn't even come close to that) and quite simply blew away the Java version. Just obliterated it.
Since then I have put out another webapp using Rails. It's a simple test app that I used to get a feel for what it'd take to write real webapps in Rails from start to finish. There are numerous bugs and issues in that site, and the hand written javascript is mostly to blame. I didn't realize Rails offered full featured dynamic javascript generation with their RJS system when I made saidsecrets. And I am currently working on a very extensive, powerful and full featured webapp (for reference, has more functionality than Myspace) that is coming along amazingly fast considering I'm the only one writing it. To put it bluntly, Rails rocks.
But the thing is, Rails and Ruby are making me a much better programmer. More so than any of the languages in my past. Rails emphasizes DRY, "don't repeat yourself", and "convention over configuration". Rails -- and Ruby -- more than anything I've ever worked with, are teaching me how to make components that are incredibly flexible. Components that isolate areas of change to one single location. How to see the commonality in the various aspects of a system and take massive advantage of that. Granted, Ruby's insanely dynamic nature (you have to see it to believe it) is a major reason why all this is possible, but the general concepts apply back to my C# I write from 9 to 5 very nicely. I'm learning the power of functional programming, and wondering how I ever got by without it. I'm starting to realize strong typing is not necessarily a good thing. I'm learning that when code can almost read like its english, it's very easy to maintain and understand (my Java lesson taken to another level, essentially). I'm learning how important it is to make your API as easy to use as possible, and how making the interface to your API easy means the API itself is stronger because of it. I'm learning the power of testing, not just unit but functional, integration and stress testing too. I feel like an extremely conservative, never-takes-chances person that's gone skydiving or whatever and suddenly is seeing the world in a whole new way. Ruby and Rails have done that to my software development world.
But probably most of all, Ruby has really hit it home for me that different perspectives (ie, different languages and more importantly different types of languages) are essential to becoming a good developer. A bold statement here, but someone who's only ever really coded in one language? Not a good software developer. So does your job, project, school, whatever call for coding in Java or C# or C++ or??? Do yourself a favor, write a game in Lisp, or a website in Ruby , or an emulator in assembly. Guaranteed you'll be a better developer and understand your language and technology of choice better.
I first started programming when I was oh 10 years old or something like that. BASIC. Good ol' BASIC. No not, Visual Basic (yuck!!), good ol' gwbasic (also a Microsoft product). It taught me the bare essentials of programming: variables, branching/conditionals, looping, yadda yadda -- you know, the serious basics. I think most would agree you can only go so far with BASIC.
I then moved onto C (many years later), where I started learning things like memory management, libraries and linking, compiling, basics of how a computer works (C isn't called "the portable assembly" for nothing)
I didn't stay with C long as I got wind of this "object oriented programming" and was curious. Interestingly enough someone on a newsgroup pointed me to a paper on Apple's website that explained what OO was and also included a brief intro to Objective C. The paper was very enlightening, but I decided to pursue C++ instead of Obj C because it was the language at the time (some would say I made a poor choice, I might agree).
Wow, C++ was a breakthrough for me. I bought (and cherished) Koenig's Accelerated C++. That book was impossibly hard for me at the time but I stuck with it. Read the chapters over and over, did the examples and played with them until I understood what was going on. That book made me a man as far as programming goes :) To this day I get it out and read it from time to time, along with his other book, Ruminations on C++. I seriously put Koenig up there with the Gang of Four, and Kernighan and Ritchie for software greats, the man knows his stuff, knows how to express it, and really understands software development at a very rich level.
It was with C++ that I learned about modularity, the idea that "classes represent concepts", what it means to be a data type (still my favorite thing about C++, you can integrate with the language just as strongly as the language features themselves), why parts of your program should know as little as possible about other parts, etc etc etc.
Java was next, and I was in love. Java will always hold a special place in my heart. I think I liked Java so much because it lets you focus on the problem at hand and the nasty upkeep and bookkeeping that lower level languages force you to do is gone. You're left with a beautifully clean surface on which to express your ideas. I also loved the quality of Java's development tools (still second to none to this day), Ant was very refreshing after dealing with make for so long. Eclipse redefined what an IDE should be to me, etc etc.
Funny thing is, Java didn't teach me very much. Probably what I took away from Java more than anything is the value of writing readable code. Expressive variable and method names may take longer to type, but it's so worth it. You never have to stop and remember what some terse method name means or why this function call has that odd side effect. Clear, english based names really got its start in Java (as far as I know) and I think that's a very valuable contribution to programming.
I moved on to .NET which I still code in to this day (for my profession, not for fun). .NET hasn't taught me much either, it's basically Java in Microsoft clothing. Don't get me wrong, .NET is very good for what it's shooting for: safe, rapid software development focused on the Windows platform for the corporate world. .NET is fantastic for that. Better than Java. Better than anything else out there. Period. But C# pretty much is Java, and it still keeps one in that now old-school OO mentality. Where functions are passive and data rules. Where types are strong and restrictive (oh I hate generics in .NET now that I code in Ruby!!!) Someone out there wrote a nice journal entry about how verbs are second class citizens in Java and C#, and I couldn't agree more.
And of course there are many other languages I've learned, played with, seriously used over the years. Perl, Python, Scheme (great stuff), various assemblies, Visual Basic (not so great stuff), javascript, etc etc...
Now I'll talk about my current darling language: Ruby! Yup, I'm one of those guys, and you should be too :) It all started when my girlfriend wanted me to write her a web application where she could record her daily diet and exercise. Sure! No problem! Looking in my programming toolbox I grabbed the best tool I had for the job: Tomcat and Java. JSP is great! Servlets are great! Right? Luckily, I had also decided this little app I was making for my girlfriend would be a good candidate for learning some AJAX stuff. So I bought a book on AJAX and started reading it. It mentioned, and highly praised, Ruby on Rails. Hmmm, sounds interesting.
I worked through a Rails tutorial on Apple's website and was very impressed. I decided to rewrite the foodlog webapp in Rails. At this point the Java based foodlog was up and working, but it was buggy, took a good while to write, and not extensible at all really. In contrast, the Ruby version took about 10 hours to write (keep in mind, my first ever exposure to both Rails and Ruby), and it was almost completely bug free, MUCH MUCH MUCH cleaner code, highly extensible, offered true user authentication and logging in (the Java version didn't even come close to that) and quite simply blew away the Java version. Just obliterated it.
Since then I have put out another webapp using Rails. It's a simple test app that I used to get a feel for what it'd take to write real webapps in Rails from start to finish. There are numerous bugs and issues in that site, and the hand written javascript is mostly to blame. I didn't realize Rails offered full featured dynamic javascript generation with their RJS system when I made saidsecrets. And I am currently working on a very extensive, powerful and full featured webapp (for reference, has more functionality than Myspace) that is coming along amazingly fast considering I'm the only one writing it. To put it bluntly, Rails rocks.
But the thing is, Rails and Ruby are making me a much better programmer. More so than any of the languages in my past. Rails emphasizes DRY, "don't repeat yourself", and "convention over configuration". Rails -- and Ruby -- more than anything I've ever worked with, are teaching me how to make components that are incredibly flexible. Components that isolate areas of change to one single location. How to see the commonality in the various aspects of a system and take massive advantage of that. Granted, Ruby's insanely dynamic nature (you have to see it to believe it) is a major reason why all this is possible, but the general concepts apply back to my C# I write from 9 to 5 very nicely. I'm learning the power of functional programming, and wondering how I ever got by without it. I'm starting to realize strong typing is not necessarily a good thing. I'm learning that when code can almost read like its english, it's very easy to maintain and understand (my Java lesson taken to another level, essentially). I'm learning how important it is to make your API as easy to use as possible, and how making the interface to your API easy means the API itself is stronger because of it. I'm learning the power of testing, not just unit but functional, integration and stress testing too. I feel like an extremely conservative, never-takes-chances person that's gone skydiving or whatever and suddenly is seeing the world in a whole new way. Ruby and Rails have done that to my software development world.
But probably most of all, Ruby has really hit it home for me that different perspectives (ie, different languages and more importantly different types of languages) are essential to becoming a good developer. A bold statement here, but someone who's only ever really coded in one language? Not a good software developer. So does your job, project, school, whatever call for coding in Java or C# or C++ or??? Do yourself a favor, write a game in Lisp, or a website in Ruby , or an emulator in assembly. Guaranteed you'll be a better developer and understand your language and technology of choice better.
