3 ms·
I feel like this axiom is true in general. Don't write [insert lang here] like it's Java. I've seen this in Ruby code bases, TS code bases, even Erlang code b
by weatherlight 2y ago
I feel like this axiom is true in general.
Don't write [insert lang here] like it's Java.
I've seen this in Ruby code bases, TS code bases, even Erlang code bases (using gen servers like an OO primative.)
- SebastianKra 2y agoThis makes me immediately think of NestJS which copies everything from classes, annotations & ORMs to service locators. It still managed to grow to 3M weekly downloads. Maybe there's a certain safety in doing thing how they've always been done - even if that seems backwards to me.
- karmakaze 2y agoThat's funny. Writing Ruby with Sorbet works fairly well if you just pretend it's Java most of the time. Have to keep in mind that the static typechecking is broken, so can't go refactoring wildly and get it on the first go. Limiting use of metaprogramming to what amounts to being annotations is also friendly to coworkers. Of course what's being picked upon is a specific kind of Java code. It's better to be specific than technically incorrect, as all written Java is Java regardless of how you write it. The article goes a good job (comments here less so), except for this bit: > While not entirely accurate, there’s some truth to the trope that Java developers need everything to be an interface (I am one such developer). That's not just Java, that's Dogma. What does work for me is writing in most languages (Java included) as if they're functional ones without lots of variable reassignment or data mutation.
- weatherlight 2y agoI feel like when people write Ruby like its Java as opposed to say, smalltalk, a lot of what makes ruby wonderful is lost.