4 ms·
> "In the C programming language, you're regularly forced to deal with the painful, dangerous concepts of pointers and explicit memory allocation. " > "I'd wag
by lbrandy 18y ago
> "In the C programming language, you're regularly forced to deal with the painful, dangerous concepts of pointers and explicit memory allocation. "
> "I'd wager the majority of programmers alive today have never once worried about malloc(). I call this progress..."
Anger. Must... resist... anger.
I've come to believe that Jeff Atwood is on a personal mission sent by God himself to piss me off.
Just remember, Jeff: every time you fire up that pretty C# code of yours, and make all your little variables through your ORM, letting the garbage collector clean up the mess you've made and then proceed to pump out those cute little web pages through your cute little templating language, to be sent off to some other computer through some magic wire to some magic browser to be rendered... that thousands and thousands of programmers (who, it should be noted, are almost all still alive, today) worrying about "dangerous" and "painful" concepts like pointers have slaved to make your silly little ORM, your database, your templating language, your network stack, your web browser, your web server, and your operating system.
As I've said before, some of us are in the trenches worrying about all the "dangerous" stuff, like pointers. The primary difference between you and I, though, is that I actually know you exist. I don't believe that at some point in the mid 80's, a network stack and a file system (each created in the "before time") really really loved each other and out popped a web server.
- lliiffee 18y agoI don't think he is saying pointers et al. aren't important. Consider the Whitehead quote: "Civilization advances by extending the number of important operations which we can perform without thinking about them." Even so, I imagine that most garbage collection proponents still think people should learn about pointers and GC, just not use them (unless there is a good reason to).
- statictype 18y agoI know its somewhat trendy to pick on Jeff Atwood, but I don't really know what you're getting angry about. He never said that malloc and free are irrelevant. And manual memory management is dangerous and painful. Anyone who's written a modicum of C would agree with that. That a majority of programmers today don't have to worry about it is, in fact, progress.
- lbrandy 18y ago> He never said that malloc and free are irrelevant. It would be a good point if it was true. Jeff's basically said as much going as far as calling C an "obsolete" language and saying it is not worth learning. He said he doesn't know C and sees no reason to learn it. Is that not the definition of calling malloc and free irrelevant?
- statictype 18y agoum, I'm talking about this particular post of his that you specifically quoted. I'm not talking about his general position on learning 'C' (which I also disagree with)
- DarkShikari 18y agoAnyone who's written a modicum of C would agree with that. I've written tens of thousands of lines of C and maintain a codebase of over 50KLOC. I also am a somewhat less active maintainer on another project with almost 400KLOC. And I would strongly disagree with that, so you shouldn't make wide generalizations like "anyone." I have devoted probably less than an hour of my time out of over a year of development on this codebase to memory management. I have never understood why people think it is so hard to call free() a couple times when your program shuts down. At least in my experience, if you're finding memory management to be "hard", your program is structured in a bad way to begin with. Your program shouldn't be covered in mallocs and frees.
- statictype 18y ago>I have devoted probably less than an hour of my time out of over a year of development on this codebase to memory management. I have never understood why people think it is so hard to call free() a couple times whenhttp://news.ycombinator.com/item?id=435267 http://news.ycombinator.com/item?id=435267 your program shuts down. I'm completely and utterly unable to comprehend how a code-base of the size you mentioned could have its memory managed by a couple of free() calls when your program shuts down. (And if you're program is shutting down, why would you even need to call free() at all? ) Are you using some kind of garbage collector tacked on top of C? Edit: Can you elaborate on the nature of these programs? Because if you're building any sort of non-trivial data structures in your code at all, then you almost certainly need allocations and deallocations