4 ms·
There are just too many ways to do things in Ruby. How many forms for an if-else or for loopin can you name in Ruby? Just as the simplest example. Monkeypatchi
by skeletal88 3y ago
There are just too many ways to do things in Ruby. How many forms for an if-else or for loopin can you name in Ruby? Just as the simplest example.
Monkeypatching is also awful for readability.
Explicit imports are way more readable than things appearing into current namespace implicit kind of stuff like it happens with Ruby
- aae42 3y agoI've been writing Ruby daily for years and never written a `for` loop
- stouset 3y agoStarted Ruby in 2007 and have used it professionally essentially nonstop. I have also never written or seen a for loop. I don’t even think I could correctly guess the syntax of it.
- BobbyJo 3y agoPython fixtures anyone?
- nextos 3y ago> There are just too many ways to do things in Ruby I think this is not completely true. Ruby is conceptually very simple. It's not C++ or Perl. Everything is an object, and everything is done through method calls. There is also extensive support for functional programming, so iteration is performed via filter/map/reduce and similar high order functions. Besides, the block/proc/lambda design makes it easy to turn APIs into DSLs. For those reasons, Ruby gives the closest experience to programming with Scheme I have ever experienced outside the Lisp world.
- twobitshifter 3y agoMonkeypatching exists in both ruby and Python.
- nijave 3y agoIt does but it's generally considered a bad practice in Python (and many other languages) and a feature in Ruby.
- sodapopcan 3y agoTwo: `for` and `each`. Most people use `each`.