26 ms·
Teach Yourself C in 24 Hours (1997)
- rosenbus 9y agoUnfortunately I only have 20 hours to learn C.
- basicplus2 9y agoWhy would anyone vote this down?
- ggghvggtff 9y agoBecause someone has to keep this place from becoming Reddit?
- fermienrico 9y agoAny comment that doesn't add to the discussion needs to be downvoted (Yes, I know the irony of me posting this comment).
- jwilk 9y agoFrom the HN guidelines: Please don't comment about the voting on comments. It never does any good, and it makes boring reading.
- maremmano 9y agoJust skip the introduction part
- stesch 9y agoBut we have only fourteen hours to save the Earth!!
- sirodoht 9y agoThis was one of the first books I read on C and programming I general! I remember I wasn't happy at all with it, so I gave up on it a bit after the middle. It must be pretty old.
- ci5er 9y agoI've never understood why anyone (in the day) would read anything other than K&R (or ANSI 89). Were those not good enough to learn C?
- bluedino 9y agoWhen I was a kid you had maybe 2-3 books on C at the local bookstore, and they were all terrible. But sometimes they came with a (crippled or obsolete) compiler, so that was a huge plus. The book I learned from was C in 12 lessons by Greg Perry, which I found is still on the shelves to this day, 25 years later. Terrible book. The bad part is you don’t learn how to do anything other than little bit of simple input and output and loops, and the worst explanation of pointers you can think of. You can’t do anything in the base language, but that’s just the way C works, you need a platform specific book to learn to do anything worthwhile. This is why the 80’s assembler books were so useful and inspiring. For what you end up learning in the book you could have actually spent the 24 hours (or less) using something like Python, where you’d be way more productive and hundred times less confused. Actually doing work instead of messing with pointers and fscanf().
- ci5er 9y agoHmmm. Thank you for your response. At this point, I think that I must say that your brain and my brain must operate very differently. To me, messing with pointers is the beauty of all that - and it so easily translates to the assembler-lang-brain. EDIT: Did you not find the K&R explanation of pointers sufficient?
- spc476 9y agoBack in the 80s, "Program in BASIC" didn't exist (well, maybe). You had "Program BASIC for the Atari 400/800" or "Learn BASIC for the Commodore-64". I even remember books to learn C for specific platforms like the PC or Amiga. Today, a generic book on <programming language> will have to spend a significant portion of time explaining platform specifics. Granted, this is really only three platforms these days (Windows, Mac and Linux) but they are significantly different to be a pain to have to explain in a general purpose book.
- p4bl0 9y agoI only opened the first chapter, but I certainly won't recommend a book where things such as "There are two types of programming languages: compiled language and interpreted language." are written.
- kevincennis 9y agoWould you prefer “one of the many ways to categorize languages is into buckets of either compiled or interpreted”?
- p4bl0 9y agoNo, that is also wrong. Even if you only consider compilers and interpreters (in real life there are many in-betweens: bytecode/VW, JIT, etc.), a language is not either interpreted or compiled. Maybe its reference/canonical implementation is an interpreter or a compiler, but that's all. What would stop anyone from writing a C interpreter? Or a Python compiler? Now consider OCaml, which canonical distribution comes with the `ocaml` interpreter, and the `ocamlc` and `ocamlopt` compilers: how do you classify the language?
- harry8 9y ago"ocaml does both" wfm. This is an introduction, details will be glossed over.
- p4bl0 9y agoSorry, I don't understand, what does "wfm" mean? > This is an introduction, details will be glossed over. Maybe, but I really don't like this. Sometimes it is necessary to simplify things (at least in the first place) to teach them, but it is very rarely the case that it is necessary to say something actually wrong. For example I think it is totally acceptable to ignore the existence of VM and JIT in this chapter, because explaining what they are requires knowledge that the targeted readers don't yet have. But I don't see what good it does to say that the two types of languages are compiled languages and interpreted languages. It may even be counterproductive because the same paragraph which explains what a compiled language is as opposed to an interpreted one ends with this sentences: “You can think of the C language as a compiled language because most C language vendors make only C compilers to support programs written in C.”. This sentence is now confusing for the inexperienced reader, while it is the only acceptable one in the paragraph. It would not have been more complicated to explain that languages can be implemented either with a compiler or an interpreter, then explain what is the difference between the two (this is already done), and then finish with that same sentence :).
- vesche 9y agoLooks to be a useful resource, but I hate the title. Why? http://www.norvig.com/21-days.html http://www.norvig.com/21-days.html
- krylon 9y agoThank you, I was thinking the same thing. ;-)
- lancebeet 9y agoThe "in 24 hours" part is of course just book title clickbait. I read Sams' C++ book and the 24 hours figure is making lots of assumptions such as general familiarity with programming, spending >10 times more time doing exercises and understanding the material and so on. And after all this, you will still just be a beginner since you will have no actual experience. It naturally also leaves out lots of material that isn't judged necessary to fit into the 24 hour time frame (though this may not be the case for the C book since the language is so much smaller). As for this particular link, all image links in the text seem to be broken, and a pdf of the book can be found elsewhere.
- ukyrgf 9y agoI checked out Sam's Learn C++ in One Hour a Day from my local library and the librarian just frowned and said, "oh this looks miserable."
- chmaynard 9y agoBetter yet, teach yourself how to write clickbait headlines by submitting to Hacker News every web page you can find during a 24-hour period!
- spapas82 9y agoI totally recommend Sam's Teach Yourself C++ in 21 days by Jesse Liberty (I found it here http://101.lv/learn/C++/ http://101.lv/learn/C++/). It's a great book to learn not only the basics of C++ (which, since it is a rather old book may be not very good for this and you should probably learn C++ by using a more recent book) but, more importantly, the basics of OOP, i.e encapsulation, inheritance and polymorphism/late binding. The animal examples are excellent and I actually use them even today when I want to explain to somebody these concepts.
- cup-of-tea 9y agoI would prefer that someone learnt it in a few weeks using K&R followed by study of the comp.lang.c FAQ for more useful and some obscure parts of the language.
- fermienrico 9y agoI think there is a fundamental problem that isn't addressed in teaching people how to code. The problem is that every single course/book talks about the tools of the trade but not the art. Most books start with: - Variables - Loops - Functions ... etc. In doing so, it is simply overloading the student with syntax memorization and conceptual overload. It bothers me so much that very few books (Kernighan) talk about WHY. WHY. WHY is a variable needed? WHY is a function needed? WHY do we use OOP? Every single book out there jumps straight into explaining objects, how to create them, constructors, blah blah blah. No one fricking talks about what's the point of all this? Teaching syntax is like muscle memory for learning Guitar. It is trivial and simply takes time. Syntax - everyone can learn and it is only one part of learning how to code. Concepts are explained on their own without building upon it. The famous book for Python (Learn Python the Hard Way) explains Loops in its own chapter and provides examples. But, they never build up on the idea. There should never be a separate chapter for variables, loops, functions, etc. Chapters should be: Chapter 1. Setting up the problem (Goals) Chapter 2. Defining Inputs/Ouputs (API) Chapter 3. Automating something (Variables, loops) Chapter 4. Abstraction of something (Functions) Chapter 5. More automation! (Combing all) Chapter 6. Splitting code into multiple modules (Growing the project) Chapter 7. Objects (New type of abstraction, OOP) Chapter 8. Reusability of Classes (Inheritance) Chapter 9. Safety/Security (Encapsulation, tie it back to Chapter 2.) etc... Best coding resource I've found is things like: NAND to Tetris [1] Handmade Hero [2] The Nature of Code [3] Harvard CS50 [4] How to Design Programs [5] (thx minikomi) This is learning how to produce music. Not learning the F chord. Teaching how to code is fundamentally broken and very few books/courses do it well. References: [1] http://nand2tetris.org/ http://nand2tetris.org/ [2] https://handmadehero.org/ https://handmadehero.org/ [3] http://natureofcode.com/ http://natureofcode.com/ [4] https://cs50.harvard.edu/ https://cs50.harvard.edu/ [5] http://www.htdp.org/ http://www.htdp.org/
- minikomi 9y agoI’d throw How To Design Programs (2) in there too.
- fermienrico 9y agoThanks. Edited and added links. If anyone else has suggestions, please reply as it is very hard to find these resources!
- throwaway2016a 9y agoWow this brings back memories. This is the book I first learned C with. Bought it at a video game store and it came with a install disk for the Borland C compiler taped to the back page.
- m3kw9 9y agoI can yeah you C in 24 seconds, but how much you learn would be limited to 24 seconds of material
- codewardenh 9y agoMany here will rush to trot out the usual "but, we should all be using { fashionable language of the day | Rust } instead of C". Maybe. Maybe not. But there is something of a sweet spot with C and after all these years it persists due to that sweet spot despite some of the potential downsides.
- crispinb 9y ago> "we should all be using" Anyone capable of thinking that thought (about any programming language) is so divorced from the vast range of pragmatic contexts within which programming happens, they might as well be shipped off to a monastery to live out their days.
- zappo2938 9y agoI've been coding JavaScript and PHP for 6 years. I know the advanced topics of both languages. I'm in the office on a Saturday right now asking the question I'm always asking, "Where does this go?" I wish I knew the answer so I can go home -- the really important part of coding can't be learned in a day, a month, 12 weeks at a bootcamp, or after 6 years.
- GnarfGnarf 9y agoI leaned C from the Borland book that came with Turbo-C. A masterpiece of clarity and conciseness. I found K&R too low-level. I don't really want to know how they implemented strcpy().
- pjmlp 9y agoBorland manuals were great!