What are some proper books for learning C?
What are some proper books for learning C?
I have a little bit of theoretical programming knowledge already, but what are some proper book suggestions for those starting to program C? Is ANSI K&R a good idea or not? I don't think it will matter, but I asked for an opinion.
Re: What are some proper books for learning C?
K&R 2nd ed.
C: A Reference Manual 5th ed. by Harbison & Steele Jr.
C99 + TC1 + TC2 + TC3, WG14 N1256:
http://www.open-std.org/jtc1/sc22/wg14/ ... /n1256.pdf
Rationale for C99:
http://www.open-std.org/jtc1/sc22/wg14/ ... eV5.10.pdf
The New C Standard: An Economic and Cultural Commentary:
http://www.knosof.co.uk/cbook/cbook.html
C: A Reference Manual 5th ed. by Harbison & Steele Jr.
C99 + TC1 + TC2 + TC3, WG14 N1256:
http://www.open-std.org/jtc1/sc22/wg14/ ... /n1256.pdf
Rationale for C99:
http://www.open-std.org/jtc1/sc22/wg14/ ... eV5.10.pdf
The New C Standard: An Economic and Cultural Commentary:
http://www.knosof.co.uk/cbook/cbook.html
Re: What are some proper books for learning C?
I think the toolchains are also very important. I have no deep expertise in C, so I hope for available toolchains review and recommendations. And may be some OS specifics like ELF or Portable Executable, DLLs vs SOs, POSIX vs Windows API and so on. But may be it's not the osdev.org where such information should be, then some links are very appreciated.
My previous account (embryo) was accidentally deleted, so I have no chance but to use something new. But may be it was a good lesson about software reliability
Re: What are some proper books for learning C?
Is C absolutely necessary for a aspiring OsDever? I do think it's interesting to learn, don't get me wrong.
Re: What are some proper books for learning C?
No, you can write an OS in assembly language.SeanMc wrote:Is C absolutely necessary for a aspiring OsDever? I do think it's interesting to learn, don't get me wrong.
Is assembly absolutely necessary for an aspiring OsDever?
No, you can write an OS in machine code.
Is machine code absolutely necessary for an aspiring OsDever?
No, you can hire someone.
Re: What are some proper books for learning C?
Well, I guess that answer speaks for itself.alexfru wrote:No, you can write an OS in assembly language.SeanMc wrote:Is C absolutely necessary for a aspiring OsDever? I do think it's interesting to learn, don't get me wrong.
Is assembly absolutely necessary for an aspiring OsDever?
No, you can write an OS in machine code.
Is machine code absolutely necessary for an aspiring OsDever?
No, you can hire someone.
Re: What are some proper books for learning C?
Well, then you can learn something else. But your starting point was about learning C. Strange transition.SeanMc wrote:Is C absolutely necessary for a aspiring OsDever? I do think it's interesting to learn, don't get me wrong.
My previous account (embryo) was accidentally deleted, so I have no chance but to use something new. But may be it was a good lesson about software reliability
Re: What are some proper books for learning C?
I've written an OS, which is self-hosting, in an assembly language. And believe me or not, I know nothing about C. I can (barely) understand the code written in C, though. I've tried several times to learn it but it's too hard and probably useless. Just assembly is enough for me.SeanMc wrote:Is C absolutely necessary for a aspiring OsDever? I do think it's interesting to learn, don't get me wrong.
Re: What are some proper books for learning C?
I believe you. Been there.muazzam wrote: I've written an OS, which is self-hosting, in an assembly language. And believe me or not, I know nothing about C. I can (barely) understand the code written in C, though. I've tried several times to learn it but it's too hard...
I don't think I could find a job in low-level areas (OS, embedded, etc), where I could get away with just assembly language. (NASA is looking for living dinosaurs who can program in assembly, FORTRAN and COBOL.) I've been cashing my C, C++ and assembly knowledge and skills for the past 15 years or so.muazzam wrote: I've tried several times to learn it but it's too hard and probably useless. Just assembly is enough for me.
Nevertheless, I too had a tough transition to C. I learned my first programming languages in this order: ZX Spectrum BASIC, Z80 assembly, Borland/Turbo Pascal, i8051 assembly, x86 assembly, C. Like I said earlier, C is awkward for historical reasons. This is of little help to a beginner, of course, but C is not awkward for the sake of being awkward or keeping noobs out. The titles and the links shown above should be sufficient for learning proper C. But you also need to write lots of code to internalize the language. If you have a friend, who knows C well (preferably, very well, because it's not uncommon to learn bad habits from someone knowing it poorly or having major understanding gaps when it comes to things like undefined behavior), then their help can be tremendous. And, IMO, you don't need a lot of help. You probably just need some help with navigating through a few bad places. Otherwise the language is rather simple.
Re: What are some proper books for learning C?
Passive knowledge is pretty much a must because otherwise you won't understand most code examples. But you can always write your own code in a different language - not only assembly, which has already been mentioned, but also other high level languages. That said, I did write some kernel code in Pascal and while it's definitely workable, it's not quite as smooth as with C.SeanMc wrote:Is C absolutely necessary for a aspiring OsDever?
- Schol-R-LEA
- Member
- Posts: 1925
- Joined: Fri Oct 27, 2006 9:42 am
- Location: Athens, GA, USA
Re: What are some proper books for learning C?
The wiki does a fair job of covering the possibilities and pitfalls of using a language other than C or assembly for OS dev. See the Languages for OS Development and Developer Archetypes: Alta Lang entries for advice on this subject and critiques to this approach.
You can also look at the Bare Bones pages for Ada, D, Pascal, and FreeBasic. Someone probably should write up BB pages for Rust, Go, and C# as well, given the interest in them, but that's up to contributors familiar with them.
My own approach is rather unusual, in that I am writing my own (unconventional) assembler and designing a new language that will target it, with OS dev being the key but not sole purpose for them. My OS will be in layers, and much of the kernel for the OS proper will be in assembly.
You can also look at the Bare Bones pages for Ada, D, Pascal, and FreeBasic. Someone probably should write up BB pages for Rust, Go, and C# as well, given the interest in them, but that's up to contributors familiar with them.
My own approach is rather unusual, in that I am writing my own (unconventional) assembler and designing a new language that will target it, with OS dev being the key but not sole purpose for them. My OS will be in layers, and much of the kernel for the OS proper will be in assembly.
Rev. First Speaker Schol-R-LEA;2 LCF ELF JAM POEE KoR KCO PPWMTF
Ordo OS Project
Lisp programmers tend to seem very odd to outsiders, just like anyone else who has had a religious experience they can't quite explain to others.
Ordo OS Project
Lisp programmers tend to seem very odd to outsiders, just like anyone else who has had a religious experience they can't quite explain to others.