Live data from Hacker News

Happy Birthday, Ruby

github.com

71–80 of 239 posts

Re: Happy Birthday, Ruby

#72
post #39

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…

Check out Crystal - Its statically typed, compiled, and a near one to one implementation of Ruby. https://crystal-lang.org

Is it backwards compatible with Ruby?

Re: Happy Birthday, Ruby

#73
post #15

Earlier quoted context omitted.

Sounds like a question for Code Golf[1] :) [1] https://codegolf.stackexchange.com Off-topic, take a look at "Add a language to Polyglot" which was concluded at 194 languages, but people kept adding more: https://codegolf.stackexchange.com/questions/102370/add-a-la...

Let's not forget about immortal RosettaCode: http://www.rosettacode.org/wiki/FizzBuzz

One interesting thing about this set of solutions is that many of the languages seem to use a pattern-matching approach (e.g. Elixir, F#, Rust, others, IIRC). As a result, having been reading about pattern-matching recently (in F# and OCaml), I was able to understand the gist of the solutions in those languages, although I did not know those languages well or even somewhat, in some cases. Of course, this is for FizzBuzz, for which the logic is easy, which makes it easy to make guesses about how the code works (for many languages at least).

Re: Happy Birthday, Ruby

#75

Earlier quoted context omitted.

>There's no clear rhyme or reason to the use of sigils and keywords. You have trouble with the use of sigils in Ruby? That seems like an odd complaint. I would have expected you to complain more about MINWAN.

googling "ruby MINWAN" yields a bunch of floor-waxing results, and also your comment. it does not actually help me find out what MINWAN is supposed to mean.

Should be MINSWAN - Matz Is Nice So We Are Nice

Re: Happy Birthday, Ruby

#76

There is one thing I really dislike about Ruby (and other languages like Scala that have the same feature), and it's non-parenthetical function invocation. I get that it's good for writing DSLs and similar endeavors, and you're only supposed to use them where its implicit what you're doing, but in my opinion, it really hurts readability (though Scala is much worse when it comes to flexible yet opaque syntax).

Unfortunately you really can't get the refactoring capabilities without being able to substitute a method for a local variable transparently, which is extremely useful over the long run.

Re: Happy Birthday, Ruby

#77
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 think you need to share your favorite programming languages so that we know the type of language you are biased towards, and why you might dislike ruby.

Re: Happy Birthday, Ruby

#78
Ruby's bare word syntax, while sometimes clunky, is usually nice to read. Other than that, Ruby is a stain on software engineering. If you have the choice, don't make it your first language! Ruby has the most fundamental flaws of any of the scripting languages.

Re: Happy Birthday, Ruby

#79
post #68

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:

By coincidence, I had just posted this earlier and updated it recently: print(" ".join("FizzBuzz" if i % 15 == 0 \ else "Buzz" if i % 5 == 0 else "Fizz" if i % 3 == 0 \ else str(i) for i in range(1, 101))) From: FizzBuzz in Python with nested conditional expressions and a generator expression: https://jugad2.blogspot.com/2018/12/fizzbuzz-in-python-with-... Not claiming its the best in any way, just a way that I thoug…

He asked for beautiful. Like if you showed it to a non-programmer, would they think it's beautiful?

Re: Happy Birthday, Ruby

#80
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 consis…

Yes, maybe my problem is more with Rails. (Because of monkeypatched APIs, it’s not always obvious to me whether a particular weirdness originates from Ruby’s standard library or is a Rails addition. Arguably this is something the language has also encouraged though.)

Is there any reason to use Ruby outside Rails? Its niche seems to completely overlap with Python and modern JavaScript, and those have enormously more ecosystem support and everything that comes along with it: faster VMs, better tooling, large corporations on committees developing language features, etc.

I view Ruby as a sort of “COBOL of Web 2.0”. A generation of programmers learned the trade with it, and it powers important legacy apps, but I can’t imagine building anything new on it.

Post reply on HN