Live data from Hacker News

Ruby's exceptional creatures

exceptionalcreatures.com

121–130 of 133 posts

Re: Ruby's exceptional creatures

#121
post #41

Ruby is a good gateway to programming, better than C, C++, Java, Python,...

Better than Python? 15 years ago I would have agreed. Today, Python is a "gateway" to programming that is also the real thing. It's like one of those old languages designed for beginners to learn coding... and then you can continue to use the same language for your entire professional career as a software engineer, to build just about any production-ready application. Ruby is a beautiful language, but unless you are…

"not a very practical language to build something in"

You mean something like Shopify, Stripe or Github? So switch to Python instead so you can be constrained by single-line lambdas and a runtime that performs almost exactly the same as Ruby?

Re: Ruby's exceptional creatures

#122
post #82
post #68

Earlier quoted context omitted.

How often do you see people describe that kind of passion for Python? Maybe for lisps, Erlang, Haskell, Smalltalk. It may well put some people off, that's fine, but personally I dread it when I have to work with languages that don't instill that kind of passion. There are plenty of things I'd like to be different about Ruby and the tooling, but with Ruby I feel like I'm crafting something that at least has the potent…

At least when I was learning Python (which admittedly is over a decade ago at this point), there was a lot of that passion for Python and what made it great - you'd get things like the Zen of Python quoted, there was the "import antigravity" XKCD comic, a lot was made of things being "pythonic" and "for humans". I think the major reason for cultural change is that there's fewer people learning programming for fun, an…

Don't underestimate Perl's influence on Ruby and its community. Larry Wall's TIMTOWTDI (There Is More Than One Way To Do It) is the essence of what differentiates Perl and Ruby from Python and why creatives tend to gravitate to Ruby. You don't build a creative community on the principle of there being only on way to do something.

Re: Ruby's exceptional creatures

#123
post #105

Earlier quoted context omitted.

I think Ruby is polarizing. It is the only language I have used that I feel a genuine dislike for. Other people I have talked to feel the same. Then there is a group who loves it.

For me that language is Python (well, and x86 assembler). Python just feels fundamentally inelegant and messy to me, in a way that makes it tedious to read and write. I'll work on it if I must, but thankfully I rarely must.

Agreed. Python is the VHS of programming languages.

Re: Ruby's exceptional creatures

#124
post #40
post #28

Earlier quoted context omitted.

Where other languages have footguns, I've often described Ruby as offering footchainsaws, while tempting you to juggle them for fun. Far more damaging if you aim it at the wrong thing, but also far better at cutting down things that stand in your way. I think it's the most enjoyable language I've used. With care and feeding it's amazing. I would absolutely not want to use it in a large company, that would be a walkin…

Yes, I want to highlight what you say about large companies. ruby really shines, I think, if you are a solo dev or a small team, where everybody is on the same page and the codebase is completely understood. It is also good for libraries with a clear focus. For larger projects, it might work too, but you would need some good culture of "keep it simple" around it. A few ego-trips of supposedly smart devs and things ca…

Here we go again with the Ruby isn't suitable for large projects nonsense. Github, Shopify and Stripe seem to be managing perfectly fine with Ruby, thank you very much.

Re: Ruby's exceptional creatures

#125
post #72

Earlier quoted context omitted.

I definitely prefer Clojure/Elixir-style macros to Ruby’s meta-programming features. They’re still better than nothing, though. Method-mossing and friends played a critical role in making a framework like Rails possible in Ruby. In contrast, languages like Python and JavaScript just aren’t quite expressive enough to do it. A lot of energy went into attempts over the years, too! At best, something like Sails could get…

python has `__getattr__` (and a lot of other dunder magic), what is still missing? With named arguments and (kw)args, there is even more ergonomic magic I think. And django's orm also has similar magical abilities as activerecord. I think a lot of the metaprogramming abilities Python has are just used less often than in Ruby. Not because it is less expressive, but because it has a culture of simplicity whereas brevit…

