40 ms·
Why I Hate Frameworks (2005)
- lewisjoe 12y agoVery amusing to re-read after a long time. But still I haven't done with frameworks, mostly because when I build a house and I have nothing to start with, I could very well use a factory factory factory, which could provide me with factories, than to run to a shop every time I need something. Say for example, what I need is a url routing system, I could very well use a routing framework than to write one myself. A user authentication system is such a common task that I'd rather generate one with a factory than to run myself to a shop to buy one. Frameworks have their place in my toolkit. Using them only at the right time with the right purpose is what will make the difference.
- jakejake 12y agoAgreed, frameworks are tools to be used or abused. The main problem with Joel's analogy is really that factories did not replace hammers. Hammers and factories and everything in between are always available to us.
- icantthinkofone 12y agoIf you're a home builder, I would expect you to already have what you need to build one, and not running elsewhere to buy parts that everyone uses on their houses, too. Unless you're just a tract house builder cranking 'em out without a care for what they look like.
- robotkilla 12y agoYou're going to be using a framework when you work for a company. Whether its a custom in-house framework (pray to the holy death it isn't) or something third-party (cry me a fucking river, you have to learn something new). Just make sure you don't forget how to not use frameworks.
- pothibo 12y agoFYI, Angular, React, Backbone, Ruby on rails all started as in-house frameworks.
- robotkilla 12y agoYeah to clarify: you or your team members MIGHT build something awesome because you and they are awesome, but the chances are the custom framework was built by your boss 10 years ago and the server has already been hacked.
- grandalf 12y agoWhen I first read this back in 2005 I was skeptical. Turns out Joel was right.
- duncans 12y agoIt wasn't by Joel, this is a post on his forum.
- fsk 12y agoFrameworks seem to be most useful for churning out a lot of mediocre websites quickly. If you're doing something really original, a framework is less useful. Another downside of frameworks is maintenance. A company hires an outsourcing company to make a website. They use a framework, and might not even use it correctly. The incentive is for the outsourcing company to use a framework, because that lets them ship a website that sort of mostly works quickly, so they can get paid. The contract is over and now some other programmer (such as me) is now supporting it. Now, making changes is several of order of magnitudes harder, because you're fighting the framework in addition to the code that was already written (especially when they didn't use the framework correctly). For example, I was working on a website that used Zend forms. Now I needed to modify the form so that it was pre-populated with the data (an edit page instead of a submit page). I spent a couple days looking at the code and the zend documentation, and I just couldn't figure it out. The form had some javascript on it also, so I couldn't just use value="" to pre-populate the data. It it was plain HTML/PHP, I could have just used value="" to pre-populate the data and be done in 5 minutes. The framework make a 5 minute task almost impossible.
- robotkilla 12y ago> If you're doing something really original, a framework is less useful. Waaaait a minute - what kind of frameworks are we talking about here? You can build loads of things with Django. I can build VERY unique sites with backbone... i don't understand the opening comment. Hell, even bootstrap can be tweaked beyond recognition without terrible code. Edit: > They use a framework, and might not even use it correctly. That's a shitty company or developer, not a symptom of the framework. Surely you would rather work on an established documented framework than a custom undocumented mess from the same shit company?
- fsk 12y agoMy experience with frameworks has been that, once you go outside the stuff that comes with the framework, they start to hold you back more than they help you. It's also a nightmare to go into someone else's poorly written framework code and try to maintain it, especially because frameworks have "magic" where functions are not explicitly invoked, so it's almost impossible to trace the control flow. Every time I've been maintaining someone else's framework code, the project was a mess. I don't see how frameworks are so awesome if so many people use them incorrectly. For example, at my last job, they were using angular.js. Every 30-60 minutes the website just randomly crashed. There were all sorts of weird "$digest in progress" errors and bizarre errors. I know they weren't using angular correctly, but if a group of average developers are using angular incorrectly, do you blame them or blame angular?
- codr4life 12y agoWhile there are a couple of guys still shaving that yak, today it's more or less Jetty micro services all the way. Still Java but a huge step forward from the J2EE abstraction astronaut crap you had to put up with for a while. Configuring factory factories suck on a whole different level from ordinary coding.
- pothibo 12y agoYou understand that you are the saleman of this post by talking about micro services, right? Unless I oversaw your sarcasm...
- codr4life 12y agoWasn't really trying to sell anything and I can't see the connection between micro services and factory factories, except that they were both once the next big thing. I'm just saying at least it's getting better for the Java folks.
- zby 12y agoUpdate: Removed the unnecessary and (as noted below) false remark about Joel not understanding Dependency Injection. The main (but not only) reason we have object factories is to be able to extract code suitable to be unit-tested from the whole application. And unit testing is like testing the tire of a car in a laboratory instead of testing the whole car on a race track. Not that we don't test cars on race tracks - but it is a lot cheaper to test the tires in labs first. It is not that we sell Object Factories so that people can produce their objects - we use Object Factories in our code - so that the objects are better encapsulated. Once you understand that - the whole satire with hammer factories collapses. But OK frameworks are still yet another subject and I kind of agree that libraries are often better (http://perlalchemy.blogspot.com/2010/02/frameworks-are-framing-libraries-are.html http://perlalchemy.blogspot.com/2010/02/frameworks-are-frami...).
- solutionyogi 12y ago1. This was not written by Joel himself. This was written by a guy named Benji Smith on JoS forum. 2. I understand dependency injection completely but question if it's really required to write quality software OR is it a technique you use because programming languages are lacking. Let me give you an example. In .NET world, there is a product called, Isolator by a company called TypeMock. It can let you mock any type/method by exploiting CLR. In .NET, there is a type called System.DateTime with a static property DateTime.Now. I have seen code where people try to write interfaces to inject DateTime.Now. And I think it's an overkill. When I saw their example of how they can mock DateTime.Now without doing DI, I am personally convinced that DI is about addressing limitations of your statically typed language and is not an absolute must. http://www.typemock.com/TypemockIsolatorExamples http://www.typemock.com/TypemockIsolatorExamples
- robotkilla 12y ago> if it's really required to write quality software of course it isn't. if your program doesn't require dependency injection and you architect it for dependency injection, that isn't quality software.
- 12y ago
- solutionyogi 12y agoOne of my favorite articles of all time. There is no doubt that people writing Java software loved abstractions. One of my favorite examples: https://ptrthomas.files.wordpress.com/2006/06/jtrac-callstack1.png?w=630 https://ptrthomas.files.wordpress.com/2006/06/jtrac-callstac...
- superuser2 12y agoYep. Java may be faster for equivalent programs, but Java in practice sure as hell makes up for it with endless abstraction.
- charliefg 12y agoWould you look at that beast! The bigger PDF image is on the post: https://ptrthomas.wordpress.com/2006/06/06/java-call-stack-from-http-upto-jdbc-as-a-picture/ https://ptrthomas.wordpress.com/2006/06/06/java-call-stack-f...
- aikah 12y agoTo be fair ,aside from a Servlet container and JDBC none of these things are required for Java web development. Java language doesn't help though and could use more features from C# for instance.
- dikaiosune 12y agoWell I think the point is that it's a cultural thing. I really like Java, but it takes unconventional approaches to avoid bloat when working with Java tools because the "standard" way of doing things produces 200+ line stack traces.
- dikaiosune 12y agoHah! I currently do support at my day job on a Java monolith which is as scary as it is clunky. I've seen stack traces go past 500 lines...
- kking50 12y agoI love lightweight frameworks that exist mainly to reduce boilerplate code and, for web development, mitigate cross-browser compatibility issues. ExpressJS and jQuery are good JavaScript examples. I tend to avoid frameworks that attempt to push developers into coding "the framework's way" (cough cough AngularJS). Such frameworks are often great in the beginning, but once you pass the basic application stage, a deep understanding of the framework itself will become necessary and it will stop saving you time. Sometimes you have to adapt special ways of writing tests, debug nonsensical stack trace dumps, etc. Not to mention it increases the overhead of bringing new developers on the project. tl;dr Don't use heavyweight frameworks unless you have a good reason.
- robotkilla 12y agojquery is a library not a framework but yeah i agree edit: sheesh why did i get downvoted for this? it is absolutely a library which is completely different from a framework. even jquery's website says it is a library.
- gkop 12y agoRoughly speaking, jQuery is a library for the app developers and a framework for the plugin authors. So it is both a library and framework at once.
- robotkilla 12y ago> framework for the plugin authors interesting viewpoint, I hadn't thought of jQuery this way.
- aikah 12y ago> a deep understanding of the framework itself will become necessary and it will stop saving you time This is true for any 3rd party code you're going to use.If you don't know the difference between jQuery the DOM and how to go from one to the other within jQuery you're going to do a lot of mistakes as DOM apis evolve fast while jQuery features don't. > I tend to avoid frameworks that attempt to push developers into coding "the framework's way" What makes you think your way is better? and when you end up working with several devs , are going to meet every morning to talk about what's the good way to do things for every aspect of the project ? using a third party frameworks helps , people only have to agree on what 3rd party code they are going to use. And libraries are not black boxes. Reading 10 000 lines of code shouldn't considered a burden or one should reconsider career choices.
- deleted 12y ago[deleted]
- yoavm 12y agoI don't think that killing your ex-girlfriend is a funny example in a world where almost 40% of murders of women are committed by their partners.
- kennywinker 12y agoYeah that stuck out like a sore thumb for me as well. Pretty tacky example. I'm sure it was just meant to convey a tongue-in-cheek sarcastic tone, but it's in pretty poor taste.
- r0naa 12y agoI was a little disturbed by that as well, I don't think that this is appropriate or funny.
- icantthinkofone 12y agoWhy so serious? EDIT: I knew that would get a laugh. It was a good joke. I chortled. I don't get offended by every off-hand phrase in life when no one's hurt in the process. If you're offended by the joke then you are the one with issues, not the joke.
- blueflow 12y agoI thinks its up to every persons responsibility to learn to deal with rough language. The world isn't easy, and we need to learn to deal with it contents.
- yoavm 12y agoi think it's every person's responsibility (& interest) to make the world better, and the words we pick are a good place to start.
- blueflow 12y agoI don't think "picking on the language of others" is a good start. What about the people starving right now in less developed countries? And the homelessness problem? Companies doing serious damage to the environment? And we both are just sitting here discussing language on the Internet. I think you are not in the Position to talk about a better world as excuse for political over-correctness.
- Bahamut 12y agoI disagree with the message here - unless you have exceptional requirements, frameworks can be extremely useful. To give an example of their utility, I am currently building a site for an online community I run - on top of my regular job, exercise, and contract work, free time is hard to come by. I went with Sails.js and Fluxible on top of React to assist me with putting together a good frame since when I start letting the three other developers in the community develop features for the site, they will have an easier time searching for solutions due to existing documentation and Stack Overflow. The core logic is decoupled from any particular franework though, and only makes use of each framework for their strengths. The important thing is to be judicious in your use of a framework.
- dang 3y agohttp://web.archive.org/web/20180927070411/http://discuss.joelonsoftware.com/default.asp?joel.3.219431 http://web.archive.org/web/20180927070411/http://discuss.joe...