Take the 2-minute tour ×
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.

I'm currently studying C from K&R book. In some examples the authors introduces new functions, my question is, to master C is necessary to know all the functions that are part of the standard library?. Suppose that is an extra-time cost to learn.

NOTE: I want to master the language, and as K&R says; the standard library is not part of the language.

Thanks

share|improve this question

closed as primarily opinion-based by gnat, Bart van Ingen Schenau, BЈовић, Kilian Foth, Dan Pichelman Aug 7 '13 at 16:05

Many good questions generate some degree of opinion based on expert experience, but answers to this question will tend to be almost entirely based on opinions, rather than facts, references, or specific expertise.If this question can be reworded to fit the rules in the help center, please edit the question.

1  
K&R C is different than modern C. The standard library from the days of K&R C is not the same as it is today. You are studying the equivalent of biblical Greek. You can master it, but you may find it not that useful for communicating with the Greeks today. –  MichaelT Aug 5 '13 at 20:06
1  
@MichaelT current editions of 'The C Programming Language' by K&R actually use ANSI C rather than 'K&R C'. The differences between ANSI C and C99 are nowhere near as significant as the differences between 'K&R C' and 'ANSI C'. A current edition of the K&R book is fine to learn from. –  Charles E. Grant Aug 5 '13 at 20:15
    
Specifically I'm reading the 2nd edition, and in some pages, K&R indicates that the ANSI C is comming up (to the date of the book) and eventually, the C on the book is the ANSI C with a little variations. @MichaelT maybe you refer to the first edition of the book. –  Wronski Aug 5 '13 at 20:17
    
@CharlesE.Grant also my book. –  Wronski Aug 5 '13 at 21:11
    
@CharlesE.Grant My bad, memory failed me. I just checked and it seems you are right. I've deleted my incorrect comment. –  Andres F. Aug 5 '13 at 23:14
show 1 more comment

4 Answers

The C standard library is tiny compared to most other widely used modern languages - take a look at Python, Java or C#/.NET. To really drive the point home, consider that the C standard library is only about 100 functions while each of the above is made up of hundreds of classes, each of which has dozens of functions inside. Knowing the difference between strcpy() and strncpy() is just part of knowing how to effectively use C and is in no way comparable to a Java programmer memorizing the inner workings of `javax.print.attribute.standard.MediaPrintableArea' (or even knowing it exists).

Knowing the standard library is a starting point (with the possible exception of setjmp() and friends) to start doing things competently. Beyond that, you're going to have to learn the system calls for the OS you're working with, build tools, preprocessors, third party libraries and so on before you can even start thinking about 'mastery' of the language.

share|improve this answer
1  
In fact, C programmers must know a lot about algorithms and implementation details, because in C one would be forced to implement a lot of stuff. Learning about a lot of open-source C libraries will also be a useful starting point. –  rwong Aug 6 '13 at 0:31
    
Regarding setjmp: users of jpeglib would be required to know how to use it. –  rwong Aug 6 '13 at 0:32
add comment

To be a "master" C programmer, you may not necessarily need to memorize every function in the standard library, but you need to know what to look for and when. A master isn't someone who has memorized how to use all the tools for the job, but is someone that knows what's in the toolbox, how to quickly pick up and use any of the tools by reading the documentation, and the relative upsides / downsides of the available tools.

share|improve this answer
    
Thanks. I agree with you in the fact that a master is someone that knows what's in the toolbooks, but an important part is how things are implemented or how works, and a master can't simply take things without knowing how things works. –  Wronski Aug 5 '13 at 21:29
add comment

To master C programming language is necessary to have a full knowledge of the standard library?

No, it's not necessary, but you're going to.

Suppose that is an extra-time cost to learn.

This isn't a very good approach to learning. You are treating your time like a precious resource and you're trying to allocate it sparingly, learning only what has the biggest bang for the buck, and skipping everything else. Frankly, I don't think there are any shortcuts. If you never charge full-speed into a Turing tar-pit, or butt heads against type-casting, or lose your way with pointer confusion, then I don't think you can "master" such things. I think doing stupid things and learning some cruft is an essential part of learning. If you don't fall into those traps now, you're just setting yourself up for a larger fall later. Go tackle stdlib with a voracious appetite. You have to approach new code with new functions not as something to try and side-step, but as opportunity to expand your repertoire.

In short, learn as if you were going to live forever.

share|improve this answer
    
In fact, all the days I spent 5-10 hours reading and programming (and thats the reason I don't go to fast with the reading). I'm slower in the book because I'm put in practice the acquired knowledge and take my time to implement a lot of exercersises with a lot of personal variations, and in some cases fixing errors and thinking a lot how things works. I've seen your reputation and I can check the good advise that you give me "I think doing stupid things and learning some cruft is an essential part of learning". Thanks, I'm going to spent the necessary time for learning the library. –  Wronski Aug 5 '13 at 21:17
add comment

Language itself which comprises the syntax rules, semantics and program structure, will not help accomplish anything significant unless one is planning to write the functionality provided by the library by himself.

share|improve this answer
2  
Your answer packs a potentially great deal of wisdom in a small number of words. Regrettably, many newcomers will not see the wisdom of your answer without additional clarification. Please consider editing your answer and expanding upon it. –  GlenH7 Aug 6 '13 at 2:32
add comment

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