Hacker News new | ask | show | jobs
by AlexanderDhoore 4224 days ago
Very very good article, although the latter part is a bit too focussed on web dev and dynamic scripting languages.

I personally think every programmer should know some C. Basic things like what the stack and the heap are.

Edit: Ok, probably not in the case of absolute beginners, but after a year or two...

4 comments

There are a whole lot of things every programmer should know because they'll have a profound impact on their code no matter how far up they sit in the abstraction chain.

Even things like memory alignment and cache lines can bite you really badly if you don't know about them and order your loop the wrong way around :)

Date and Time Handling, Unicode and Data Structures are also a common area for many misconceptions and sources of error. Of course nobody needs to know everything, but have a lively thirst for knowledge always helps, especially one you got over the initial confusion of learning the basics. There's just so much interesting stuff out there and a lot of it will help you improve even if you don't end up using it right away / at all.

Even if you're just swimming on the surface, it's always a good thing to know at least the 1-3 meters beneath you, just in case something happens or you get stuck in some seaweed and struggle to get out on your own.

I've actually made quite some good experiences with teaching people a few things about ASTs right once they started writing code, even though I only gave the some very basic lessons about how the "text" is eventually transformed, it really helped them a lot in understanding why certain text does certain things.

In the end, it's always very hard to play the game successfully if you don't know the rules by which you have to play. And a little can go a long way.

Do you mind going into memory alignment and cache lines and what would be good to know? I feel like I ignore most of that unless I am coding in C. I mostly do python or Javascript so does that stuff mater when you are that high up in the tech stack?
I think C is good to know and try if you are going through an academic program in school. For a lot of people just starting to learn to code (while juggling other responsibilities/jobs/etc), learning C upfront can be an overkill. Being able to implement your idea as soon as possible will be of utmost importance. Sure they can dabble with a little more deeper understanding of language internals and theory once they feel confident enough in the one toolset they have chosen.
When I were a lad, everyone you'd meet in the industry had started out doing C on Unix, and had then specialised, maybe they liked Unix more and became sysadmins, maybe they liked C more and wrote Motif apps, or branched further out into C++ on Windows. But everyone had that core, fundamental knowledge. Nowadays people go straight into the very abstract stuff, and have nothing to tie it all together with.
C on UNIX? You were lucky! My dad had to toggle the bootloader into the front panel every morning before he could even run the assembler!
Maybe, but I'm only talking 15-20 years ago. So much has been lost in a relatively short time.
For certain definitions of "should", sure. Like: I _should_ get some exercise tomorrow. I should take out the trash today instead of tomorrow. A very optional should.

I've got 4 years of professional software experience and the only C I've written is a couple hours on an Arduino device. It's just not that needed or relevant to my work as a web developer. I don't think the article is too focused on web dev, that is where the self-taught developers can most easily insert themselves.

FWIW, dynamic scripting language is redundant.