Live data from Hacker News

Happy Birthday, Ruby

github.com

81–90 of 239 posts

Re: Happy Birthday, Ruby

#81
post #3

> Ruby isn't the most beautiful language out there Huh, I sure think it is. I wonder what the author thinks the competition might be? Ruby has its issues for sure, but aesthetics ain't one of them - far and away my favourite out of any major language.

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:

coffeescript (ruby-inspired):

  ['fizz' unless i%3] + ['buzz' unless i%5] or i for i in [1..100]

Re: Happy Birthday, Ruby

#82
post #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,…

Java may suck to some, but it pays huge chunk of corporate salaries. Although there is the best of both worlds: JRuby! Scripting JMX and some heavy JDBC stuff with Ruby saved me so much time.

Re: Happy Birthday, Ruby

#83
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…

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 don't think these need to be at odds with each other. Just because code is useful doesn't mean it needs to be hard to read.

Re: Happy Birthday, Ruby

#84
Years ago, as a (traditional) designer trying to learn how to code, I spent what felt like an eternity trying to wrap my head around JavaScript. This was in the ES5 days. After a lot of effort I could usually do something approximating what I wanted, but there were a lot of stumbling blocks that got in the way of really understanding what was going on.

Once I learned Ruby, the fog parted and everything started making sense. Compared to JS, Ruby was transparent. Everything was just a bunch of objects sending messages back and forth to one another. The simplicity of defining classes and methods made it easy to think about how a program could model aspects of the real world – domain modeling, abstraction, etc. One early experiment I recall was using Ruby's built-in Enumerable and Comparable modules to represent a deck of playing cards in code (complete with > and Reading code written by others was much more straightforward (making it easy to learn from the masters), and writing extensions/plugins to existing tools to add features that I needed suddenly became feasible. Books like David Black's "The Well Grounded Rubyist" and Sandi Metz' "Practical Object Oriented Programming in Ruby" were great, accessible introductions to the art of programming.

I don't write much Ruby any more, but I'm in total agreement with Dave Thomas here. Ruby for me was the "royal road" into learning how to program, and it continues to inform the way I think and write code in other languages. As a non-CS person, I can't think of a more accessible way to learn about software development.

Re: Happy Birthday, Ruby

#85
post #3

> Ruby isn't the most beautiful language out there Huh, I sure think it is. I wonder what the author thinks the competition might be? Ruby has its issues for sure, but aesthetics ain't one of them - far and away my favourite out of any major language.

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:

ruby:

  1.upto(100) do |n|
    puts [ ("Fizz" if a = (n % 3).zero?), ("Buzz" if b = (n % 5).zero?), ( n unless (a || b) )].join
  end

Re: Happy Birthday, Ruby

#86
post #79
post #68

Earlier quoted context omitted.

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?

1. So what? It's not always that case that people on HN reply (or must do so) to a question with an answer that exactly answers the question and nothing else. Diversions are fine and done a lot by users here, within reason. Otherwise these threads would look and sound like classes in logic or theorem proving, ha ha. We're humans here.

2. Why are you interpreting what he (or she) meant? Let them do it themselves.

3. I qualified my earlier comment as saying that it is not necessarily the best way - up front.

4. Beauty is in the eye of the beholder, and beholders vary a lot in their tastes, whether programmers or non-programmers. Like the "de gustibus" quote:

https://en.wikipedia.org/wiki/De_gustibus_non_est_disputandu...

So chill, pal.

Re: Happy Birthday, Ruby

#87

"First appeared 1995; 24 years ago" Wikipedia who's right?

>The name "Ruby" originated during an online chat session between Matsumoto and Keiju Ishitsuka on February 24, 1993

>The first public release of Ruby 0.95 was announced on Japanese domestic newsgroups on December 21, 1995

Re: Happy Birthday, Ruby

#88

Earlier quoted context omitted.

> Its syntax strongly favors cuteness over familiarity. Funny, I recently made a stack switch from Ruby to Python, and I had the exact opposite impression. Ruby coding style/syntax tends to favor convention over configuration (at least in terms of Rails setup), while Python to me seems less so. Ruby also seems to me a bit more consistent across it's versions. One of the biggest gripes I've had about Python so far is…

> 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.

The problem is that "modern python" really includes Python 2 in addition to 3. You can't practically ignore it the way you can ignore ruby 1.x. Yes, things are very slowly moving to python 3, but there is a reason most systems have python 2 and python 3 and even now it isn't uncommon for /usr/bin/python be python 2.

Re: Happy Birthday, Ruby

#89

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…

I think we've arrived at that future. With languages like Crystal, Rust, Groovy, and Elixir, you can get some of the same powers that Ruby bestows upon you in other environments like a statically compiled binary, the JVM, or the Erlang runtime (with it's lovely OTP framework). I even see JavaScript taking on some Ruby-like characteristics these days.

Agreed. I feel that ES6 is very ruby-like with the functional programming parts. I'm also very happy about Groovy, Elixir, and other languages that are Ruby-inspired.

Re: Happy Birthday, Ruby

#90
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…

Early in my career, I only "knew" a little C++ from a high school programming class I had taken, and I knew a tiny bit about Java.

Then I found Ruby, and people talked very highly of it. But it had all these "Gems", I couldn't figure out what a Gem was. I didn't know enough. I thought it was like a compiler plugin or something. I thought that just like there were different versions of Java, there were different versions of Ruby called Gems.

Then I found Python, it had "libraries", I knew what a library was, it was something you could download and use in your code. I learned Python and liked it a lot. If Ruby had "libraries" instead of "Gems" I would have learned Ruby instead since I was exposed to it first.

Post reply on HN