News for hackers. Stuff that matters.
Re:Why I Program In Ruby (And Maybe Why You Shouldn't) by fauigerzigerk on Saturday November 24, 2007 @04:10PM (#83240)
The article sounds so beautiful, so beautiful, all the joy and the flowers and the harmony and the japanese and the danish and the total lack of language wars and crusades ... sorry, seems I've fallen asleep at the keyboard.

Anyone remember how you felt when you moved from C++ to Java? Wasn't it a joy? As if somebody had thought, hey I'll make a language for people to enjoy. No memory management! Yeah! No obscure macros! Just clean, beautiful code that everybody could immediately understand and nobody would shoot themselves in the foot.

We didn't think about how many times we would have to type getSomeField() { ... } and setSomeField(...) {...}. We didn't think about how entire frameworks, byte code manipulation weirdness, special purpose runtime containers, poorly integrated language extensions, etc would have to be written and deployed to overcome the metaprogramming deficiencies of Java. We were so glad to get rid of those breathtaking C++ compiler errors resulting from template crazyness that we didn't think about how statically typed languages really need type parameters.

For short, we didn't think about anything relating to the power of the language, we just felt joy and a big relief that the C++ curse had been taken from our souls, aching for harmony.

At least for myself I can say I'm not going to make that same mistake a second time. F..k harmony and joy! Let's switch our brains on before we jump onto the next language! I'll take a language war any day if it makes me think hard about how the features of a language behave once a system grows.

Re:Why I Program In Ruby (And Maybe Why You Shouldn't) by tx on Sunday November 25, 2007 @12:29AM (#83287)
I lost you at the beginning of the 2nd paragraph. Nobody who knows how to muscle their ways in C++ feels good after transitioning to Java. There is nothing "liberating" in this hog for someone who knows C++. There is nothing in Java that one can call "beautiful" or "enjoyable". I am sorry to sound like an idiot (yes, I have re-read what I just wrote) but I cannot help it - Java is full of hidden messages like "oh, we feel like you're too stupid to have this or that kind of power, so just sit in a sandbox and enjoy the ride". And indeed, most programming idiots I've met in my career called themselves "Java programmers".

No statically typed language without powerful template system nor multiple inheritance of some sort should be considered usable in this age and time. Java/C# (same shit) was designed for "enterprise software" development, something a CS grad should never, never, never consider doing.

Ruby is the opposite of all that - Ruby represents ultimate freedom of expression. C++ runs circles around Java in that regard. Ruby only takes it several levels higher. In Ruby you really do feel like changing the world, as long as your world is written in Ruby as well. It's sad you missed it as the main point of the great post.

P.S. Go get yourself some decent C++ book.

Re:Why I Program In Ruby (And Maybe Why You Shouldn't) by fauigerzigerk on Sunday November 25, 2007 @03:36AM (#83307)
First of all, I didn't say anything negative about Ruby. Yes, maybe I missed the point of the article. Maybe the author just wanted to say "Ruby is good". But I read the article as saying something about how to choose a language based on joy and harmony and that's what I take issue with, not with Ruby in particular.

Second, I have read a lot of good C++ books and I'll even admit that I take some perverse kind of pleasure from template acrobatics as presented in Alexandrescu's Modern C++ Design for instance. But in 1995 - 1997 I was overwhelmed by the complexity of C++ and Java was a relief for me and many others. Yes it was naive, and yes every ex C++ programmer started to miss things very soon. But even after learning so much more about C++, I still feel the complexity/power ratio of C++ is awful.

In 1995, when Java came along, C++ was less powerful. There was no proper template support, no standard library, not even a string class. You had to use evil stuff like MFC to get anything done at all. And it took until the early 21st century for anyone to really grasp templates and write good books about how to use them. So, that's why I still understand the gut reaction of relief when Java emerged. But, as I said, I regret to have reacted in a such a purely emotional way without checking out other options. You apparently did, and you have my respect for that.

Re:Why I Program In Ruby (And Maybe Why You Shouldn't) by Andys on Saturday November 24, 2007 @09:13PM (#83268)
In the past 2 years I've adopted Ruby for 99% of my coding needs. My experience sounds different to yours:

I started with plain C when PCs were so slow you needed a compiled language. When I moved from C to C++ in order to better write Windows applications, it was nice to have classes, constructors/destructors to make memory management easier, but the other stuff (eg. templating system and supplied hash/array/string classes) caused pain and I avoided it.

I was excited about Java. It seemed like a cleaner language for ex-C programmers to move to OO, but then I got really irritated when trying to actually use it for developing real applications, for all the reasons you mentioned.

I kept searching, dabbled with functional programming in Haskell, and happily used Perl for a long while until finally discovering Ruby.

To me, Ruby was like a Perl that really was more enjoyable to use. By that I mean I really value a system that quickly lets me express my thoughts and lets me get applications up and running faster. Often, well-written Ruby looks like pseudocode.

In my case, subconsciously the enjoyment factor of the language really was a stumbling block that slowed down my progress on my projects.

There have been no downsides. CPUs haven't stopped getting faster since my first steps in ASM/C 15 years ago, so I have no Ruby performance problem. Architectural changes that Ruby enables make it fun to write performant code.

Re:Why I Program In Ruby (And Maybe Why You Shouldn't) by Goladus on Saturday November 24, 2007 @09:41PM (#83270)
I agree that a language should be chosen primarily for the features that suit your needs. Expressiveness, stability, reliability, etc.

But within a given domain, there is often no clear choice which has the best features. This is especially true for Ruby, Python, and Perl. Some people are happy in the fires of CPAN hell, for example.