One of the best academic decisions I've made as a student was to take a course on Operation Systems in C. I did take a beginners course in C previously so it was an intermediate class. Nothing compares to spending hours and hours grinding through thousands of lines of C and building your own passable OS from a skeleton kernel. It was the hardest course I've ever taken in college and it was my favorite. I can honestly…
Why Learn to Program in C?
61–70 of 123 posts
Re: Why Learn to Program in C?
#62I don't think C should be the first language for most new programmers. The article doesn't recommend that. Rather, my argument is that C provides the lowest level abstraction that (most) modern programmers could ever need. By understanding C, you give yourself the ability to break into the black box of any higher-level language or framework. You're not at their mercy if they provide odd abstraction layers or bugs in their code.
It seems to me, at least anecdotally, that beginner programmers using C feel like they can't do as much as other beginners using languages like Python or Java. Often this is because graphics are so much faster to get to when working with the libraries that those other languages offer. Without a standard graphics library, C feels like the weaker choice. How wrong that is, but I've heard this sentiment from several different beginners.
I think part of what draws me to the Handmade Dev community is that we are finding so many people who know how to code, but want to feel more in control of their programs. Many people following my Handmade Quake project have told me that they're considering learning C for the first time ever. Maybe that's a good position for C to take in 2016 - a language to learn once you've learned your first language and some simple logic but want to understand the hardware better, or figure out exactly what code is running when you turn on your Python interpreter. I hope the community is able to plant that seed in the minds of as many programmers as possible.
Re: Why Learn to Program in C?
#63C is great. I wouldn't recommend starting programming in C, though. At least not with the standard exercises you see. Get user input, read a file, do this do that with it. Why? the C standard library is full of gotchas and tricks and goofy shit that makes it unsuitable for new programmers. The comp.lang.c FAQ should be standard reading material for anyone taking a C class. Look at all the posts on StackOverflow about…
My first language was C and I loved it. Maybe it takes a certain type of mindset and tenaciousness (madness?) that will put up with the gotchas. It was exactly those gotchas that got me hooked though. It was similar gotchas that made me love Linux the terminal, vi etc ... The argument that one "should study other languages before they're fit to learn C" is terrible IMO and somewhat condescending. It's like saying one…
A programmer should definitely eventually learn C, but there's no reason it needs to be their first language and definitely no reason it should be their only language.
Re: Why Learn to Program in C?
#64I'm surprised that people have managed to get through a CS program without learning C (or, at least, C++)! It seems to me that programming should be taught simultaneously in Haskell (or Lisp?) and C. - C teaches you how computers work. - Haskell teaches you how programming logic works.
I'm of the mind we should be teaching predicate and temporal logic, formal methods, and critical thinking before teaching languages. Though if you were to start with a language C might be a good one just to show you how sloppy thinking leads to incorrect behavior and poor performing programs.
This will (apparently) never happen. I actually had a conversation with the mathematics department chairman about this after I took the formal logic course as a junior in college. "Why wasn't this the first course I took?" I made A's on all subsequent math courses; I'd been a lot B's and C's up to then.
He didn't say he knew why we don't. Now, this is a smallish college that started as a normal school - a teacher's college - and still is a teacher's college. The only graduate courses there were in education.
I think we all actually know why. We cargo cult these things to a deep level. I don't think it's intentional; I think that very few people know what rigor and formalism are. It's painful to learn.
Re: Why Learn to Program in C?
#65Re: Why Learn to Program in C?
#66The whole handmade thing seems kind of silly. Yes, understanding what's beneath abstractions is important, but if you want to build software well, you should use your abstractions well, because not every piece of software needs lightning speed.
I don't think the author is arguing everyone should use c for everything. He is arguing that everyone should write something in c so that they understand the abstractions they use better. Abstraction is great because it let's you build your conceptual structure atop a virtual foundation, but your structure will be more grounded and therefore more sound if you learn to connect your understanding of the virtual foundat…
Re: Why Learn to Program in C?
#67Earlier quoted context omitted.
Yeah, but why start with an exceedingly painful one except to needlessly inflict pain and suffering on students. Better to lay the groundwork with a friendlier language, learn the basics, and then move on to the more complicated gottchas (at least in my amateur opinion).
What language would you suggest is friendlier, and less rife with gotchas? I find the rules of C fairly reasonable, at least on the surface.
Re: Why Learn to Program in C?
#68Why do so many people seem to think the author is advocating that you learn C as a first language? Did you read the article? He explicitly says the opposite: Does someone brand new to programming, who’s excited about making changes in the HTML on a page or setting up a blog to later customize, or just wants a slow introduction to more complex topics, really need to worry about cache coherency? Or threading? Clearly t…
Re: Why Learn to Program in C?
#69Earlier quoted context omitted.
My first language was C and I loved it. Maybe it takes a certain type of mindset and tenaciousness (madness?) that will put up with the gotchas. It was exactly those gotchas that got me hooked though. It was similar gotchas that made me love Linux the terminal, vi etc ... The argument that one "should study other languages before they're fit to learn C" is terrible IMO and somewhat condescending. It's like saying one…
Learning to program is about solving problems using a computer. Any programming language allows this, however some languages make it harder than others, and C is in that category. A language like Python has very little quirks that will stump a person coding for the first time in their life; in C they'll wonder "what does int main(int argc, char argv) mean?", "why is there a & before my variable in a scanf but not in…
Re: Why Learn to Program in C?
#70Ruby, Python, Perl, PHP, Java are all (mostly) built in C ( not to mention most databases ). Why not learn to program in C?
You realize that computers don't literally run C code, don't you? By that argument you should go further and build your own hardware, then write your own OS...you get the point.