3 ms·
I am a big fan of rust, but I am starting to feel like this is a thing with it too. Not to the same extent at all, but I often find myself writing what feels li
by mdtusz 7y ago
I am a big fan of rust, but I am starting to feel like this is a thing with it too. Not to the same extent at all, but I often find myself writing what feels like scaffolding boilerplate code.
That said, the code is usually there for a good reason and I'm extremely thankful for it in the instances where things are refactored and the compiler catches it, or some deviation from the norm comes up and the scaffold allows for doing things the way you need.
- marcus_holmes 7y agoditto for Go. Huge fan, but it does involve a lot of boilerplate. Not that I think that's a bad thing. I prefer it to "magic" (I never got on with Rails because of this... what just happened? why did it do that? where does it say it should do that?). And you never know when you have a class/use case that needs the boilerplate to change. Having it the same 99% of the time so that you have the option to change it for that 1% edge case is a good thing, imho.
- pm90 7y agoGo seems to have much less boilerplate than Java. I’m really glad that OOP was explicitly unsupported and the language designers opted for using interfaces instead.
- kjeetgill 7y agoInterfaces are as much a part of OOP as inheritance. Go is as OOP heavy as Java. They differ mostly in how/when an "class" is bound to an interface. Java declares up front, Go does this implicitly at usage sites aka static duck-typing (which is great!). That said, I think OOP education focused a lot on inheritance during Java's rise and that was mostly a mistake in hindsight.
- ickyforce 7y ago> Go seems to have much less boilerplate than Java Maybe if you compare to Java from 10y ago. Have you ever tried to print a map in an alphabetical order of its keys? The only thing more verbose in Java are getters/setters which hopefully will disappear once records are available.
- jimbokun 7y ago> (I never got on with Rails because of this... what just happened? why did it do that? where does it say it should do that?) With Spring you get to ask all these questions...with all the boilerplate of Java as an added bonus!
- ratww 7y agoThis is strange, I've been programming mostly Rust for the last six months and I'm finding it very terse actually. It is much shorter than the original Javascript code it's replacing, mostly because of the error handling. Are you using an MVC web framework, or something like that? Asking because I'm curious about other people's experience with Rust.
- mdtusz 7y agoBoilerplate may not be the best term. It's more the presence of fitting into types and structures that certain libraries/frameworks provide where you just need to be much more explicit than in some languages. It's definitely a good thing long term though. Writing code without dependencies/frameworks that have a required structure is a joy, however.
- devit 7y agoAre there cases of such boilerplate that are not solved by macros?