

Why I Hate Frameworks (2005) - luu
http://discuss.joelonsoftware.com/?joel.3.219431.12

======
solutionyogi
One 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-
callstac...](https://ptrthomas.files.wordpress.com/2006/06/jtrac-
callstack1.png?w=630)

~~~
aikah
To 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
Well 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.

------
robotkilla
You'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
FYI, Angular, React, Backbone, Ruby on rails all started as in-house
frameworks.

~~~
robotkilla
Yeah 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.

------
yoavm
I 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.

~~~
blueflow
I 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
i 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
I 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.

~~~
yoavm
what about them really? I don't think these topics would make a great joke
either :-/

"picking on the language of others" could so easily be transformed to "picking
on the behaviour of others". there are so many things to do with a hammer, and
i think we should pick more on the people who use it to kill women, or suggest
it as a joke.

sorry for being off topic btw.

~~~
blueflow
Language is a different shoe from what we actually do. HN is not a good place
for this, drop me a mail on nero@icvn.de if you are further interested in
discussion.

------
zby
Update: 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-
frami...](http://perlalchemy.blogspot.com/2010/02/frameworks-are-framing-
libraries-are.html)).

~~~
solutionyogi
1\. 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
> 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.

~~~
solutionyogi
Here's the current status of .NET software development.

I think there is a broad agreement that unit testing is a very useful tool in
developing quality software. Because of the inherent limitation of C#, you
can't unit test easily if you don't use DI. This often leads to a situation
where you have tons of interfaces + each interface is implemented exactly by
one class. This is because product like Isolator is not free. Hyptothetically,
if Isolator was provided by Microsoft for free, I am sure that we will see
reduced usage of DI.

Don't get me wrong, I think there are other scenarios where DI is a great
technique in designing components which are flexible. However, those scenarios
are not that many. Using DI to make your software unit testable is an overkill
IMHO.

------
lewisjoe
Very 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
Agreed, 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.

------
fsk
Frameworks 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
> 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
My 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?

~~~
mbesto
Uhhh, you blame them.

~~~
fsk
Why? If a group of average programmers use a tool incorrectly, is it the
worker's fault or the tool's fault?

If a group of average people can't use angular correctly, then maybe angular
isn't so great.

~~~
parasubvert
You're assuming your anecdote is the norm. Angular is pretty popular because
it makes some people more productive.

The average woodworker probably doesn't know how to properly use a lathe, but
they don't go on WoodHacker News saying that lathes suck.

~~~
robotkilla
> they don't go on WoodHacker News saying that lathes suck

You're assuming the average woodworker knows about WoodHacker News.

------
kking50
I 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
jquery 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
Roughly 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
> framework for the plugin authors

interesting viewpoint, I hadn't thought of jQuery this way.

------
codr4life
While 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
You understand that you _are_ the saleman of this post by talking about micro
services, right?

Unless I oversaw your sarcasm...

~~~
codr4life
Wasn'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.

------
Bahamut
I 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.

------
grandalf
When I first read this back in 2005 I was skeptical. Turns out Joel was right.

~~~
duncans
It wasn't by Joel, this is a post on his forum.

