Live data from Hacker News

Happy Birthday, Ruby

github.com

61–70 of 239 posts

Re: Happy Birthday, Ruby

#61

Earlier quoted context omitted.

I agree with the other poster who says it's mature, not in decline (so maybe that's boring to the crowd that likes to always hop to the latest tech). Basically most of the kinks have been fixed and desired features have been added, and now it's about gradual improvements and adding new functionality as it comes. Students also commonly learn Python and Javascript in college and are probably more active on social media…

> It used to get accused of scaling poorly, but tell that to Github, Gitlab, and other large-scale sites with millions of users. I've worked on one such large-scale enterprise-level web app, and it really does scale poorly in some areas, specifically database management. ActiveRecord tends to get extremely expensive when db's take on large amounts of records and complex relationships start forming between those large…

Isn't this true of any language? I mean the language isn't what decides how you connect or build your sql queries? In rails I could choose to write a pretty scary join

```

   User.joins("left join ponies on ponies.user_id IN (select id from foobars where user_id=users.id").group("so_funny").count

```

or I could have a policy to avoid joins at all cost and reject any commit that uses a join and get fun things like:

```

   users = User.all # all fucking hell

   JSON.parse(HTTP.get("http://your-things.json"))['results'].select {|r| 

  users.detect {|u| u.id == r['user_id'] } # for realz??
 }


```

[edit]: cause formatting

Re: Happy Birthday, Ruby

#62
post #20

Earlier quoted context omitted.

"pluralizing words in your database migrations" is ispired by convention over configuration pattern, and comes from an age where there weren't almost any standard rules, even table names were some singular, some plurals, some ALL_UPCASED, some all_downcased, some MiXeD, some dash-erized, some camel_ized, ... I come from that age and it helped a lot.

pluralization seems to be somewhat orthogonal to the "no standards" issue you raise; one could have introduced standard rules to help with that 'wild west' and still left out pluralization. pluralization brings with it runtime overhead and edge cases (which can be dealt with with more runtime overhead, of course).

I'm curious, where does pluralization of table names bring runtime overhead? AFAIK, they are stored in the model and not generated every time they are needed.

Re: Happy Birthday, Ruby

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

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

Re: Happy Birthday, Ruby

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

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

Just be happy you’re not coding is Haskell. That thing has like 20 string types.

Re: Happy Birthday, Ruby

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

So, I'm old, and have done lots of stuff in lots of languages in frameworks. For about a dozen years, Rails was my go-to toolkit. I've written a couple dozen production applications with it. Unfortunately, Rails has really fallen out of favor lately. Even a Rails-specialty shop I worked for briefly has pivoted to using ASP.NET. I've played around in that stack, and found it lacking. (EF just doesn't compete as an ORM.) However, they've moved on to bigger corporate customers, and those places just don't use Rails.

Recently, and because of this same we-don't-"do"-Rails sentiment, I was forced into using Java for a web application. So I prototyped a site with Spring and Angular 6, thinking this -- arguably -- represents the "state of the art" when doing a Java web app. Out of frustration, I also cranked up a prototype with Rails. What was taking me literally 160 lines of Java and JS, to build two related models and a form to edit the relationship, took me 3 lines with Rails. Nothing else I've found allows me to be as productive as Rails for writing web applications.

I can understand criticizing Ruby for being clever. There are still magic tricks you can do with it I've never even tried to understand. I can understand criticizing Rails for being obscure. I realize that it took me MANY years to be REALLY effective with it. But if you're telling me the alternative for web applications is ANYTHING related to Java, I'll call you crazy.

I've just inherited a Laravel-based PHP site, which is so old I can't download the version of the framework it uses. Yikes. I did PHP for about 10 years, 20 years ago. It doesn't feel like a lot has changed.

So, I'm honestly asking, as someone who hates Rails: What framework, out there, somewhere, allows me to be as productive as Rails, but which is are "better," somehow?

Re: Happy Birthday, Ruby

#68
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:

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

Re: Happy Birthday, Ruby

#69

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.

Re: Happy Birthday, Ruby

#70
post #65

In July 2009 around Rails 2.1.2, I decided I'd be happy if I could write Ruby for a living for the rest of my life... So far so good!

Not out of any love of Java, but out of a depth of experience (I started coding with Java at v1.0.1), I used to say the same thing about Java. My advice...keep learning new languages to give yourself a decent range of job prospects.
Post reply on HN