Live data from Hacker News

Happy Birthday, Ruby

github.com

131–140 of 239 posts

Re: Happy Birthday, Ruby

#131
post #80

Earlier quoted context omitted.

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

I work with Ruby on the web, but rarely with Rails. Apart from the Ruby language itself -- which I love, even though I sympathize with those who don't -- I can't imagine giving up these two libraries by Jeremy Evans:

[Sequel](https://github.com/jeremyevans/sequel) - Sequel is the best ORM I've ever used, in any language. Fast, stable, unbelievably well maintained, and offers great low-level access to the database when you need it.

[Roda](http://roda.jeremyevans.net) - This dynamic routing library is conceptually similar to React Router, in that there is no static list of routes; routing is a function call. But it's faster than React on the server, and has better support for HTTP verb support, database I/O, etc.

As for there being "better tooling" in modern JS, I'm not sure I agree. Babel and ES6 are impressive, and I love writing the code they make possible. But I appreciate being able to write Ruby and know that it will just run. Writing packages for node means choosing one of two incompatible module systems, or adding transpiler bloat.

Re: Happy Birthday, Ruby

#132
All my accomplishment happen because of ruby. I've been unhappy and depress with java(2006-2010) and then I manage to move to ruby. And I totally like the language. I'm sad when people say python is more nicer, or the nicer and better language there. I've done python and I never find it appealing as ruby

Re: Happy Birthday, Ruby

#133
The decision to implement DSLs by overriding method_missing seems to have opened a can of worms and the community has never managed to put the lid back on. More than anything else, this is the thing that seems to cause no end of consternation with Rails. At the same time, it's pretty much the defining feature of Rails.

Re: Happy Birthday, Ruby

#134

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.

sound like a trump speech /s

Re: Happy Birthday, Ruby

#135
post #80

Earlier quoted context omitted.

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

I use it all the time (and have for at least 9 years now) as a general purpose scripting language. Like, stuff that I could do in bash, but if I do it in ruby it will be 10x more understandable and way more concise to boot.

Sure, I could also do the same stuff in perl or python, but personally I find ruby to be far more expressive.

Re: Happy Birthday, Ruby

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

    (1..100).map { |i| i.modulo(15).zero? && "FizzBuzz" || i.modulo(3).zero? && "Fizz" || i.modulo(5).zero? && "Buzz" || i }

Re: Happy Birthday, Ruby

#137
post #91

Earlier quoted context omitted.

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…

Do you have any experience with Django? I haven't used rails myself, but I'm told they are very similar in the "look at what I'm not doing" regard.

As somebody who was a Rubyist for about a decade but has worked at a Django shop for several years now, I definitely see how they're similar, but I don't think Django is clearly the better of the two. Django is simultaneously less helpful (you have to do more things explicitly, such as specifying routes) and less flexible (for one example, Django doesn't have a public query builder and doesn't have a replaceable ORM — you're basically stuck with either the built-in ORM methods or SQL strings).

For me personally, Rails is the best web framework I've seen — but in an age when static typing and other static guarantees are increasingly popular, Ruby as a language is not what people want. It's an artifact of the old Lisp and Smalltalk school of thought.

Re: Happy Birthday, Ruby

#138
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

> a near one to one implementation of Ruby

This isn't the case at all. It has completely different semantics (for good reasons).

Re: Happy Birthday, Ruby

#139

Earlier quoted context omitted.

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…

So...eh. Ruby has the easiest data access tools, between ActiveRecord and Sequel (which I prefer), out there. I don't know too many folks who'd disagree with you about that. But where you're happy with Rails taking a few lines, I am as of late big on Kotlin (because I agree with you regarding Java) encouraging me to be correct . I'm building a new product using Spring Boot, Kotlin, and JDBI and while, yes, there's bo…

The problem with boilerplate is not the typing of it (that can be automated), but the reading of it (that can't really be automated until programmers are replaced with AI). It hides semantically useful code in mountains of noise.

I agree with you about the usefulness of a language that helps in thinking about a problem, but I feel like boilerplate is a kind of tech debt we tend to underrate.

Re: Happy Birthday, Ruby

#140
post #101

Earlier quoted context omitted.

You are right, but aren't really attacking the point I was making. Even with totally optimized sql, one language's ORM will be inherently slower than another due to the intrisics of how the records being operated on are represented in that particular language. In Rails's case, EVERY single record pulled out of a database gets its own object. There is overhead to being able to represent table members from a relational…

That is why we have pluck

Exactly. Use pluck, use exists, use count, use find_in_batches. Be thoughtful and have a culture of code reviews. Simple enough.
Post reply on HN