6 ms·
Why I Hate Frameworks (2019)
- hurril 3y agoYou cannot build serious stuff in Java effectively without a framework. Choosing Java is choosing frameworks. The reasons are many, such as: Java programmers know Duplo, presented with Lego they are simply unable; Java is Duplo, presented with Lego problems it is simply unable; even a really competent programmer is simply unable when presented with Lego problems and Java because the one way to make it really productive is through the use of a good framework. Also: All of this is for reasons I am unable to go in to.
- pringk02 3y agoCan you elaborate more? I honestly can't think of a time I have been unable to do what I want in Java without frameworks, but I've obviously not tried to do everything.
- hurril 3y agoIf you were a CTO, would you have your team write the store backend in pure Java? Being able to solve AoC in it doesn't really matter.
- pshirshov 3y agoWorks great with pure Scala.
- hurril 3y agoDefinitely! But not with Java and JavaScript.
- pshirshov 3y agoI don't see why. Both are less exprissive, yes, but you still can have a small mini-framework which you can control (something alike to Micronaut).
- hurril 3y agoSure. But since the point has to do with how Java compares to alternatives when it comes to needing frameworks in the first place, this doesn't add to your point. It detracts from it.
- discreteevent 3y ago> If you were a CTO, would you have your team write the store backend in pure Java? 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"
- mrkeen 3y ago> would you have your team write the store backend in pure Java? We do that. We just call it a SpringStoreBackend.
- pringk02 3y agoI'd be happy to consider it. There are a number of good technical and non-technical advantages: * 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.
- hurril 3y agoYou are answering a different question. Opting for Java is smart, albeit incredibly boring. Doing so is basically choosing to go with Spring Boot, at the same time. You are going to do that because the Java programmers need it, Java needs it and if you don't, as another writer here said: you'll be writing all the frameworks yourself and at considerable cost. So hating frameworks and picking Java is a dubious position.
- rcxdude 3y agoYou are basically just saying 'java frameworks are mandatory' and then when people are saying 'I've done java without frameworks' (I am also one of those. I'm not primarily a java programmer, but every time I've used java I have used it without frameworks), you're saying 'nu-uh'. You're not going to convince people out of their own experience this way.
- hurril 3y agoNot really. "I did Java in a serious project without frameworks once" is not a counter to: Java needs frameworks to be generally useful. I am not trying to convince anyone, I'm stating the case that Java and Java programmers need frameworks in a way that more modern programmming languages don't. And that this is why it looks the way it does. My theory thus explains reality. Do you have a counter to my claim? As in: do you have many examples of companies now that use Java without having gone with Spring Boot (or basically invented it themselves?) I did Java for a mindnumbing decade, for god's sake. Then I stayed around the JVM for another decade writing in Scala. But! This is not an argument from authority here, I'm merely trying to add some context here lest you think that I am a .NET warrior or simply hate Java from a C++ distance. I am not.
- pshirshov 3y agoUnless you are capable of writing a framework. 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.
- hurril 3y agoWait - writing Java without a framework totally works if you begin by writing frameworks for everything it lacks? You are making my point, friend.
- pshirshov 3y agoIf you can write it yourself, it's not what people usually call "framework".
- fud101 3y agoYeah I hate this, no one wants to spend time mastering a bespoke buggy ad hoc framework which has zero documentation and continuity outside that project/job. Investing in a dead technology by definition.
- fud101 3y agoYeah I hate this, no one wants to spend time mastering a bespoke buggy ad hoc framework which has zero documentation and continuity outside that project/job. Investing in a dead technology by definition.
- pshirshov 3y agoUnless it's not buggy and has documentation. 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.
- jusssi 3y ago(2005) with thin wrapper from (2019).
- misja111 3y agoThe problem is not the framework, it's the mindset of the SD community that tends to mindlessly run after the latest hype, abandoning the previous framework that everybody embraced 3 years ago.
- hurril 3y agoI don't think that cuts to the core of the problem. Java (and JavaScript) are too weak. The way you make them productive is by emulating strength through a framework; more than one way exists to Rome, however, so there will be differences in how The One True Framework must be.
- misja111 3y agoNo it's not isolated to languages like Java and Javascript. I've programmed in Scala and Haskell as well, and you see the same phenomenon there as well. It's human nature. 'The grass is always greener on the other side', 'the emperor's new clothes' etc.
- hurril 3y agoThe difference in both of those cases are that you can create a micro framework yourself for the few abstractions that you need. (Not saying that you should!) 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.
- usrbinbash 3y ago> Java (and JavaScript) are too weak. 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.
- figassis 3y agoI tend to stick with the first thing that works and isn't too complex. On the frontend, I stayed with Angular. Tried react, hated the infinite abstractions, came back to Angular. Have been reading about Svelte's pragmatism and simplicity. If it really makes things simpler and allows me to reason about lower level things, I might move to it. Not urgent. 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.
- revskill 3y agoThat's why i always make my own framework to solve my needs.
- rufus_foreman 3y agoYou're going to need different frameworks for different situations. You would be better off making your own framework factory.
- encody 3y agoThe question is not whether to use a framework. The question is whether to build it yourself. However, it is fair to judge such an overuse of the factory pattern as obtuse.
- cies 3y ago> The question is whether to build it yourself. 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.
- rhdunn 3y agoIt all depends on 1) how far away from the off-the-shelf framework you are going (or want to go); and 2) how many of your projects you are using it for. 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.
- jenscow 3y agoAn extension ecosystem and video tutorials really aren't needed for an in-house framework. 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.
- austin-cheney 3y agoWhy? I find many developers have bizarre assumptions about frameworks they cannot logically rationalize.
- encody 3y ago
- pydry 3y agoFrameworks railroad your code. 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).
- beretguy 3y agoRelated: PHP “framework” without a framework, a nice starting point to build your own framework: https://dima.fi/ftframeworks/ https://dima.fi/ftframeworks/
- blowski 3y agoWhenever I see a project using something like this it’s always full of insecure, unmaintainable garbage code. It's not that it's impossible to build a good codebase in vanilla PHP, it's just that the kind of person that wants to do it is typically a mid with an inflated ego thinking they're going to be the next Taylor Otwell. One of PHP’s key advantages is lower cost of maintenance, and it’s much easier to achieve that by using Laravel or Symfony.
- k__ 3y agoFrameworks have come a long way in the last 10 years. Component based architecture has simplified so much, compared to the endless permutations of MVC, MVP, MVVM, etc.
- debok 3y agoIn my experience, this is mostly a JVM issue. When I code in the JVM, I feel like I fight my frameworks and libraries more often than writing actual code. Looking at you in particular, Spring Boot. 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.
- atraac 3y ago> I had similar experiences in C#.NET 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.
- dustedcodes 3y agoInteresting to see this blog post and reading this comment here on HN not long after I just posted this: https://x.com/dustinmoris/status/1736669433928544602?s=20 https://x.com/dustinmoris/status/1736669433928544602?s=20
- atraac 3y ago> Frameworks always hinder more than help in the long term, because once you need to make one step sideways they inflict indefinite pain on you. 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.
- Tainnor 3y agoI have plenty of things to criticise about frameworks, but this submission isn't really about frameworks - it's supposed to be a parody about certain enterprise design patterns. I think the joke's a bit stale by now, but it's true that sometimes you do find quite convoluted and overengineered patterns on the JVM (though not nearly as often as jokes would have us believe). I'll add that I think that the joke about killing your ex-girlfriend is in really poor taste.
- ChrisArchitect 3y ago(2005) Some more discussion just 5 months ago: https://news.ycombinator.com/item?id=36637655 https://news.ycombinator.com/item?id=36637655