22 ms·
> Ruby is still great for throwing something together fast and maintaining it until it runs into scale problems. It added gradual typing with sorbet and RBS. I
by nextos 4y ago
> Ruby is still great for throwing something together fast and maintaining it until it runs into scale problems. It added gradual typing with sorbet and RBS.
I think Ruby is much better than Python for building large applications.
Ruby is essentially Smalltalk with a neat Algol-like syntax and some Perl-isms. Its OO system is a joy to work with.
Python got so popular in data-oriented applications because it's a really simple procedural language.
More importantly, it had the right libraries (NumPy, SciPy and Matplotlib) when Torch (implemented in Lua) was no longer viable (due to LuaJIT limitations).
- AdamN 4y agoThat's sort of outdated. Python now has type hints, protocol oriented programming support, and is quite fast (for what it is). This wasn't the case back in the day but it's all there now.
- anthonygd 4y agoPython might have nice features, but it also has terrible features. Like using dicts for everything. It's not enough to allow good practices, you have to prevent (or at least reduce) bad practices.
- gautamdivgi 4y agoYou can use dataclasses instead of dict now.
- ElectricalUnion 4y agoUnless you use __slots__, aren't all class-based objects [specifically python2 new style `class MyClass(object): pass` or all python3 classes] dicts in Python?
- gautamdivgi 4y agoI was talking about the dataclasses.dataclass annotation in 3.10/3.11. You can use slots with it. You’re right, they’re dicts unless slots are used. I read the parent comment and saying you can define types easily. But you can with dataclasses
- hbrn 4y agoCan you elaborate? What exactly is wrong with dicts?
- ActorNightly 4y ago>Like using dicts for everything Sorry what? This is absolutely not true.
- nephanth 4y agoI think they meant that the underlying representation for most stuff is a dict. Global variables are stored in a dict (`vars()`). Unless you use slots, an object is essentially a dict Doesn't really disturb me because they're not used like a dict in practice though
- ActorNightly 4y agoRubys biggest downfall was the stupid "fancy" syntax stuff in the language, like not requiring parenthesis or return statements, insert operators, BEGIN/END blocks, e.t.c. All of those make the code base harder to read. Also I remember the dependency management system was a pain in the ass to deal with, especially with modules with native libraries. Python had some issues with 2, but when 3 came around and fixed all that, it became the language of choice specifically because of its consistency.