I always had an idea of a 'for programmers' series of books for those who know how to program in one language (say, C++, Java or PHP) and wish to pick up a new language eg. 'python for programmers' would not need the first half of it dedicated to explaining strings, loops etc. and could get straight into it from a programmers perspective - a bit like K&R. You could then dedicate more content to explaining philosophy,…
Learn C The Hard Way
211–220 of 260 posts
Re: Learn C The Hard Way
#212Earlier quoted context omitted.
Many of the friends I made in my CS classes were terrible with pointers. I never really understood why they didn't grasp pointers, but it was a major stumbling block for them in C/C++
Mainly because variable declarations are "backwards" in C. People try to read code left to right, but C declarations should be read right to left. Pile one things like the dual use of the static keyword, typedefs, and having multiple consts in a declaration figuring out the type of a variable can be a real chore. Dan Saks has a great article that hits on just the issues with const. http://dansaks.com/articles/1998-06…
Re: Learn C The Hard Way
#213Earlier quoted context omitted.
I don't intend to argue so much as to offer a data point: I suspect that most folks on this site learned C or something C-like early on, and have internalized its modus operandi. I have been learning C recently from a background of functional programming, and I find it scary and evil. FWIW, I enjoy programming very much, and have built some non-trivial stuff in several languages. Still, I found C extremely taxing. No…
If you're thinking of arrays as second class citizens, you're thinking of the language incorrectly. Rather you should realize there are no arrays, only pointers to chunks of memory and arithmetic operations.
Re: Learn C The Hard Way
#214Earlier quoted context omitted.
what I keep repeating about that is why the C standard guys don't freaking update the libc with a new version of the C standard? Deprecating the old silly stuff like strcat() (the libc is full of bad calls) and adding lists, hashes, btrees, good dynamic strings lib, and so forth. An huge step forward for C... without even touching the core language.
A bit OT and not sure if you will see this. Seeing that you are the guy(or onof the guys) behind redis which is written in C, do you have any recommendations for generic data structures and operations on them? I personally have a trivial vector implementation which resizes when full, and a red-black tree implementation for associative arrays. Both of them work fine for my purpose - does the job, good locality of refe…
Re: Learn C The Hard Way
#215Do people really think C is some mysterious, inscrutable language? "To many programmers, this makes C scary and evil." Is this actually true for people? I find C code generally very easy and straightforward to understand; there's not any magic behind the scenes, like there is in any language that's more "high level" than C.
Given how many people freak out about retain/release memory management in Objective-C, it seems that C, pointers, and manual memory management is gotta be a lot scarier.
Re: Learn C The Hard Way
#216The biggest problem with C is not the language C, for it is a small and mostly simple language with a few warts (I'm looking at you, pointer syntax), it is the ecosystem into which you are thrust when you first use it. That is, the ecosystem of, "What can I include without dicking around with compiler and linker settings, which I do not care to learn very well because I am just starting?", and the ecosystem of, "Why…
"It's not the language, honey, it's the runtime." (apologies to Indiana Jones)
Re: Learn C The Hard Way
#217Earlier quoted context omitted.
Use cmake, no fuck this, try JAM. WTF? Why not simple Makefiles, better yet manually written projects for XCODE, VCPROJ.... Oh fuck no.... At the end of the day you wrote something to get your shit out. Simple as that :) 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 :…
If you statically link, will it only run on the latest platform? I don't believe I've ever shipped an app that dynamically linked to the MSVCRT.
There are way too many subtle details (and more complicated with Windows's manifests, side by side assemblies and crap like that).
Re: Learn C The Hard Way
#218Earlier quoted context omitted.
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…
Why is it that every comment I read by you is either you whining about being treated unfairly or you attacking someone who supposedly "attacked" you? Are you honestly that insecure? Do you read every comment as though it is in some way attempting to degrade your image? Here you denigrate the HN community, saying it doesn't generate a significant amount of traffic for your site or whatever, and then go on to say you w…
So Im going to go with you having a selection bias.
OTOH I do appreciate your vigorous defense of the HN community, too many people just dont care about implied insults to their self identified tribal group.
Go llambda!
Re: Learn C The Hard Way
#219Re: Learn C The Hard Way
#220Earlier quoted context omitted.
I'm glad you got so much about how my book is written from a few paragraphs in an unfinished manuscript for it.
Hey, Zed, can you tell us all how much we're losers because we don't get as many blog post hits as you? The irony was a big hit last time.