43 points · by thunderbong · 2y ago · 87 comments
I had similar experiences in C#.NET and Python (especially SQLAlchemy), albeit less often and less frustrating.
In Golang, the frameworks and libraries tend to stay out of your way. I feel way more productive.
The trade-off is that I am writing more boilerplate. IMO that is a worthwhile tradeoff, especially since things tend to then be more explicit. More explicit is nice for maintenance anyway. Also, with how far AI code helpers have come, boilerplate is even less of an issue.
Couldn't agree more.
With how far on-the-fly code generation powered by LLMs has gotten, the oh-so-dreaded "boilerplate" has become an absolute non-issue, especialy in straightforward, explicit languages with little magic like Go, which naturally lend themselves to this kind of code generation.
Best of both worlds: Explicit instructions and less "magic at a distance", and productivity by getting things done fast.
b) Pretty much by definition, boilerplate written against the standard library of the language, rarely, if ever, requires maintenance. Not sure we talk about the same thing here when using the word "boilerplate", so perhaps you want to clarify?
I honestly cannot imagine writing modern .NET without a framework. When was this? Modern .NET(5+) is so easy to write and maintain I feel shocked that someone doesn't like it. And I say that as a person who switched from .NET to Typescript+NestJS recently - .NET was really nice to work with for the most part.
This was also back in 2019 when I last did serious work in C#, so things might have changed a lot since then.
From my experience ASP.NET Core and EF Core are very good frameworks, usually the horror starts when developers start building their own framework on top of it, instead of keeping it simple.
I read messages like these and I would honestly love an example, because throughout last 5 years I've been doing .NET, I never had a case where a framework was hindering my work. People always use shallow arguments like these, but the reality is that 99% of work is basic CRUD making with sprinkle of business logic/validation. If you do the other 1% of work then sure, but in most competently designed frameworks you can accommodate those cases anyway or you won't use a framework in the first place anyway.
As for mentioned startup style changes in .NET - none of those actually required you to do anything. I've migrated dozens of projects from 3.1 to 7 and I didn't really have an issue with any of them. I worked with projects that used all of the approaches to Startup/Program.cs and I none of them ever really bored me. Is it a slight mental overhead? Maybe. Does it matter long term? Not really.
If you work in a tech stack with established patterns/frameworks/libraries and you invent your own wheel, you can be sure next generation or two of developers will absolutely hate you for it, because really, you can't make a better abstraction than a collective of dozens or hundreds of developers over years.
When I was trying to learn Clojure (several years ago... so this info I likely out of date), my understanding was there was a bit of a rift in the community where half the community preferred the flexibility of picking and choosing libs and the other half felt having a "batteries-included" framework would help the growth/adoption of the language. Also, because there was no "goto" framework the libraries were likely not as battle tested.
I'm using Java and unlike the comments in the adjacent thread, using Java doesn't mandate using Spring Boot. There's a bunch of options these days. Personally I'm using Quarkus. Quarkus, like most frameworks, is just a collection of libraries and those libraries follow a "standard" to future-proof your application to an extent. You can still pick and choose what parts you want to use. Want an ORM? Great, include the optional Hibernate dependency. Need to support OpenId connect? There's a simple extension. Nothing really forces you to use the "official extensions", e.g. we're using ElasticSearch but we're not using the Quarkus extension.
Good frameworks are much better than no framework - they railroad it in a way that keeps your code adhering to clean patterns and doesn't railroad you in such a way that it prevents you from doing everything you want.
Bad frameworks are 10x worse than no framework:
* By railroading you they prevent you from doing legitimate things that you want - usually things the framework creator never anticipated.
* With a nightmare framework you may end up having to debug stacktraces that involve not a single line of code that you wrote. I remember when this used to happen with me in Spring when I misconfigured some XML (a long time ago).
If all you have is a hammer everyrhing looks like a nail. So instead of openly thinking about what the best solution would be in terms of architecture, interfaces etc, you try to push things into a framework that may or may not fit the problem at hand. If it does, as long as it does: Great.
But to me the answer whether a framework is suited to tackle a specific set of problems is hard to figure out before trying it. Most of the times I tried that answer was: "Yeah you could do that, but it is neither elegant, nor performant and doesn't lead to the UX I aim for.
Maybe this is about the type of things I want to do or the type of person I am, but my experience with every framework ever was cool as long as I did basic things and impossible as soon as I tried something more involved.
So I stick to microframeworks.
That being said I have settled for this simple setup when it comes to web applications. However its quite interesting how I seem to forget the insight I should have gained from all this framework-back-and-forth when I enter a new problem space and inevitably choose the complex, batteries-included framework.
This is why I think there is a use-case for every kind of framework out there. The big ones take the load from your shoulders while you are still learning about the problem. And if you so choose and the circumstances allow it, you can replace it later with some framework that is simpler at its core, but possibly easier to maintain, because you are able to reason about every aspect that made it difficult at the beginning.
I got tired of working with that. Many developers dependent upon frameworks have an extreme fear of original code because they cannot actually program even though that’s their job. This results in some horrid immature behavior.
My key realization to move on is a complete loss of understanding the work from the people performing the work. It becomes clear when I would advocate an opinion and the people doing work are utterly incapable of hearing it. This isn’t disagreement, which is healthy, because disagreement takes your thoughts into consideration and balances them against opposing interests. When people stop hearing an opinion outright they have no idea what the opinion is, what it means, and how to articulate a response. When this occurs it’s time to move on because you have moved outside their narrow field of perspective.
That is sometimes the people that request the product are just as bad in communicating what the result should be and it might even change half-way through the process. Its hardly surprising that the result is "horrid".
So the root of the "social problem" could be anywhere really.
That being said there are definitely cases (as in your last paragraph) where you cannot seem to agree with other developers because your understanding of what makes a developer is just so radically different and you keep talking past each other. I would be surprised if that was not the case in every other conceivable profession, though.
No, they are not.
People have built, and are still building, amazing products using plain JS. They are also doing so using very simple, lightweight frameworks.
Abstractions are useful and can increase productivity.
The problem is, abstractions have a diminishing return. Using more and more of them stops being useful, and starts becoming detrimental.
But, alas, doing so creates the illusion of productivity, because look at all that code I am writing which doesn't actually solve the business problem, but satisfies the abstraction! Look at how amazingly tall my tech-stack tower is, and nevermind all the SRE hours this monstrosity eats, it's state-of-the-art after all! It also makes people feel very smart, because they learned how all these abstractions work, even though nearly the only application of that knowledge is "how to use these specific abstractions". It also creates moats, which a lot of people seem to like (cue "Looking For Frontend Dev, minimum +6 years experience in framework-that-came-out-last-year" - Joke).
And lastly, "big tech" are using these abstractions, so "This-Is-The-Way", and nevermind that these companies exist, and have to solve, a completely different problem space.
Doing this with Java entails reflection and various other runtime extending toolery, which requires a huge panel of tests because of a lack of ability to type the more difficult aspects. This is certainly not impossible and I have done this many times, but it's not practical and it is not cheap.
However, it is fair to judge such an overuse of the factory pattern as obtuse.
And document it yourself, and maintain it yourself, and build an ecosystem of extension for it yourself, and create video tutorials for it yourself, and ...
A minimalist off-the-shelf framework can go a long way.
I like frameworks that do not do much more than provided by their libraries that get exposed by it. So I can always swap out libraries, or carry a long certain libraries after moving on from the framework.
Ideally, you would want to create a plugin/extension to the framework to do your custom thing. But sometimes -- especially when writing games -- you can end up doing things the framework (engine) was not designed for, so end up having/wanting to implement your own thing.
Also, with 3rd party extensions, they tend to be poorly made/maintained, and at most do 80% of what I need. If lucky enough to find an extension that does what I need, then it's likely that 80% of it does things that I don't need, which just adds to the bloat and complexity.
With Node, I stayed with NestJS+typeorm, done, no need to revisit that decision tree. For Golang, I stayed with Echo, I only need it to handle the webserver/api side of things, I build the rest myself, done, no need to explore all the other trends. If I revisit something, it might be 5 years down the line, likely the decision will just be to stay with current tools if they continue to work as expected.
I'll add that I think that the joke about killing your ex-girlfriend is in really poor taste.
Component based architecture has simplified so much, compared to the endless permutations of MVC, MVP, MVVM, etc.
One of PHP’s key advantages is lower cost of maintenance, and it’s much easier to achieve that by using Laravel or Symfony.
Some more discussion just 5 months ago: https://news.ycombinator.com/item?id=36637655
Also: All of this is for reasons I am unable to go in to.
Being able to solve AoC in it doesn't really matter.
* Strong, mature eco-system
* VM-based so we can easily change OS and/or other dev-ops related params.
* Large hiring pool with lots of experience in it (at least this is the case locally)
* More performant than Python, which would maybe be the next language that hits all three of these points.
Your counter-question also deflects and doesn't answer my original question: what problems can not be solved in Java without frameworks? What are examples of lego problems and duplo problems?
Maybe it's a misreading on my part, but I would interpret a "duplo" language as one I could not even build a framework in, due to a lack of low-level control.
You could make this argument about ruby or python. It is quite different to saying "Java is Duplo, presented with Lego problems it is simply unable"
We do that.
We just call it a SpringStoreBackend.
I have my own DI (distage), logger, IDL/DML/RPC, test harness... And all that stuff takes less than 20000 LoC.
The async runtime we use (ZIO) has been created by a tiny team.
You are making my point, friend.
It's not dead if one person can control it.
> no one wants to spend time
Precisely, that's why a custom mini-framework with 10k LoC is a better option than a 200K LoC pile of crap.