Back in January, I posted about my plans for the new year. Number five on the list was to learn a new programming language. I thought it would be good for me to grasp how other languages handle the things I’ve come to learn in Ruby/Rails. I still agree with that, but I’m having a terribly difficult time prying myself away from Ruby. I’m so infatuated with it. For Christmas, I got a Python book. I’ve yet to read one single page, but since January, I’ve somehow managed to read three more Ruby/Rails books.
I know I’ve mentioned this numerous times, but Ruby is my first real attempt at a lot of things (OOP, Extraction, DRY code, MVC, etc). I did a little VB.NET and C#, but never had the desire to go home and read books about those technologies. So, being part of projects that involved those languages, mixed with the design aspects that I was more-so responsible for, I didn’t get too much out of it. I do remember having to explicitly write out the “getters” and “setters” for each attribute in .NET (which is ridiculous when compared to attr_accessor). And I can’t even begin to tell you how sloppy my PHP code was, as that was my first attempt at something on my own. I just made it work, so I don’t really know what PHP is capable of. I do know I’m not crazy about the syntax (I knew that back then, though).
I keep coming back to the thought of learning a new language. And now I’m considering Erlang (examples: 1 and 2). I read something on it (or watched a video) over a year ago. But when my time is limited, I’d rather reinforce and learn a language I know I love, rather than start over with something new. What’s your take on being a well-rounded programmer? Can that help you learn the language(s) you know you love? If so, is it worth it?
01
Chris on Fri Apr 20 at 04:08PM
Being well-rounded will help you better pick what tool is best for a given situation. Even within a language, really. For example, I’ve written a number of applications using Camping because I wanted something simple and didn’t need the bulk of the features in Rails. No tool is right for everything.
Having said that… I tend to prefer digging deeper into my favorite language rather than learning a new language. I would like to learn Erlang and Python as well, but there are most aspects to Ruby that I want to know more. I’ve done a fair share of meta-programming with Ruby, but I don’t always fully understand or know how (programming by coincidence).
So, I don’t have a solid answer on the matter. I guess I would say learn one thing very well, and then learn something else. My exodus from PHP was partially based on me pushing the language to its limits – I simply wasn’t able to build the constructs I wanted to (exactly what happened with DHH) and so I began seeking alternatives.
I lost my train of thought too many times while writing this :-p
02
Ryan on Sun Apr 22 at 06:07PM
For me, part of what makes it hard to leave Ruby is, when I learn something new within the language, 9 times out of 10 it makes me stop and think “wow—that’s awesome” as I begin to think of how I could use it. The “awesome” factor is huge for me, and it’s really, really hard to break away from that just to take a chance on something else.
I’ve done very little meta-programming, but I love knowing there’s a whole new wave of Ruby that I’ve yet to get into. However, it does frustrate me to look at code snippets (even some of yours) and not know how or why it works. I’ve been doing better about refusing to adopt something until I fully understand it, though. In my younger days, I used to have the attitude, “who cares as long as it works” which is awful for maintainability (and for learning).
Anyway, I guess part of me thinks “what if Ruby/Rails is no longer?” It doesn’t feel good to only solidify one language in my repertoire. But at the same time, the concepts are more important than the language, so I’ll bank on the fact that I can learn a new language if I’m forced to. As for now, I’m going to soak up as many concepts and Rubyisms as I can cram into my brain.