3 ms·
The clojure community has great meme: libraries over frameworks. In my mind java is notorious for having frameworks that box you in. You have to think like the
by babs474 13y ago
The clojure community has great meme: libraries over frameworks.
In my mind java is notorious for having frameworks that box you in. You have to think like the framework or you will have major problems. Think spring/hibernate.
The library over framework idea is that external tools that you use should solve a problem and be composable. You should be able to mix and match easily if you want to throw something away or introduce something new.
Composable libraries can reduce NIH and keep you flexible.
- nightski 13y agoTo be fair though, it is more than just a mindset. Creating composable software in Java is non-trivial if not impossible as compared to functional languages. Even if you set out with the goal of creating a composable library in Java, it is very hard to achieve that.
- blt 13y agoChoosing to use a library should still be a carefully weighed decision. You often must commit to the library's data structures, or write a bunch of boilerplate wrapper code to insulate them from the rest of the system. I imagine this is less of a problem in languages with dynamic typing or golang-style interfaces. If you're using only one or two functions from a big library, it might not be worth the overhead. A lot of Boost libraries are super complicated and really turn me off when I want something simple like a directory scan or a synchronous socket. Sadly there is often no alternative because the C++ community has thrown so much weight behind Boost. I wish C++ had a module/package system and a simple version of Boost that only covers the most common 90% of functionality. But that leads to another problem with libraries: when you suddenly hit the limits and need to completely ditch them for something more powerful. I like libraries but it's not always an easy choice to use one.