Re:Ruby Is Still a Diamond
by dzonga on Thursday September 02, 2021 @09:27AM
(#28391726)
ruby is a still a pleasurable language to use. it's simpler than python. rails for crud stuff is gold standard alongside django.
at least in the ruby world, there isn't much momentum compared to most languages of adding static typing though things like sorbet exist.
in the js world the typescript folks came in, the dynamism of js is disappearing
[ Parent
| on HN ]
Not sure how you conclude it's simpler than python. Different precedence of !/not has burned me in the past. Symbol/String keys have burned me. Module/Class (Python has this to some extent, but you don't declare modules so it doesn't come up), block/proc, fail/raise, extend/include, case/when can be used for bool expressions or instanceof checks
I enjoy ruby, & it's nice once you get that every property access is a method call ("it's all message passing") which has nice dynamism (see Sequel)
Maybe you can argue Ruby does a better job not leaking its abstractions (no __slots__ etc)
> the dynamism of js is disappearing
As an outsider, really curious to hear more about this. Is it from an ecosystem point of view, where the "dynamism is disappearing" or more from a day to day, the fact that writing TS is significantly different than writing JS? Or even something else?
There are a few patterns that TS simply cannot or is too painful to handle. I still have no idea how to define a class the old way with prototypes in Typescript, which I really only discovered when I ran into some edge cases around how static members and methods in the new class syntax were typed.
You also lose the "type out code really quickly without thinking too hard about it" and the thrill of wondering if it'll work when you load the page.
"Thrill" is an interesting way to put it.
It didn't always, but it sure felt good when it did on the first try!
Needless to say, my scripting nowadays is almost exclusively Typescript.
with dynamic language and yeah a multi-paradigm language like js, means you can come up with patterns a compiler can never expect. because javascript is so flexible, your code ends up like a mini dsl yet still remains readable javascript. with typescript, you won't have much flexibility. you lose a lot of productivity fighting the tool i.e typescript compiler
Ruby is not "simpler than Python".
Re:Ruby Is Still a Diamond
by cupofjoakim on Thursday September 02, 2021 @12:15PM
(#28393904)
A counterpoint is nothing without argument. Care to elaborate?
The dynamism of creating functions that happily take an object, or an array or a string (never detailed thouroughly in the documentation, of course) and then does different things based on which one you got, was always teleogically a dead end.