No, Python is much less expressive at the pure language level. Ruby is better designed for composability. It's the Lisp influence. Python completely lacks the Lisp, Smalltalk & Perl heritage which makes Ruby a really great language. Python lacks culture.

Re: Ruby's exceptional creatures

#126
post #77

It's painful to see method_missing called out as a first class solution in the first creature https://www.exceptionalcreatures.com/bestiary/NoMethodError.... . "Practical Ruby" has three chapters dedicated to method_missing. "define_method" is more common these days and also painful to see. Ruby gets a lot of criticism for embracing magic and indirection ("Ruby, the bad parts of Perl"). It has some good parts (no fun…

These days (years) I work mostly in Java and would love to have method_missing or define_method. Of course I can do everything I want without them, but it's not fun.

Kotlin would be a good Java-compatible alternative with its extension functions.

Re: Ruby's exceptional creatures

#127

I don't know what it is about Ruby that turns every HN thread that mentions it into a flame war about how it's not the perfect language. People don't do this with other languages. What gives?

There is a significant anti-Ruby sentiment in the tech industry right now, especially in certain fields like InfoSec, that is being pushed by a very vocal subset of the community. Whenever they see Ruby come up, they will try pushing the meme that Ruby is dead/dying/irrelevant and cite TIOBE; despite Ruby developers continuing to release new libraries, frameworks, and tooling. Or they will claim no popular websites use Ruby; apparently GitHub, LinkedIn, and AirBnB are not popular enough? Or claim MetaSploit is the only security tool written in Ruby; off the top of my head I can think of BeFF, CeWL, Evil-WinRM, and Ronin. Or claim no company uses or supports Ruby; GitHub, Shopify, Stripe all use and support Ruby. Or they will derail any positive discussion about Ruby into some intractable debate about Static vs Dynamic Typing, GC, interpretive languages, etc; even though many of the arguments against Ruby can equally be applied to Python, and yet there's no similar criticism of Python. It's really annoying and inconsistent.

Re: Ruby's exceptional creatures

#128

Earlier quoted context omitted.

What Django doesn’t have and will never have is router or testing DSLs that are similarly ergonomic as Rails’s. https://stackoverflow.com/questions/7079855/are-there-techni...

And thank goodness for that. It is impossible to reason about types in such monstrosities.

If when looking at the pile of regexes which is Django’s router, your thought is “good, this way I can reason about types!”, then Ruby is definitely not the language for you.

Re: Ruby's exceptional creatures

#129

It's painful to see method_missing called out as a first class solution in the first creature https://www.exceptionalcreatures.com/bestiary/NoMethodError.... . "Practical Ruby" has three chapters dedicated to method_missing. "define_method" is more common these days and also painful to see. Ruby gets a lot of criticism for embracing magic and indirection ("Ruby, the bad parts of Perl"). It has some good parts (no fun…

"but the ecosystem is the biggest problem by promoting magic."

This argument isn't entirely true anymore. The Ruby ecosystem has mostly moved away from meta-programming, and embraced classical OOP. Rubyists now tend to avoid `method_missing` and `const_missing` when possible, and abandoned the craze of making everything a DSL. The most meta-programming that Rubyists still use on a regular basis is defining `self.included` on modules in order to inject other modules. Also, Rubyists have embraced API documentation, such as YARD, in order to document and communicate any "magic" that might exist or occur.

Re: Ruby's exceptional creatures

#130
post #76

Earlier quoted context omitted.

That's what I thought as well. If someone's opening metaclasses to define singleton methods they probably know all about the Ruby object model. I don't see how it could be done "without knowing you're doing so".

The people who did it first did understand the meta model. Unfortunately some people started following without full understanding. I wasn't at forefront of things back then, so I only noticed when the people who did know better started to writing about abuse of this technique.

[deleted]
Post reply on HN