Live data from Hacker News

Happy Birthday, Ruby

github.com

41–50 of 239 posts

Re: Happy Birthday, Ruby

#41

> > Matz is clever so we can all feel a little smarter, too. > (OK, I just made that up) I liked it :).

Careful, Oscar Wilde said something like (can't find the exact quote) "I always feel smarter after listening to you." It wasn't a compliment.

Re: Happy Birthday, Ruby

#42
post #38

Earlier quoted context omitted.

I'm not sure what language would be more beautiful than ruby, to be honest, and it's not even my favorite language to use. Let's do a mini code challenge in the thread -- implement fizzbuzz in the most beautiful way you can, in the most beautiful language you know:

One liner side-channel attacks free/Java: public static void main(String[] a) { for(int n=0; n++ >> 31 ^1 | -n%5 >>> 30&2 ^ 2]); }

I think the above snippet is a great example of how code can be ugly.

Re: Happy Birthday, Ruby

#43
post #16

Ruby is the very least favorite of all the programming languages I've had to use regularly over my career. Its syntax strongly favors cuteness over familiarity. Wherever Ruby can diverge from expectations to give you a pointless little tickle of whimsical inventiveness instead, it seems to do so. Visually it looks like an unwanted love child of Pascal and Python. There's no clear rhyme or reason to the use of sigils…

I wholeheartedly agree. My main gripe is that people insist Ruby is 'easy', because it 'looks just like English'. Yeah, well, it doesn't.

Programming languages are different from normal languages because they have different goals, different users and different requirements. The result in of this forced unification in Rails is something that resembles English, if you squint really hard, but in order to do so, it uses a massive amount of non-intuitive assumptions (sorry: conventions) that I as a programmer somehow should know. This makes debugging unnecessary hard. Also, when developing new features I'm constant guessing whether I should this or that form. The only way to find out is trying things out. This is fun as a hobby, but irritating when you're on the clock.

The idea that a programing language can be unified with a normal language is offensive to me both as a programmer and as a writer. They only benefit is that people who are not programmers can dabble around and still make something useful. Which isn't nothing, but not for someone who programs professionally.

Re: Happy Birthday, Ruby

#44
> Ruby changed my life. Ruby gave me a whole new way of looking at things, and a whole new set of friends.

Matz himself said something similar about Emacs / Lisp [1]:

> Emacs made me realize anything can be changed by a programmer...Emacs taught me freedom for software...Emacs has changed my life

[1] http://ergoemacs.org/emacs/Matz_Ruby_how_emacs_changed_my_li...

Re: Happy Birthday, Ruby

#45
After getting tired of Java's verbosity in 2008, I switched to a Ruby job, where I was fortunate to work with an incredibly talented developer and Ruby expert. It was a joy coding in Ruby after 4 years of Java and XML.

After that, I moved to Groovy, which seemed like a nice middle ground between Ruby and Java, or as I called it at the time: Java as it should have been.

I don't hear much about Ruby and Groovy lately, and while I focused more on front-end development, my back-end work rolled back into Java, which, I admit, has gotten slightly less painful with Java 8. At least in some ways; in other ways, it's just become an even bigger mess where some parts are sensible while other parts are dragging the weight of decades of poor choices with them.

I hear Kotlin is nice, though.

My Ruby skills have gotten a bit stale, sadly. The last thing I did with it was in 2013 I think, when I ran into trouble with Ruby's handling of unicode.

Re: Happy Birthday, Ruby

#46
post #34

Earlier quoted context omitted.

Whimsical inventiveness is the one thing that keeps me enjoying the art of programming. There's a tension in programming between being verbosity and ingenuity. More flexible languages and programmers general favor ingenuity, while rigid ones favor verbosity. When people complain about the "magic" in Rails, it's usually because it's a pattern that is new to them, and they would have preferred an older pattern even if…

> "Whimsical inventiveness is the one thing that keeps me enjoying the art of programming." A personality difference then. Reading clever code does nothing for me. I'm much happier digging around hulking layered codebases that may look ugly but do something valuable for the user. I agree that the cuteness of a programming language is just a matter of taste and habit. I'm not going to pretend my criticism was anything…

