News for hackers. Stuff that matters.
Re:Why I hate frameworks (2005) by TeMPOraL on Tuesday October 04, 2016 @01:41PM (#12637484)
> and helped me realise that what I want to do is write code that calls, not code that is called. I want to own main().

It took me a while to clarify this in my head, but I feel exactly what you wrote here - I want to own main(). A framework is something that calls your code. A library is something you call. I avoid frameworks whenever possible.

Re:Why I hate frameworks (2005) by oxymoron on Tuesday October 04, 2016 @02:46PM (#12638137)
I also very much agree with this. I think it might be a sign of something deeper, though. When I design a library, I keep in mind that it might be used in a variety of contexts applied in a multitude of styles. In contrast, when I author a framework I expect the users to adhere to the principles of the framework. Whoever owns main() gets to dictate the terms.

For a beginner or intermediate developer, this might be a relief. Once you reach the level where you have a good intuition for how to do things well, your primary focus will be the minimizing of complexity, and I can never shake the feeling that frameworks stand in contradiction to this goal. After all, they were designed for maximum generality, but are the abstractions envisioned really the ones you require?

That's not to say that everyone should embark on a journey to build their own 50kloc framework. You might want to consider skipping the framework if 500 lines of compact, well-designed and thoroughly documented code can do the same job, though. And you can still use libraries for the truly complex parts.

Re:Why I hate frameworks (2005) by greenshackle2 on Tuesday October 04, 2016 @02:15PM (#12637850)
Ah, yes that clarifies a problem I've had trouble with too. I work with a complicated framework, and I often end up having to explain why a seemingly simple change to x is actually complicated, even if I'm looking at the code for doing x right now and could trivially make the change.

x is at the bottom of a framework, the top of which I didn't code or fully understand, so I'm not sure exactly who's calling this code under what conditions - I have to read and analyse an edifice of code to make sure the change is safe. Or just do the change and hope the integrated tests catch any breakage.

Re:Why I hate frameworks (2005) by quantumhobbit on Tuesday October 04, 2016 @01:53PM (#12637621)
I like this definition of libraries vs frameworks by who owns main() too.

I've always said that libraries add functionality to the language, whereas frameworks are half-assed DSLs.

Re:Why I hate frameworks (2005) by m_mueller on Wednesday October 05, 2016 @01:46AM (#12641788)
What about frameworks that let you keep main, but require to take over your build system? I admit I'm guilty of one of those as well [1], but only because I don't see a more simple solution in terms of usage.

[1] https://github.com/muellermichel/Hybrid-Fortran

Re:Why I hate frameworks (2005) by TeMPOraL on Wednesday October 05, 2016 @05:55AM (#12642661)
To me this looks closer to library than framework, by the virtue of augmenting your code instead of hijacking the control flow completely.