4 ms·
Not just visually. It is also conceptually much more aesthetically pleasant. I still don't know how metaclasses, descriptors, __magic__ methods, multiple inheri
by _qc3o 10y ago
Not just visually. It is also conceptually much more aesthetically pleasant. I still don't know how metaclasses, descriptors, __magic__ methods, multiple inheritance, all the different string formatting schemes, generators/co-routines, etc. work in Python. The amount of stuff you have to learn in Python is a lot more than in Ruby.
- LyndsySimon 10y ago> The amount of stuff you have to learn in Python is a lot more than in Ruby. I couldn't disagree more with this. Python is pretty thin when you get down to it. Magic methods alone are 80% of the way to knowing how everything in Python works. Multiple inheritance in Python is way simpler than the two-pronged inheritance scheme of Ruby, where you have both a parent class and modules (which can be loaded either before or after the parent class) to deal with. Want to see what order ancestor classes are applied? `object.__class__.__mro__`. Done. Meawhile, in Ruby, you can call a function like this - `my_function(a, foo: 1, bar:2)` - and it feels like you're passing keyword parameters... but Ruby doesn't support keyword parameters. Instead, it's implicitly creating a Hash that's getting passed as the second parameter. Even more confusing, every function has an implicit "block" parameter that can be passed to it, and is silently ignored by default.
- dkarapetyan 10y agoRuby has had keyword arguments for a while now: https://robots.thoughtbot.com/ruby-2-keyword-arguments https://robots.thoughtbot.com/ruby-2-keyword-arguments
- LyndsySimon 10y agoInteresting - I remember reading a proposal for this, but I've never seen them in production code.
- mercer 10y agoIt's odd... I have relatively little Ruby or Python experience, but I have a kind of undefined affection for Ruby but if I'd have to choice at gunpoint I'd go for Python. I think the reason is that while Ruby does feel more 'pleasant' to me, especially the me that is new to programming, Python feels less vague, and I've grown to hate vagueness in my code. I'd probably recommend Python to new coders at this point, but for web development I would probably still opt for Ruby on account of Rails and the Rails Tutorial. If there was an equivalent to the latter, I'd go for Python though (suggestions?).
- adambrenecki 10y agoI can't vouch for it myself, but the Django Girls tutorial [1] is the resource I hear recommended most often for learning Django without any prior programming experience. [1]: https://tutorial.djangogirls.org/en/ https://tutorial.djangogirls.org/en/
- ixil 10y agoIt seems strange, why do you comment when you state you have no experience in Ruby or Python? Maybe leave the conversation to people who at least know one of the languages well.
- deleted 10y ago[deleted]
- dragonwriter 10y ago> .. but Ruby doesn't support keyword parameters Your information is outdated, and only applies to Ruby 1.x. Ruby added real keyword arguments in 2.0, and declaration of mandatory keyword arguments in 2.1.