I think there's more to it. Ruby, to me at least, seems objectively more difficult to understand intuitively when scanning the code. Maybe it's just a superficial lack of knowledge on my part, but my brain makes base assumptions on how code should work, and whenever something magical happens, it's cool, but slows down the cognitive understanding enough that it seems to me to be a net negative. There's a crossover point where verbosness becomes too much to grok as well. Maybe spending more time in the language raises the bar enough to then become massively more productive. I'm assuming this is the case with Ruby, but I've not given it enough time to make that determination. Python, on the other hand, is immediately understandable to me, and I can jump in and be productive with no previous experience in the language and just an open webpage to the documentation. To each their own, but this is a continuing question for me. The perfect example I think is Perl 6. To me, when I look at everything they're doing in Perl 6, it really does look like the next generation in languages. It's got so many good ideas and insanely helpful constructs. However I'm not so sure if the ability to do things cleverly is a benefit. I look back at Python and see how simple it is and how productive I can be in it immediately and ask myself.. what's the catch. I'd like to use these complex languages for fun's sake, but the alternative is very, very, intuitive.

Re: Happy Birthday, Ruby

#47

Earlier quoted context omitted.

> having two distinctly different types of strings You must be talking about Python 2, the deprecated version for 12 years now, with support ending next year. Because last time I checked, current, modern Python only has one type of string.

Try passing a std::string in from C/C++ code. It treats it as a byte string, which you have to prepend with 'b', and Python 3 will not do any nice casting under the hood back and forth between the two types. Sure, I am picking out one particular use case, but it isn't uncommon to wrap C code in python scripts to mung data going in and out of it. You are right though. String manipulation does appear to be easier than…

You need to use `Py_BuildValue` with the `s` argument to get that into a python string.

Re: Happy Birthday, Ruby

#48
post #16

Ruby is the very least favorite of all the programming languages I've had to use regularly over my career. Its syntax strongly favors cuteness over familiarity. Wherever Ruby can diverge from expectations to give you a pointless little tickle of whimsical inventiveness instead, it seems to do so. Visually it looks like an unwanted love child of Pascal and Python. There's no clear rhyme or reason to the use of sigils…

I don't understand your bit about "cuteness over familiarity". Can you give an example outside that's not Rails-related (given that Rails seems to be the main source of your concrete complaints)?

Sigils in Ruby actually do have strong and clear meanings. And the difference between symbols and strings is a useful distinction. And contrary to your statement, Ruby's stdlib is far more complete and more internally consistent than what you get from Perl or Python, so I'm not sure what your beef is with that.

It's fair not to like particular decisions a language has made, but from what you say, I'm not getting the sense that you understand the decisions Ruby has made well enough to criticize them effectively. Again, it seems like your experience was colored heavily by Rails, and fair enough if that's the case. But stick to criticizing the actual source of your problems.

Re: Happy Birthday, Ruby

#49

I'm currently working on a Ruby project, and I love the language so much! It's elegant, fast enough for me, and the ecosystem rocks. It seems that, after Ruby borrowed from many previous languages, a lot of rubyisms went into Rust (the nice functional-style enumerations, the awesome package manager inspired by Bundler). And I'm thrilled the best of the Ruby world found its way into other languages. A future where the…

Wouldn't Crystal fit the bill for a fast compiled language explicitly designed to emulate Ruby's syntax? (I don't have any significant Ruby or Crystal experience, so if there are reasons why that doesn't fit the bill, I'm sorry)

I've only given Crystal a cursory look in the past and I think I'd enjoy working with it but can't speak to whether I'd feel as comfortable and productive as with Ruby (maybe I would). But what I do know is that you would not have the vast amount of Ruby gems available to your project, so if you feel the need for those as I often do then you might find it a bit more slow-going.

Re: Happy Birthday, Ruby

#50
post #43
post #16

Ruby is the very least favorite of all the programming languages I've had to use regularly over my career. Its syntax strongly favors cuteness over familiarity. Wherever Ruby can diverge from expectations to give you a pointless little tickle of whimsical inventiveness instead, it seems to do so. Visually it looks like an unwanted love child of Pascal and Python. There's no clear rhyme or reason to the use of sigils…

I wholeheartedly agree. My main gripe is that people insist Ruby is 'easy', because it 'looks just like English'. Yeah, well, it doesn't. Programming languages are different from normal languages because they have different goals, different users and different requirements. The result in of this forced unification in Rails is something that resembles English, if you squint really hard, but in order to do so, it uses…

I've never heard anyone say Ruby "looks just like English". Do you have a source?
Post reply on HN