4 ms·
You don't need to write boilerplate code and watch for syntax errors, if you use a programming language that does not encourage boilerplate or have a lot of syn
by nlitened 5y ago
You don't need to write boilerplate code and watch for syntax errors, if you use a programming language that does not encourage boilerplate or have a lot of syntax.
When I start a new C# project, first 40 minutes I am mindlessly writing a scaffolding of classes, data structures and helper functions that I will need from the beginning.
When I start a new Clojure project, I don't need all that, so I just stare at my blinking cursor thinking about what the program will actually do.
- Pandabob 5y agoCan you expand on this? Let's say I want to write a backend with Clojure, wouldn't I still need to write boilerplate for auth, the api endpoints and the CRUD operations?
- diatone 5y agoIf I understand correctly, GP wasn't necessarily stating that Clojure guarantees an absence of boilerplate for every use case, but instead that it doesn't require boilerplate to be written every time you use it. I'd encourage looking through the documentation for Luminus[1], one framework for writing web apps Clojure, to help you figure out if it suits your personal tolerance for boilerplate. IMO the example for gating API endpoints by authentication[2] is remarkably simple, but you might prefer something more opinionated a la Rails to completely abstract the auth boilerplate away. For what it's worth, being a lisp, Clojure could certainly support a framework for writing web apps that's highly opinionated, and takes in config for tweaking some defaults (e.g.: auth), thanks to macros. [1]: https://luminusweb.com/ https://luminusweb.com/ [2]: https://luminusweb.com/docs/services.html#authentication https://luminusweb.com/docs/services.html#authentication
- deleted 5y ago[deleted]
- moonchrome 5y ago>When I start a new C# project, first 40 minutes I am mindlessly writing a scaffolding of classes, data structures and helper functions that I will need from the beginning. I share this sentiment but the recently announced changes to file level namespaces, global imports, top level definitions etc. have the potential to eliminate a lot of pointless boilerplate. Now the structural patterns - those are self inflicted - you pay that cost to keep the thing consistent and maintainable down the line - but people often can't evaluate when it's not worth it (and often even don't understand what they are try to achieve but instead treat it like boilerplate that has to be present)
- osigurdson 5y agoIn my experience, the first 40 minutes of a project's lifecycle is largely noise. It is much more important is to create a body of code that can be effectively grown by large teams of developers. At the risk of sounding obvious, consider creating a library in situations where you need to use C# if you find yourself doing the same thing over and over again. Of course, if you can be specific about your misgivings that may help the C# (and Clojure) ecosystems or at least help us understand what you mean.
- akra 5y agoI think this equally applies to languages that are more geared to REPL and/or scripting development (e.g. script languages and/or functional languages). Not just Clojure. OO requires a bit of boilerplate and structure up front IMO, at least the Java/C++ variety. IMO the structure typically has to be re-invented each project as well. i.e. what factories, interfaces, parts will I need?