Earlier quoted context omitted.
how about 'if you are proficient at another language, feel free to skip to chapter x'? and put the generalized stuff at that point
If you really are that proficient, you should be able to figure out what you can skip.
Learn C The Hard Way
141–150 of 260 posts
Re: Learn C The Hard Way
#142Ohloh says I've changed at least half million lines of C code ( https://www.ohloh.net/accounts/rhp/positions/total ) Play me a tiny violin ;-) What kinda bugs me is that whenever people go to teach C, they make out like it _has_ to be a low-level exercise, as if writing in C suddenly means you can't use abstract data types or object-oriented style or name your functions properly or have Unicode support. For example,…
I'm glad you got so much about how my book is written from a few paragraphs in an unfinished manuscript for it.
Re: Learn C The Hard Way
#143Earlier quoted context omitted.
I think the level of self-promotion and/or other-people-promoting-him is the key factor. Not really the supposed productivity. I know many people who get a lot done, both for day jobs, for contract work, as a hobby, as entreprenurial ventures, etc. but 99.9% never hits the front page of HN on a regular basis like Zed's activity seems to. Which doesn't lessen what he does and his skills, but it does pull back the came…
I personally have no idea why this stuff hits this site that often. Take this for instance: It is a half-finished manuscript that I announced in a tweet to people who follow me on twitter and asked for it. Already at the top of this set of comments is a dickhead saying he's such a bad ass 'cause he's changed "half a million lines of C code" and he thinks I'm not writing the book correctly because I'm being too low le…
-- Zed Shaw, backpedaling when his angry schtick gets called out by the community
Re: Learn C The Hard Way
#144Earlier quoted context omitted.
> Oh my god so many configuration settings! There are many alternatives for you that offer 1click build/deployment.
There are so many, in fact, that choosing one becomes a confusing array of choices in itself.
Just google for "msvcrt_win2000.obj" and see the madness (yes, it's about using MSVCRT.DLL instead of later MSVC libs, and still get your shit working on 2000 or XP). I did that just last few hours :)
Re: Learn C The Hard Way
#145Earlier quoted context omitted.
C shouldn't be used for anything other than low level programming these days. There are other higher level programming language that would make your job a whole lot easier. Some programmers, like me, are stuck maintaining legacy C application code, but I wouldn't wish that fate for new programmers looking to learn C as another tool in the belt.
Other uses of C besides low level programming is: 1. Building static libraries. 2. Building so and dll. 3. Binding those so/dll with higher level languages like Ruby, Python, Perl and PHP. That is my main use of C these days. I always write the IO, user interface code in higher level languages and put all processing code in a so or dll written in C.
Having not to deal with exceptions, STL libs, makes life a bit easier.
Re: Learn C The Hard Way
#146When I first learned C, I did so under DOS, an environment in which you could declare a pointer to video memory, make a magic call, and start drawing graphics. I found that a memorable way to learn pointers. Sadly, doing that in the modern world requires quite a bit more setup.
Re: Learn C The Hard Way
#147I look forward to the content. As a beginning C++ instructor I find there is something lacking between the truth of the language and the conventions for presenting it. Nobody, AFAIK save for the truly hardcore student, has nailed it.
Got any feedback on the things students get wrong? My experience is they fail to grasp memory management, pointers, functions as pointers, linkers or just how a program actually runs. If you've got others I'd love to hear them.
Re: Learn C The Hard Way
#148Earlier quoted context omitted.
K&R chapter 5.5, Character Pointers and Functions, explains pointers and shows how they are used in C. It's probably the clearest explanation of pointers ever written, and it doesn't require any understanding of hardware or assembly language (though that would help). I remember reading those three pages over and over and experimenting with the code until I got it. I probably spent several days studying the pointer ch…
Getting it or not is one thing, but I'd advocate keelhauling anyone who wrote that sort of thing in production. The "notational convenience" is more obnoxious than anything. But, then, I'm not particularly a fan of terseness for the sake of being terse.
"That sort of thing" has been in production in the C libraries, the UNIX kernel, and all of the brilliant utilities that make up UNIX for over 30 years. It's also very much in production code at Google.
You might want to read Paul Graham's thoughts on succinct code at http://www.paulgraham.com/power.html and Rob Pike's "Notes On Programming in C" at http://doc.cat-v.org/bell_labs/pikestyle.
Re: Learn C The Hard Way
#149Earlier quoted context omitted.
K&R chapter 5.5, Character Pointers and Functions, explains pointers and shows how they are used in C. It's probably the clearest explanation of pointers ever written, and it doesn't require any understanding of hardware or assembly language (though that would help). I remember reading those three pages over and over and experimenting with the code until I got it. I probably spent several days studying the pointer ch…
Getting it or not is one thing, but I'd advocate keelhauling anyone who wrote that sort of thing in production. The "notational convenience" is more obnoxious than anything. But, then, I'm not particularly a fan of terseness for the sake of being terse.
I myself never got much into the terseness game, since apart from a brief stint using gwbasic and later QuickBasic at 80x25, I learned programming using DJGPP in DOS with the RHIDE IDE. The IDE could trick the VGA into displaying something like 132x60, leaving plenty of room for descriptive code.
Re: Learn C The Hard Way
#150When I first learned C, I did so under DOS, an environment in which you could declare a pointer to video memory, make a magic call, and start drawing graphics. I found that a memorable way to learn pointers. Sadly, doing that in the modern world requires quite a bit more setup.
Here is a tutorial for using SDL for 'old school' graphics programming:
Of course this would require the student to install SDL and write a makefile to link it all together. I feel that is something worth covering though, since most books just do a bunch of hand waving when it comes to linking external libraries.