Programming Vexations Part 10: Header Files

By Shamus Posted Thursday Nov 14, 2019

Filed under: Programming 89 comments

I’ve talked about C++ header files before. Like I said earlier in this series, the C language was designed in an age where memory was scarce and it wasn’t feasible for the compiler to hold your entire codebase in memory at once. So projects end up broken up into many different files.

The file marine.c needs to refer to the code in weapons.c, and vehicles.c. Somehow the compiler needs to be aware of the contents of those other files without loading them entirely. So we have a header file, which lists the contents of the other files. It’s like an inventory list. When the compiler is working on marine.c, it loads the header file weapons.h. Then the compiler can say, “Oh, I don’t know what the code for WeaponReload () looks like, but according to the header file I can tell that the code exists. I’ll just keep compiling and trust that the code for WeaponReload () will show up later when I’m compiling some other file.” This way the compiler can know that WeaponReload () exists, and the typo WeaponRelaod () doesn’t, enabling it to catch your error.

Continue reading ⟩⟩ “Programming Vexations Part 10: Header Files”



The Dumbest Cutscene

By Shamus Posted Tuesday Nov 12, 2019

Filed under: Column 116 comments

As I’ve mentioned before, the entries in this series exist as both articles and videos. You can watch the video version, or you can scroll down and read it. The one I’m showing you today was actually the first video we produced in this series. It was kind of a pilot episode so we could get a sense for what the series should feel like. I need a little personal time, so I’m posting this now to fill the gap. If it seems a little janky, that’s why.

Link (YouTube)

Continue reading ⟩⟩ “The Dumbest Cutscene”



Diecast #278: New Steam, Spreadsheet Games, Pretentious Games

By Shamus Posted Monday Nov 11, 2019

Filed under: Diecast 124 comments

I notice some people would rather ask us questions in the comments rather than use the email in the header image. That’s fine and I don’t blame you for taking the path of least resistance. However, your laziness is compounded by my laziness. I usually gather up questions just before we record the show, and I rarely remember the questions that were asked in the comments a week earlier. You’re free to ask questions however you like, but I’m old and forgetful. If the question is really important to you, then you should probably email it.

Hosts: Paul, Shamus. Episode edited by Issac.

Show notes: Continue reading ⟩⟩ “Diecast #278: New Steam, Spreadsheet Games, Pretentious Games”



Programming Vexations Part 9: The Problem With Engines

By Shamus Posted Thursday Nov 7, 2019

Filed under: Programming 76 comments

In the previous entry I talked about the lack of game-specific types and features in C++, and how this leads to library proliferation, compatibility problems, and a massive duplication of effort. The idea was that a language designed for games ought to contain types that are common to all games. Several people argued in the comments that you shouldn’t add these sorts of things to the language itself, but rather provide them through the standard library.

This leads into a side argument over whether or not we should consider the “standard library” to be part of the language, which is one of those questions like, “Is the bun part of the hot dog?” where everyone thinks the answer is obvious, and are then horrified to discover another group of people who think the opposite answer is the obviously correct one. So then they take turns hitting each other in the face with the dictionary.

Welcome to the internet, I guess.

But since we’re here, I might as well sort this out for people who work in sensible careers rather than becoming programmers.

Continue reading ⟩⟩ “Programming Vexations Part 9: The Problem With Engines”



Music Class Part 1:

By Shamus Posted Tuesday Nov 5, 2019

Filed under: Music 38 comments

I mentioned a few weeks ago that I signed up for a music course at The course was taught by Andrew Huang, who is one of my favorite YouTube creators. The class ended today. I’ve turned in my final project and I want to talk about what I learned, what I made, and what I think about the LearnMonthly service. (But not in that order.) If you stick around long enough, I’ll inflict some of my music on you.

For those of you who are new to the site: I’ve been dabbling in music for a few years. It all started with my Bad and Wrong Music lessons back in 2014. I make music digitally and I don’t play any real instruments. I’m entirely self-taught. Music is a side hobby and I have no plans – or potential – to do anything with it professionally. Even after all this time, I’m still very amateurish in my work. Maybe this means I don’t have any aptitude for music. Maybe it means I do have some aptitude but it takes a long time to get good. Maybe I’ve hit a plateau due to odd gaps in my knowledge.

In any case, I signed up for this class because I really loved the introductory lecture on YouTube and I wanted to fill in some of those knowledge gaps. As far as that goes, I got what I wanted out of the course. I’m going to complain about the website here, but I want to make it clear up front that I don’t have any problems with Huang’s lectures.

First up, let’s talk about…

Continue reading ⟩⟩ “Music Class Part 1:”