Should programmers prefer making wide libraries or thin libraries?
Posted
by
Telastyn
on Programmers
See other posts from Programmers
or by Telastyn
Published on 2012-06-29T12:45:59Z
Indexed on
2012/06/29
15:22 UTC
Read the original article
Hit count: 360
For classes and functions, it is clear cut: each should do only one thing.
For libraries though, this is less clear. If you have a library with collections, it might have multiple collections. It might have useful functions like sorting, which aren't strictly collection based but users would expect. Each of these results in a 'wider' library.
On the other side is having a library for the specific collection type and/or with little built-in functionality. If you want a queue, it gives you a queue. If you want to sort that list, then the library lets you do that yourself.
What is the best practice here (if any)? I can see arguments for each side.
© Programmers or respective owner