Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

A framework calls your code, a library is called by your code.

In the long run, when you start a web application using packages like "net/http" and the gorilla toolkit, sooner or later it becomes framework-like, because you start to group your code together, you refactor it and make it easiliy extendable _for the app you are writing_. So, every app becomes a framework on it's own. And what I like about Go is the fact, that building such mini framworks is easy, and does not take much time - but the most important aspect is, that you don't need a huge framework that does all the things.



>A framework calls your code, a library is called by your code.

Exactly. Very subjective, but I lean towards library with golang, because it seems more natural, and the bigger a framework gets, the more you have to do work for it to get it to do work for you.


> A framework calls your code

That's not a bad thing. Delegation is a very useful composition pattern.


A colleague of mine has often said, "Regardless of whether you choose to use a framework or not, eventually you'll be regretting your decision."




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: