4 ms·
I used to have that attitude. Then I wrote my first Ruby project as an experiment. That was 17 years ago, and the majority of the code I've written since has be
by vidarh 4y ago
I used to have that attitude. Then I wrote my first Ruby project as an experiment. That was 17 years ago, and the majority of the code I've written since has been Ruby. What clinched it was that the first Ruby project I wrote involved trying to reimplement a piece of C code we had. It ended up 10% the size with more functionality, and it took me a tiny fraction of the time to write.
If you write code the way you write statically typed code, then sure, you're in for a world of hurt. I could imagine using a statically typed language again if it made me as productive as Ruby, but most statically types languages have near useless type systems that I wouldn't wish on my worst enemy.
- pak9rabid 4y agoHave you looked into Crystal? It's supposed to be a statically-typed language, with the syntax of Ruby. https://en.wikipedia.org/wiki/Crystal_(programming_language) https://en.wikipedia.org/wiki/Crystal_(programming_language)
- vidarh 4y agoI have, and last time I looked it deviated from Ruby in entirely pointless ways that makes it fairly uninteresting to me. I get they want it to be its own language, but it'd have been far more interesting to me if it stayed as close as possible wherever it could.
- mostlysimilar 4y agoI don't know if I'm just a bad programmer and everyone knows something I don't, but it seems to be the benefits of a strongly typed language are wildly overblown. It's a different way of thinking about building software and it saves you from a few mistakes you could otherwise make, but you'd think I was writing code with a hammer and chisel the way people on HN talk about languages like Ruby. It feels a lot like the people who used to try to convince everyone functional programming was the only way to go and object-oriented programming was for dinosaurs.
- bcrosby95 4y agoIts all guts, feels, and "everybody knows" - but afaik there's been no hard proof about statically typed languages being superior to dynamically typed ones, or vice versa.
- hbrn 4y agoThe big difference between the two that I noticed is that dynamic camp doesn't aggressively proselytize. And it doesn't shame infidels (it pities them, if anything).
- int_19h 4y agoOh, it does. It just happened back when Python and Ruby were new and hot. These days, Rust is new and hot, and so ...
- hbrn 4y agoI do remember dumping on Java back in those days, not so much on static typing itself. Seems like those were mostly language wars: Python vs PHP, Python vs Java, Ruby vs PHP, etc. It might be just anecdotal, but I noticed people often say that writing in Ruby makes them feel happy. Static typing (or functional programming, or TDD) doesn't seem to make people happy. It makes them feel superior. Whether it truly makes them superior, or just taps into their insecurities is an open question.
- int_19h 4y agoYMMV. I used to be very gung-ho about dynamic typing 10 years ago. Since then, my experience using it in a fairly large Python code base is that it doesn't make me happy, and the code patterns that make it workable tend to be very similar to how statically typed code would look anyway. Ruby specifically is a separate question IMO because it has a lot of convenience features that are kinda orthogonal to the whole typing debate. Crystal is a good example of how you can retain those in a statically typed language.
- lmm 4y agoC is barely statically typed. In an ML-family languge you can write pretty much the same code you'd write in Ruby, just it'll be typesafe.
- vidarh 4y agoIf there's an ML-family language that reads similar to Ruby I'd love to use it. I'm not being facetious - I still love the notion of as much static testing as I can, but I'm not willing to give up the pleasantness of Ruby for it, so if there's something that can get me there I'd love to see, even if it's not "good enough" to replace Ruby for everything. But keep in mind this includes run-time dynamic meta-programming. E.g. one of my projects bootstrapped a large proportion of the web frontend by having the backend introspect the database schema and dynamically generate models, routes, access control and metadata endpoints that the frontend then used to instantiate the UI. The typing in that case was controlled by the database migrations.
- lmm 4y agoI was a huge dynamic language fan (although admittedly more Python than Ruby) until I found Scala. It has a reputation for incomprehensible arcane symbolic code, which certain libraries do, but you can write ruby-like code if you avoid doing that. I've done "generate a whole CRUD backend from a single source of truth for what my domain looks like", although I've done it by defining the model classes, generating the database schema from them, and deriving everything else from them. All the building blocks are there but I haven't found a framework/library that puts it all together (that's one of those projects I keep meaning to get around to). I've heard there are some database access libraries that let you use a macro to derive model classes from the schema, but I haven't used them yet.
- vidarh 4y agoScala to me is unreadable. It reads like an unholy mix of Python and Java, with a lot of the ceremony of Java still hanging in there coupled with introducing partial significant whitespace. It's not bad - it's better than most alternatives - but it's not good enough to meet my standards. If you see static typing as essential, then I can see the appeal. But my starting point is that it's not essential to me (and we're increasingly getting part of the value via optional and gradual typing via things like Sorbet which also let us keep the clutter out of sight, reducing the gap even further), and so losing even some of what brought me to Ruby is too much of a sacrifice.