Tell me more ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

What do you consider to be important features to include in the standard library of a general-purpose programming language? Should it have GUI toolkits and other such larger things? Are cryptography, networking, regular expressions, database integration and XML parsing supposed to be found as features in a standard library?

Do you prefer a small standard library as found in C and then eventually filling in the gaps using 3rd party libraries (or even implementing most features yourself) or do you want the kind of massive standard library which Java has? Something in-between?

Basically, what should and shouldn't be found in a standard library?

share|improve this question
4  
Jokey answer: It should only have what I need in it ;) Contractor's answer: it depends. – James Love Feb 25 '11 at 15:44
1  
The way this is being asked and comments suggesting the direction of the question lead me to conclude that this question is not constructive and instead polling for ideas. If there is an actual problem or question that can be asked in such a way that it can be answered in a Q&A format, please make that edit to redirect this question and its answers. – MichaelT May 14 at 16:18

closed as not constructive by MichaelT, user16764, Bart van Ingen Schenau, Robert Harvey, gnat May 14 at 21:52

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or specific expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, see the FAQ for guidance.

6 Answers

up vote 5 down vote accepted

A general purpose language is hopefully suited for a wide variety of uses. A standard library for such a language should be just as flexible. Ideally it should be both large AND small.

A general purpose language has to be able to do just about anything, so it should have library support for just about anything, including the items you mentioned: graphics, networking, regex, databases, and the kitchen sink.

However (especially today), the language should be usable in large or small (think mobile/embedded) environments. Therefore the library should be modular, with a very small core (like the clib) and higher level modules that can be included or excluded by an environment's runtime.

In short, my answer to your question "what should and shouldn't be found in a standard library?" for a general language is: Everything that a general-purpose programmer needs. And it should be flexible enough for that definition to change over time.

share|improve this answer

Big standard libraries have some advantages. There is a uniform way of doing things, so there is a lot of documentation and examples available for it. Big libraries usually also means consistency, you know where to expect certain implementations.

Therefore I believe standard libraries should be big, rather than small. Especially with entire frameworks like Java and .NET which are reused by so many applications. You only have to install it once, so you don't even have the 'disadvantage' of wasted diskspace when certain features of the library aren't used.

share|improve this answer

It really depends on the philosophy of the language. For example, Python's philosophy is that there should be one way to do everything, so it makes sense that the standard library would be large.

share|improve this answer
What philosopy for the STL do you prefer? – Anto Feb 25 '11 at 15:48

Smaller libraries were probably important a few decades ago because of the smaller amount of memory available then. With memory sizes increasing exponentially, and other advanced features in runtime(like dynamic loading), bigger libraries make more sense. However, portability and efficiency may become concerns with some kind of libraries (e.g. graphics etc.).

On the whole, I would prefer bigger libraries, simply because they make life much easier for everybody.

As to what should be present, it should be enough to follow the 90-10 rule. Include the 10% most popular libraries that 90% people need. For the rest 10%, people may rely on external libraries or use other frameworks(MATLAB for engineers etc.).

share|improve this answer
Smaller libraries were probably important a few decades ago because of the smaller amount of memory available then -- how would that matter? – Karl Feb 25 '11 at 16:19
When C was developed about 30-40 years ago, both memory and storage space was limited. So having bigger libraries would require more floppies etc. I do not speak of this from personal experience though, but it is an educated guess. – apoorv020 Feb 25 '11 at 16:25
The C stdlib was kept simpler on purpose to make the language simpler to understand. I don't think primary and secondary memories were a constraint; let's wait for someone to confirm. – Karl Feb 25 '11 at 16:46

Language's standard library should contain everything you (as language's developer) have

  • Time
  • Resources
  • Willpower
  • Knowledge

to

  • Develop
  • Debug
  • Test
  • Document
  • Support

This is why it takes 50 MS employees to change a lightbulb and why many open languages have terrible standard library.

share|improve this answer

What should be included? Obviously, whatever is considered standard in the dev communities at the time of release.

share|improve this answer
If everyone follows the standard, it will never change – Anto Feb 25 '11 at 16:25
1  
@Anto: Yes it will. If enough developers are using the standard library with certain needs normally being filled by third-party libraries, those libraries will be considered standard, and hence candidates for standardization. That's one way standard libraries expand. – David Thornley Feb 25 '11 at 18:00
@Anto - My point was that standards evolve over time. E.g. string manipulation functionality is quite "standard" these days, which was not the case, say, 25 years ago. – Jas Feb 25 '11 at 18:23

Not the answer you're looking for? Browse other questions tagged or ask your own question.