News for hackers. Stuff that matters.
Re:Why I Hate Frameworks (2005) by fsk on Saturday March 14, 2015 @05:37PM (#9204273)
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.

Re:Why I Hate Frameworks (2005) by robotkilla on Saturday March 14, 2015 @05:46PM (#9204302)
> 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?

Re:Why I Hate Frameworks (2005) by fsk on Saturday March 14, 2015 @05:52PM (#9204324)
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?

Re:Why I Hate Frameworks (2005) by vatotemking on Saturday March 14, 2015 @11:33PM (#9205262)
> 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.

That's why I prefer to use microframeworks over full blown frameworks. I can make it get out of the way if I want to by swapping out parts I dont like.

Re:Why I Hate Frameworks (2005) by mbesto on Saturday March 14, 2015 @05:56PM (#9204336)
Uhhh, you blame them.
Re:Why I Hate Frameworks (2005) by fsk on Saturday March 14, 2015 @06:02PM (#9204354)
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.

Re:Why I Hate Frameworks (2005) by parasubvert on Saturday March 14, 2015 @06:32PM (#9204455)
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.

Re:Why I Hate Frameworks (2005) by robotkilla on Saturday March 14, 2015 @06:55PM (#9204539)
> they don't go on WoodHacker News saying that lathes suck

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

Re:Why I Hate Frameworks (2005) by robotkilla on Saturday March 14, 2015 @06:03PM (#9204356)
Well first, angular is not so great, but that's only one framework.

> once you go outside the stuff that comes with the framework, they start to hold you back more than they help you

If you're talking something like angular, you are correct. If you're talking about something such as Django, not so much.

> nightmare to go into someone else's poorly written framework code and try to maintain it

Try doing it with undocumented custom code.

> especially because frameworks have "magic" where functions are not explicitly invoked

It is your duty to read the source code when all else fails. If you start doing this you will also most likely start seeing a distinct difference between the acceleration of your career vs. your coworkers.

> Every time I've been maintaining someone else's framework code, the project was a mess

you have been working with or following behind poor developers. their custom code would most likely have been equally terrible and rife with bugs.

> I don't see how frameworks are so awesome if so many people use them incorrectly.

So are guns, drugs, genitalia and cars but people use that stuff wrong all the time.

Frameworks are nice for these reasons:

1. they can help you learn how to build your own frameworks

2. they are typically documented (hopefully well-so)

3. the fact that you can identify which mistakes your coworkers made quickly ("oh, they should have used this class, function or file structure because it says so in the docs", vs trying to track down the original dev or read through mountains of source code to figure out what some undocumented thing does).

Edit: i wish i would get told why i'm getting down voted on this rather than just down voted for an unknown reason. Is it the snarky remark that contains the word "genitalia"?

Re:Why I Hate Frameworks (2005) by fsk on Saturday March 14, 2015 @06:10PM (#9204382)
>It is your duty to read the source code when all else fails.

Wait? I have to read the source to use a framework? Which is it? Frameworks are awesome because they are well-documented? Frameworks are awesome because you can read the source when you're fighting some obscure bug?

The problem with reading the framework source is that, the bits of the framework being used are usually only 1%-5%, so now I'm digging through some mountain to find the tiny bit I'm looking for.

If I have a problem with GCC or PHP, I don't (normally) have to read the GCC source or PHP source. Why should I have to read the framework source in order to find out how it works?

Re:Why I Hate Frameworks (2005) by robotkilla on Saturday March 14, 2015 @06:20PM (#9204414)
> Wait? I have to read the source to use a framework? Which is it? Frameworks are awesome because they are well-documented? Frameworks are awesome because you can read the source when you're fighting some obscure bug?

Well, I said "when all else fails". If for some reason you are unable to find the answer to the issue you face within the documentation, then as a developer you have to dive into the source code.

> now I'm digging through some mountain to find the tiny bit I'm looking for

What is the reverse case? Why is custom code different?

> If I have a problem with GCC or PHP, I don't (normally) have to read the GCC source or PHP source. Why should I have to read the framework source in order to find out how it works?

Correct, but if you have a problem with a PHP website, you typically do open up the website's PHP source code and read it. I don't understand how custom code solves the problem of needing to read source code.

Re:Why I Hate Frameworks (2005) by fsk on Saturday March 14, 2015 @06:35PM (#9204464)
With custom code, there usually is just enough code to solve the specific problem. With a framework, there's also the code that comes with the framework that this project doesn't use. The framework is a super-generalized solution, and it comes with a lot of code my use case doesn't need, which makes it a lot harder if I need to trace through the framework to find the problem.

My boss wants the bug fixed in a couple hours. I can't spend a couple weeks reading the framework source so I can fix the bug. (For the zend form example, I wound up writing my own form instead of reusing what was already there.)

If I have a problem with a website written in PHP, I read the PHP source and can fix the problem. If I have a problem with a website written in PHP plus a framework, now I'm expected to read the PHP code PLUS the code for the framework? That's several orders of magnitude more work.

Re:Why I Hate Frameworks (2005) by robotkilla on Saturday March 14, 2015 @06:53PM (#9204528)
> My boss wants the bug fixed in a couple hours. I can't spend a couple weeks reading the framework source so I can fix the bug.

Perhaps you feel I am saying that you must exhaustively read the framework's source code to understand it. I am not. You should have the ability to quickly open up your framework of choice's source code, navigate to the portion that contains the relevant bit of info you need and go from there.

"going from there" sometimes entails referencing a few base classes or figuring out what the result of some custom methods or functions do. It shouldn't require understanding every line of code of the framework.

> now I'm expected to read the PHP code PLUS the code for the framework?

Only if the framework's documentation or the internet fail to answer your question faster, yes.

Re:Why I Hate Frameworks (2005) by dikaiosune on Saturday March 14, 2015 @06:53PM (#9204531)
> With custom code, there usually is just enough code to solve the specific problem.

OK. Sure.

Less sarcastically, tooling is often very helpful when you have to dive into the source of a library.

Re:Why I Hate Frameworks (2005) by untog on Saturday March 14, 2015 @05:47PM (#9204307)
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

That's barely ever the case though. A framework guarantees consistency. You can complain about the Zend framework, but it has documentation you can look up. If an outsourcing company wrote it from scratch you'd have no-one to ask and no further information to pick the code apart.

You're complaining about a framework that doesn't have the feature you wanted, but that doesn't invalidate the concept of frameworks.

Re:Why I Hate Frameworks (2005) by fsk on Saturday March 14, 2015 @05:55PM (#9204333)
I looked at the zend documentation, and it was basically an auto-generated list of function names. I looked through the specific Form class they were using, and it was useless, just a list of function names with no description of what the parameters meant.

The documentation for other frameworks I read was similar.

Actually, they have another project written in a custom framework, which is also a nightmare, but it's less bloated and I was able to figure out how it works by reading the source.

Re:Why I Hate Frameworks (2005) by untog on Saturday March 14, 2015 @05:58PM (#9204343)
So frameworks are bad because one framework you used was more bloated than the other? It's not just documentation - Googling "zend form prepopulate data" returns a ton of Stack Overflow answers.

I'm not saying every framework is amazing, I'm saying that using public, known frameworks means there is a lot more support available for you out there. Not least because these frameworks have had many eyes review them - the custom framework you used was less bloated this time, but there's literally zero guarantee of quality there.

Re:Why I Hate Frameworks (2005) by fsk on Saturday March 14, 2015 @06:04PM (#9204361)
Yeah, I was googling carefully. It wasn't just a zend form, they had derived from the zend Form class and added their own custom logic. After a couple days, I couldn't figure it out, either by looking at their code or the zend documentation.
Re:Why I Hate Frameworks (2005) by dikaiosune on Saturday March 14, 2015 @06:56PM (#9204544)
> frameworks suck because there's too much extra code > custom code is the solution > root problem was caused by undocumented custom code

Huh?

Re:Why I Hate Frameworks (2005) by fsk on Saturday March 14, 2015 @07:10PM (#9204588)
The way they were using zend was that they had a bunch of classes derived from the zend classes that implemented the actual application logic.

On that project, the outsourcing company had some custom framework they wrote that lived on top of zend, so it was the worst of both worlds.

Re:Why I Hate Frameworks (2005) by dikaiosune on Saturday March 14, 2015 @08:40PM (#9204836)
To me it sounds like the issue you faced was one of maintaining someone else's nightmarish code, not necessarily one caused by a framework. I still don't see how the absence of a framework would have made it any easier to deal with this contractor's work. In my (very) limited experience I would wager that if they'd been left to implement all functionality themselves they would have left you much worse off.
Re:Why I Hate Frameworks (2005) by fsk on Sunday March 15, 2015 @01:46AM (#9205517)
I've seen frameworks degenerate into a mess both for outsourcing firm projects, and projects developed internally.

You might say "They were using the framework incorrectly!", but if it's too easy to use a framework incorrectly, then I don't see the value it provides.

Without a framework, it's much easier to trace the control flow. If the code is in 2-5 files that are explicitly included, that's a lot easier to understand than when files get magically included from all over the place.

Re:Why I Hate Frameworks (2005) by icantthinkofone on Saturday March 14, 2015 @06:18PM (#9204407)
Try telling that to most noobish programmers, and all redditors, and see where it gets you.

I can't agree more with all your comments here but I've been downvoted into oblivion for saying the same things.

Re:Why I Hate Frameworks (2005) by fsk on Saturday March 14, 2015 @06:24PM (#9204424)
I haven't seen a single MVC-style framework that I liked. I don't understand how such an awful idea can be so popular. It sucks to be in an industry that chases fads over substance.

MVC frameworks I have tried at work:

Java/Spring/jsp/beans

Ruby on Rails

angular.js

zend

All were awful.

I do like libraries, things you can plug and play and use where you want (like jQuery). A framework demands that your whole application be written in its style.

For example, the Ruby on Rails project used a legacy database, which was not written in primary key autoincrement integer Rails style. That project was a disaster and that startup failed. With financial data, demanding the primary key to be autoincrement integer forces a lot of unnecessary joins, when you already have natural keys like Ticker or CUSIP.