3 ms·
I find Ruby to be more straightforward than Python. In isolation, I’d argue Ruby is greatly more readable and understandable than Python. In practice, Ruby cod
by kayodelycaon 4y ago
I find Ruby to be more straightforward than Python. In isolation, I’d argue Ruby is greatly more readable and understandable than Python.
In practice, Ruby code isn’t. Once someone starts doing advanced meta programming, get the shovel, because you’re going to kill whoever wrote it and need to bury the body.
Rails largely gets away with this by having opinionated design, good documentation, and a large user base who have already written answers to your questions.
- hangonhn 4y agoThat really mirrors my experience as well. Ruby is a very consistent language but I think one of the things people get really enamored with Ruby is the meta programming -- myself included and soon you're going to need a bunch of context in your head to understand all the "magic" that's happening.
- tmm84 4y agoI feel this comment so much. Having never done Ruby programming and was given a task from a client to work on a Ruby project. I didn't think much at the time because having dealt with all kinds of programming challenges I was confident in taking it on. Much to my surprise the amount of "magic" methods, meta-programming and anonymous classes in the source code required a lot of hand holding from the devs who had been working on it from the start to teach me how to find/read and debug everything the "Ruby" way.
- chrisallenlane 4y ago> required a lot of hand holding from the devs who had been working on it from the start to teach me how to find/read and debug everything the "Ruby" way. Yes. And even just _finding_ relevant bits of code is difficult and painful, because you can't simply `grep` for the names of these metaprogrammed methods. They're simply not in the codebase.
- projectazorian 4y ago> Once someone starts doing advanced meta programming, get the shovel, because you’re going to kill whoever wrote it and need to bury the body. Metaprogramming in application code is one of those trends I'm glad is behind us. Might look cool and work great initially, but a painful refactor is near inevitable once there's been some turnover on the team and the problem space shifts in a way that invalidates the underlying assumptions. Library code is another matter though.
- transfire 4y agoI think that misses the point. Ruby doesn’t have macros! The metaprogramming makes it possible to create very readable DSLs but it’s all very consistent not “magical” like macros. At the end of the day coding is hard. I’d rather have nice DSLs to learn than verbose spaghetti to read.
- kayodelycaon 4y agoAbsolutely. DSLs are a great application of metaprogramming. Same with libraries like ActiveRecord. Metaprogramming in a pull request at work? Nope. I'm going to smack some knuckles with a ruler. :)
- scruple 4y agoDepends. In library code? Great (probably). In application code? That's a paddlin'.
- toomanyrichies 4y agoI chuckle-snorted at the Simpsons reference. Thanks you for that.
- pessimizer 4y ago> Once someone starts doing advanced meta programming, get the shovel, because you’re going to kill whoever wrote it and need to bury the body. This is why Elixir makes me hate life sometimes. They took a language like Erlang where it seemed almost impossible to write an unreadable program even when it was doing very sophisticated things, and Rubied it up.