Getting started with C
71–80 of 106 posts
Re: Getting started with C
#72This is the "getting started with coding" guide that I give to people who ask me about these kind of things. This is a defense mechanism - I tell them that I'll help them get started with a career in coding if they return me their completed text editor. So far nobody has, so maybe it's not the best beginner tutorial?
I still thought it was a great tutorial.
Re: Getting started with C
#73Introducing newbies to GTK is a great way to show them a lot of code they don't understand, will take a while to understand, and will break in non-obvious ways.
..and that uses non-standard concepts like GObject. Win32 examples would have been peak hilarity. More seriously, I see where the author is coming from, but even historically, GUI code has always been a massive pain in C.
Re: Getting started with C
#74The most critical prerequisite to being a good C developer is to really understand pointers on an intuitive level. The biggest block is that most people don't take the effort to develop mental fluidity. So when they see something like a dereference to a pointer of a pointer, or a cast from a pointer to an array, it interrupts flow while they consciously work out what's going on.
Re: Getting started with C
#75Earlier quoted context omitted.
It kind of depends on what you need out of C. The only real reasons left to use C in the wild are: * Legacy code * Embedded (including drivers, bare metal etc.) * Portability, FFI, etc. Performance used to be another major reason, but in $CURRENT_YEAR, if that's your goal, C++ and Rust are just as performant and there's very little reason not to opt into them. The other major reason to learn C is that it's a great "h…
I would still suggest that people learn C before attempting C++; while someone with C# or Java experience could probably do well in a "modern C++" codebase, as soon as they go off-piste into memory allocation and pointers they're in for surprises. (Is there anyone who learns Rust who isn't already a proficient but frustrated C++ programmer?)
We have a lot of people who come from ruby/python/js, and/or haskell/ocaml/scala. They find Rust an easier foray into systems languages than C++.
And even some C veterans who never got on board the C++ train.
Re: Getting started with C
#76It is funny if this was not intended as funny. An instance of "now draw the rest of the owl" meme. I can see the need to teach a bit of the surroundings of C, but it ended up having very little to do with C.
Re: Getting started with C
#77This is a very strange "getting started" guide to C, and I'm not sure who the intended audience could possibly be. The tone at the start really does seem to be aimed at "absolute beginners" ("[...] programs must be written in a very strict way. Miss a comma and the program will stop working"), but then it quickly gets into the weeds without much explanation. I'm trying to imagine an beginner reading this: The first t…
Maybe they meant an absolute beginner to C and not programming in general.
Re: Getting started with C
#78You also have to know what's not in the head of an absolute beginner. Then you need to fill the gaps with background material. Not too much or your audience will tune out. Not too little or you'll lose your audience in a puff of confusion. There needs to be just enough instant gratification to keep the reader with you.
Many concepts you've mastered are tangled together in your head, and you'll realize this the minute you start trying to write about them. Before you started writing, you never noticed what a hairball of concepts you'd mastered, and if you don't expend some serious effort and energy unpacking it all, your absolute beginner guide will read more like a dissertation. You'll need to untangle each and every concept for the beginner audience. That means getting creative with how information is presented. With what information you reveal, and what information you simplify - but not too much. You should start thinking about ways to convey ideas graphically, which could excite you as much as it horrifies you. A good image can take as much effort as 2,000 edited words.
You start off thinking that it will be easy. And then you realize you've vastly underestimated how much material there will be to get where you wanted to be. If you haven't given up in complete frustration at the size of the undertaking in front of you, scale back your vision for the guide and repeat. It may take a few iterations before you know what you're doing.
Re: Getting started with C
#79If I had read this lightning fast guide, I would be a bit lost. After displaying "Hello, world" on the terminal, do I really want to learn how to display "Hello, World" in a GTK window?
Re: Getting started with C
#80Earlier quoted context omitted.
Just read K&R for 10 minutes.
:-) I wish people would stop recommending this outdated book, along with a few other default goto books (say, the Dragon book). Its super optimistic approach is more about the language K&R wanted C to be than the real thing.