Don't write Rust like it's Java (2023)
41–45 of 45 posts
Re: Don't write Rust like it's Java (2023)
#42Earlier quoted context omitted.
Hasn't the use of behaviourless value objects (essentially structs) been commonplace in both the JVM and the related .NET-world for the better part of a decade now, maybe more?
From my experience, "anemic DDD inspired architecture" is fairly common in enterprise .NET codebases. These do heavily use all kinds of value object, DTO and DTO-like objects with the logic that processes them being defined separately. Unfortunately, most of them still suffer from premature and very unnecessary abstraction bloat. Luckily, the trend for terseness and minimalism is gaining more and more momentum each y…
Most developers likely don't stick around long enough to see the pains of doing major upgrades on large codebases.
I've been using a layered architecture with great success for a large fintech application. We've even migrated from one web framework to a completely dissimilar web framework trivially as the majority of our code in the business layer needed no changes.
Re: Don't write Rust like it's Java (2023)
#43Re: Don't write Rust like it's Java (2023)
#44Earlier quoted context omitted.
Even in Java, the interfaces everywhere style was never great. Somehow Java got picked up by Architecture Astronauts that love writing enterprise pattern layer cake. Nothing in the language makes this style necessary, it's perfectly possible to write short and sweet code, and yet the Java culture got infected with this overcomplicate everything culture.
I kinda prefer the interface everywhere to the inheritance everywhere crowd. But I've mostly used/debugged groovy code so maybe I'm partial.
Re: Don't write Rust like it's Java (2023)
#45I 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.)
That'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…