6 ms·
Ruby Is The Future
- ankhmoop 18y agoThe author claims that monkey-patching private methods to expose them publicly is representative of Ruby's beauty, and specifically: "... later upgrades to the library don’t need to be re-fixed: the one-time patch will automatically get re-applied by application code automatically!" Anyone who fails to realize how monkey-patching can and will break both subtly and catastrophically across library upgrades has no business advising anyone regarding language choices. [Edit] I hate April Fool's Day. Depressingly, the author's satire is so subtly aligned with common arguments as to so thoroughly fool.
- ansin 18y agoJust because it's a satire doesn't mean the title in incorrect. I would argue that Ruby is, in fact, the future for the same reason that Python is the future. As for monkey patching, yes, it's ill-advised in general just as global scope and gotos are ill-advised for similar reasons. However, monkey patching is a powerful feature if used responsibly as Chad Fowler has noted ("The Virtues of Monkey Patching"): http://chadfowler.com/index.cgi/Computing/Programming/Ruby/TheVirtuesOfMonkeyPatching.rdoc,v http://chadfowler.com/index.cgi/Computing/Programming/Ruby/T... Now admittedly, not every programmer is as competent or responsible as Chad Fowler or the programming world would be a very different place but the point is there's a right way and a wrong way to do it. Werner Schuster's article on InfoQ ("Ruby's Open Classes - Or: How Not To Patch Like A Monkey") has more good advice on how to do it the right way: http://www.infoq.com/articles/ruby-open-classes-monkeypatching http://www.infoq.com/articles/ruby-open-classes-monkeypatchi...
- ankhmoop 18y agoAs noted in Werner Schuster's article, many languages (such as C# or Scala) do support type-safe, non-ambiguous, non-conflicting extension of existing classes, demonstrating that extension of existing classes can be safely implemented and does not require the use of dangerous monkey-patching.
- jshen 18y agodealing with the type system in scala can be a pain and is a hit to productivity in the early stages. The question is if the hit in the early stages leads to more productivity in the later stages. I'm not convinced that it does. I've done a lot of ruby, and I've had monkey patching bite me a few times. However, fixing the problem was never that hard (two days max) and is clearly overshadowed by the productivity gained from the power ruby gave my teams.
- ankhmoop 18y agoHow can one effectively argue against an entirely subjective judgment of difficulty in terms of dealing with a type system? Anecdotally, I find that leveraging functional language programming features coupled with type inference and polymorphism leads to considerable productivity gains as code correctness can be ensured through judicious use of types -- without requiring extensive testing or programmer effort -- while excess verbosity can be eliminated through the use of FP features such as type-safe anonymous functions, currying, etc.
- ansin 18y agoHow do you deal with excess verbosity in C#? I know this is a separate argument from the monkey patching issue but for me the conciseness and elegance of the Ruby syntax versus C# is the primary reason to choose Ruby.
- ankhmoop 18y agoHopefully a user of C# will chime in -- I've spent very little time with it, and only recently evaluated C#'s extension mechanism for the purpose of comparing it against other language's implementations. That said, elegant and concise syntax does not require eschewing an internally consistent, fully specified type system -- the two are not incompatible, as demonstrated (subjectively) -- by many existing FP languages. I argue that elegance/conciseness requires either FP language features and advanced type system, or abandonment of rigorous typing.
- 18y ago
- Xichekolas 18y agoYeah I looked at the headline and the url next to it and did a doubletake. When I see enfranchisedmind.com I immediately think: OCaml!
- plaes 18y agoJust two words: "Hopefully not..."
- ansin 18y agoWhy? Because of monkey patching, syntax, performance, the community or some other reason such as you prefer Python or have an intuitive, ineffable and unexpressable disklike of the language or because Matz is from Japan and they bombed Pearl Harbor?
- nir 18y agoI think (and I mostly code Ruby these days) it's not least because of comments like this.
- deleted 18y ago[deleted]
- ansin 18y agoOut of curiosity, what has your experience been like? Do you have any major gripes with the language or are you still on a Ruby honeymoon?
- nir 18y agoI love Ruby. I love that code can be so short and yet easily readable. It might be slower and perhaps more memory-hungry than other languages, but for my needs that's usually not an issue. What I do miss are good, well documented, stable libraries. For example, I currently process RSS/Atom feeds with FeedTools, whose own creator says he's tired of maintaining (I totally understand him and am extremely thankful for the time he put into it). I assume if there were more people coding Ruby, there would be a better chance someone would step up and take his place. So, having a community that is more welcoming to newcomers would eventually benefit us all. By "open to newcomers" I don't mean that Ruby-celebs should stop posting snarky comments at each other in their blogs. This is pretty negilible. I mean stuff like having better documentation, for example, online, free, in googleable format (rather than screencasts or print books). IMHO PHP3 annotated online docs back in 1999 were significantly more usable than what Rails has to offer now.
- neilo 18y agoI'm going to dig through HN archives or wait until tomorrow to read any news.
- petercooper 18y agomartoo on the equivalent Reddit post had the best thing to say about this: "There needs to be a special term for an attempt at an April Fool's Day Joke, which is in all of its points true and then ends up looking like a joke made by an author at his own expense." http://www.reddit.com/r/ruby/comments/8966h/ruby_is_the_future/ http://www.reddit.com/r/ruby/comments/8966h/ruby_is_the_futu...