7 ms·
> When Joe. D. Newbie wants to start programming, C seems quite approachable, conceptually. Coming from Java, my first experience with C was trying to write a
by kibwen 9y ago
> When Joe. D. Newbie wants to start programming, C seems quite approachable, conceptually.
Coming from Java, my first experience with C was trying to write a trivial program and seeing nothing but the text "Segmentation fault" at runtime. Expecting a nice Java-like backtrace to tell me where the error was, I raised my hand and asked the TA what a "Segmentation fault" meant, and how to get a backtrace. He laughed, rolled his eyes, and went back to playing Slime Volleyball.
Compared to any other language in use these days, C is anything but approachable. And when it comes to learning "secure coding standards in C", as the grandparent comment mentions, one cannot risk putting that off lest they develop bad habits that are never undone (though other environments share this property as well to some degree, e.g. PHP and client-side Javascript).
- sebcat 9y agoCoredumps and debuggers are a thing. Sounds more like a bad TA.
- kibwen 9y agoI won't dispute the latter. :P But speaking as someone who knows his way around GDB, the experience of using it is nowhere near what a Javascript programmer (and let's face it: this is all new programmers) will be primed to expect via browser debugging tools, and the necessity of using it/frequency with which it must be used due to C's lack of a runtime (understandable) and weak type system (understandable for 1972) make it a frustrating choice for autodidacts looking to pick up a second language.
- megaman22 9y agoI'm extremely happy that I learned to program in QBasic and then C++, with that awful Bloodshed DevC++ compiler. Everything since (except Haskell...) has been baby-town frolics, in comparison.
- geezerjay 9y ago> Bloodshed DevC++ compiler God, this is the first time in over a decade that I see a reference to Bloodshed Dev-C++. IIRC, Dev-C++ was just an IDE, and the compiler was actually GCC. The IDE was actually very good for its days, and considering it was a free IDE before free IDEs were a thing.
- Ar-Curunir 9y agoI thought we were talking about a language that newbies could pick up easily? It's not an easy language if right away I have to use debuggers to figure out why my simple code won't run.
- godshatter 9y agoI'd say that with C there's a knee-high step to get up at first if you're dealing with pointers for the first time, then it's smooth sailing until you double free your first pointer, and then smooth sailing once you're more meticulous about that until you overflow a buffer using strcpy, then learn about strncpy and learn the hard way about it not putting in a trailing zero if the buffer is filled and then you learn about strlcpy, and then you get bit somewhere later on by signed/unsigned differences, and so on. You end up building up an impressive set of street smarts dealing with C, based almost wholly on actual bugs found the hard way. This period last for a long time, if it ever ends. That may be some of it's charm. You've bled copiously along the way, due to somewhat disguised behavior. Why give up your hard won knowledge just to go play with legos? It's like learning first to juggle knives and hatchets, and wondering if you should "progress" to safe juggling balls specifically designed not to maim you. I'm joking, mostly. I love programming in C, but it's definitely not an easy or simple overall journey. You can make some cool things with it, though, which is the point.