Skip to content
0:00 / 0:00

#c#programmingstyle#memorymanagement

How I program C

Eskil Steenberg

37K subscribers • 6 videos on Hallway

YouTube
  • Recommended by 8 people: 8 on Hacker News.
  • A classic. People kept recommending it from 2017 to 2025.
  • Presented by Eskil Steenberg, game developer
  • An opinion. It argues one side of a question engineers disagree on.

Intermediate. Assumes working knowledge.

1M views9 years ago8 recommendations

Programming languagesSystems programmingCPerformance and optimizationMemory management

Eskil Steenberg shares his personal style, structure, and philosophy for writing C code in large projects.

This is a talk I (@eskilsteenberg) gave in Seattle in October of 2016. I cover my way of programming C, the style and structure I use and some tips and tricks. Fair warning: There is a fair bit of Programming religion in this talk. You can find my work on: quelsolaar.com Socials: @eskilsteenberg Regularly stream on: twitch.tv/quel_solaar Join our Discord at: discord.com/invite/Scg6trNUyW

Why it's here

8 people recommend this

What people say. Highly recommended by C programmers as an influential talk on code style, structure, and maintaining control over abstraction.

Moments people linked to

yesenadamon Hacker News • Recommends

On “Ask HN: Best tech talks/videos of 2020-1?”

Hi Eskil from Australia :-) I remember you posted that on the page from 40 days ago also hehe. I have too many ideas myself already, so that one wasn't so useful to me, but was interesting. However, I really liked Drama in games 0 and I seriously loved How I Program C 1. It's been a big influence. Thank you! 0 link 1 link to this video

suprjamion Hacker News • Recommends

On “Ask HN: Learn C in 2023?”

link If you have lots of time: link If you can't be bothered reading a whole book: link Exercises: link and link Once you have syntax and basic algorithms down well, watch this, the only 2 hour YouTube video I'll ever recommend: link to this video Both r/cprogramming and r/C_programming are active, also full of lazy students trying to get people to do their homework. If you come by, describe your problem well with code. Say you're learning for yourself, not for school. Together C & C++ is a good Discord if you prefer live chat: link

MonkeyClubon Hacker News • Recommends

On “Ask HN: Learn C in 2023?”

> Once you have syntax and basic algorithms down well, watch this, the only 2 hour YouTube video I'll ever recommend: > link to this video Hard +1 on this! I think Eskil Steenberg work in C is really top notch - the video is heavily recommended, as is an overview of his work in general, he does some awesome stuff with C.

signa11on Hacker News • Recommends

On “Principles for C programming”

this video: link to this video , from a talk by eskil-steenberg titled 'how i program in c' is, imho, pretty good as well.

quelsolaaron Hacker News • Recommends

On “Finally releasing my 15 years of C libraries as open source”

…a: asset file format, FBX and PNG implementation. Graphics processing. -Json parser. These libraries have been used extensively in software production for all my applications including LOVE, Exo, Stellar, MoF, and Loq Airou (source included). You can find out more about these at: link . For more on my programing style, and philosophy watch this: link to this video…

quelsolaaron Hacker News • Recommends

On “Thoughts Around Naming Variables”

…nges like i, j, k, f, sum, found, best, length, count, that I always use in the same way. They therefore become very easy to read since I know their use. If something doesn't fit the limited set of common variables, I revert to long post fix names. A much longer explanation of how is use C that goes in to more depth about naming can be found here: link to this video…

quelsolaaron Hacker News • Recommends

On “Beej’s Guide to C Programming [pdf]”

Try watching this: link to this video Its long and is filled with other stuff about C programming but it goes in to dept about how to think about pointers. Good Luck!

59nadiron Hacker News • Recommends

On “I think Zig is hard but worth it”

