News for hackers. Stuff that matters.
Re:Ruby's Exceptional Creatures by AlchemistCamp on Sunday January 28, 2024 @10:31PM (#39172405)
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 2/3 off the way there and offer significant advantages on another axis, like making websockets first class.

Re:Ruby's Exceptional Creatures by Lutger on Monday January 29, 2024 @04:40AM (#39174476)
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 brevity and generality are more valued in Ruby (Rails) culture.

Re:Ruby's Exceptional Creatures by AlchemistCamp on Monday January 29, 2024 @09:03AM (#39176342)
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...

Re:Ruby's Exceptional Creatures by empthought on Monday January 29, 2024 @08:17PM (#39185176)
And thank goodness for that. It is impossible to reason about types in such monstrosities.
Re:Ruby's Exceptional Creatures by AlchemistCamp on Monday January 29, 2024 @11:22PM (#39186371)
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 by empthought on Tuesday January 30, 2024 @07:00AM (#39189084)
No, I just implement a custom router class as the docs suggest, and move on with my life. It’s a much better use of my time than fighting mental-masturbation DSLs.
Re:Ruby's Exceptional Creatures by cutler on Monday January 29, 2024 @10:10PM (#39185975)
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.