Live data from Hacker News

Frameworks are for hacks, libraries for seeds

sencjw.com

1–10 of 50 posts

Re: Frameworks are for hacks, libraries for seeds

#2
It depends on the language. For example, in PHP there's the 'framework interop group'[1] who are working on a set of standards that enable developers to easily take code from one framework and use it in another (so long as it's written to the standard). Framework modules become libraries. So you choose the framework that suits your project best, develop your code in that style, but you're able to pull in modules from other frameworks as and when you need them.

It seems to be a really good idea. It solves the exact problem that the author has.

[1] http://www.php-fig.org

Re: Frameworks are for hacks, libraries for seeds

#3
Great article. It puts into words something that I've been feeling for many years, but have been struggling to express.

It's not that frameworks are bad; they quite clearly have their place. It's that they are short term hacks, and as such there is a time and a place for using them, but they aren't a long term solution to a problem.

Re: Frameworks are for hacks, libraries for seeds

#5
When you're using libraries, you're actually making your own custom framework.

Because a framework is basically a set of libraries that work together to help you get to a certain goal.

If there's already a framework that helps you get to a certain goal, it can save you a lot of work to use that existing framework instead of making your own. It can also save you a lot of security issues.

But if your requirements don't really connect to the things existing frameworks provide, you'll have to build your own custom framework by collecting all the libraries you need and making them work together the way you want. Maybe you can make a framework out of it so the next person that has the same requirements as you doesn't have to go through this process again.

Re: Frameworks are for hacks, libraries for seeds

#6
Libraries by definition have a narrower scope and hence are more easily adapted to new situations.

Frameworks by their nature affect the whole codebase.

This is the low-coupling/high-cohesion benefit of libraries as seen in many places in software engineering.

A codebase with low coupling is inherently more flexible and maintainable. Libraries and well defined, sensible interfaces are critical to good engineering.

Re: Frameworks are for hacks, libraries for seeds

#7
post #5

When you're using libraries, you're actually making your own custom framework. Because a framework is basically a set of libraries that work together to help you get to a certain goal. If there's already a framework that helps you get to a certain goal, it can save you a lot of work to use that existing framework instead of making your own. It can also save you a lot of security issues. But if your requirements don't…

Because a framework is basically a set of libraries that work together to help you get to a certain goal.

Arguably a framework is a lot more than just a set of libraries - it's a formal specification for how you layout your code, from what directory you put a class in to how you do your database migrations. Dropping a few libraries in to an app won't make you work in a specific way. Using a framework will.

Re: Frameworks are for hacks, libraries for seeds

#8

Great article. It puts into words something that I've been feeling for many years, but have been struggling to express. It's not that frameworks are bad; they quite clearly have their place. It's that they are short term hacks, and as such there is a time and a place for using them, but they aren't a long term solution to a problem.

Depends on the problem. If my problem is that I want to sell stuff on a website, or have a blog that lets me promote my organisation, etc, then a framework is a great solution even in the long run.

Re: Frameworks are for hacks, libraries for seeds

#9
post #5

When you're using libraries, you're actually making your own custom framework. Because a framework is basically a set of libraries that work together to help you get to a certain goal. If there's already a framework that helps you get to a certain goal, it can save you a lot of work to use that existing framework instead of making your own. It can also save you a lot of security issues. But if your requirements don't…

> Because a framework is basically a set of libraries that work together to help you get to a certain goal.

In theory, sure, and as another poster said that's exactly what the PHP-FIG (PHP Framework Interoperation Group) have achieved over the past year or two. However, in practice, the big frameworks that most developers and employers use give you much more than just a set of easily plugged together libraries, typically enough more that you end up building software on-top of that framework, and extracting your product out onto another or swapping a library out becomes nigh-on impossible.

Re: Frameworks are for hacks, libraries for seeds

#10
Frameworks are also good in a long run. When a new member on the team starts to work on a project, it is much easier to pick up on some popular framework like Rails than your own one. First, because you can easily find a guy who worked with Rails framework and knows it inside out, unlike yours custom-written one. Second, the whole infrastructure, like regular updates, documentation and community is also a major factor.
Post reply on HN