…a real multiplier. Once you adopt a couple of Python scripts and that's OK, you give up the possibility of wielding this sharp spear. Edit: I think "How I program C" by Eskil Steenberg is an interesting window into what you can get if you laser focus on a language and environment and allow yourself to build up a mountain of code that you dogfood: link to this video At some point I will likely soft-retire and at that point it's exceedingly unlikely that I'll bother with using other people's libraries except a few key ones that I think are decent, and at that point there really is no reason I'd sit down and write these fundamentals in anything but a lower-level language. Odin, Zig or something like it w…

ykonstanton Hacker News • Recommends

On “Untangling Lifetimes: The Arena Allocator”

The author's defense of C reminds me of this classic youtube video: link to this video ... I am sure the video above will cause immediate disagreement (I think it goes too far on some topics), but I urge people to consider the ideas contained within. (I seem to have mis-posted this to another thread?)

breckinlogginson Hacker News • Recommends

On “Brent's Encapsulated C Programming Rules (2020)”

Other resources I like: - Eskil Steenberg’s “How I program C” ( link to this video ). Long and definitely a bit controversial in parts, but I find myself agreeing with most of it. - CoreFoundation’s create rule ( link ). I’m definitely biased but I strongly prefer this to OP’s “you declare it you free it” rule.

u/zaya_moyain r/C_Programming • Mentions

Great tutorial on how to program large apps in C I'm not sure if anybody posted it before, but I found this video very useful. So far, I use a similar approach, maybe with more improvements. I also think C is the greatest language. [video

u/azaroseuin r/C_Programming • Mentions

Why some people consider C99 "broken"? At the 6:45 minute mark of his How I program C video on YouTube, Eskil Steenberg Hald, the (former?) Sweden representative in WG14 states that he programs exclusively in C89 because, according to him, C99 is broken. I've read other people saying similar things online. Why does he and other people consider C99 "broken"?
82View on Reddit

u/Immediate-Food8050in r/C_Programming • Mentions

On “How to go from beginning c programmer to advanced?”

Here are some resources. IMO don't read K&R if you already know the syntax to some extent. Read Effective C instead. Knowing C is actually knowing a lot of things. For one, it is generally a good idea to have a decent amount of knowledge of the C Standards. There are both subtle and vast differences, and many different and well written code bases tend to stick to a specific standard. Speaking of code bases, you should read other people's code. Of course don't limit yourself to that one, there are plenty of other examples. Another tip, become acquainted with compilers/implementations. Read up on the different specs for different popular compilers, like Clang and GCC. And finally, don't fall v…
51View on Reddit

u/Only-Beach4305in r/C_Programming • Mentions

On “Recommend youtube channels about C”

link to this video "How I Program C” 2-hour lecture by a guy called, Eskil Steenberg. He goes deep into the way C really doesn’t hold your hand. If I recall he demos a while(true) type infinite loop that’s made from a for loop and exploits of pointer behavior / memory model.

u/tastygames_officialin r/C_Programming • Mentions

On “A modern web app in C”

the program (game) I'm making is at its heart supposed to be a kind of re-imagining of the '90s point-and-click genre with modern technology, but still running at 640 pixels and using a limited pallette, but in 3D and in first-person. So more like an "immersive sim" (I lean heavily on my favourite game of all-time, *Thief*). So to get in that kind of spirit, I figured I'd do things like they were done back then, and that meant the C90 specification. I will also say that over the years I ahve come to absolutely HATE "modern" programming with all its fancy paradigms and frameworks and design principles and I realised at some point that this approach to programming sucked all the fun out of…

u/numeralbugin r/C_Programming • Mentions

"typedef void" in header files Around 34 minutes into Eskil Steenberg's lecture "How I program C", he shows a header file containing the lines: `typedef void IInterface;` `extern IInterface *create();` `extern int count(IInterface *i);` etc (modulo long function names). I really like this idea: there is some object in the background, but the person reading the header file doesn't get to see exactly what it is, and only gets to interact with it through the named functions. Two questions: 1. Why exactly does Steenberg's code work? I understand that you can cast the void pointer `i` to any other kind of pointer, but isn't the compiler going to complain if `IInterface` is `typedef`ed…
28View on Reddit