Game Programming Vexations Part 1: Five Years Later

By Shamus Posted Thursday Aug 29, 2019

Filed under: Programming 126 comments

My programming posts are always popular, which is strange because it seems like they shouldn’t work at all. I don’t know where I got the idea to write about the fussy details of programming in casual, non-technical terms. It seems like non-programmers would be bored by all the stuff that has no bearing on their lives, and programmers would be irritated by all the entry-level explanations for things they already understand. But for whatever reason, both kinds of people show up for these articles.

Whichever group you belong to, buckle up. I expect some of this to get pretty controversial by the standards of programming flame wars, and I think I’m going to need to be more technical than usual.

Jai

It’s been five years since I wrote about Jon Blow and his mad scheme to create a programming language for games. At the time, I half-expected that this would be the last we heard about the idea. Not because I don’t have any faith in Blow specifically, but because the internet is awash in grandiose projects meant to solve herculean challenges, and the vast majority of those projects never make it out of the design phase. It’s easy to explain why something is a problemThat’s pretty much what I do here., and it’s not that hard to make suggestions, but it’s murderously difficult to solve those problems with code. In the programming world, talk is cheap and working solutions are hard to implementActually, I hear this holds true outside of programming as well..

Making a new programming language is like getting a puppy. It seems like a lot of fun, but it also turns out to be a lot of responsibility. You can daydream about all the magic features you’d love to have in a language and how cool your syntax will be. But eventually the novelty wears off and you realize you’re now obligated to take care of something that no longer delights you. The fun goes away and the work doesn’t, which is when the daydreaming programmer will fall in love with a new idea and abandon the old one. Statistically, betting against new languages is the safe thing to do.

Despite my pessimism, Blow has made some amazing progress over the last five years. He’s building the language, while also using the language to build a game. This series is going to look first at what problems we have in game development, and – later when I have a chance to try it – what Jai does to addressor fall short of addressing these problems.

This series was originally going to be about Jai, but:

  1. The introduction kept growing and growing as I set out to explain WHY we need a programming language for games.
  2. I found myself caught in many digressions filled with long pent-up gripes about C++.
  3. Jai isn’t out yet. It might possibly see a limited-public demo of some sort in 2019, but it hasn’t happened yet.

So instead this series is about the vexations of games programming, with the understanding that maybe in some distant future I’ll write a series about Jai and see how well it addresses these concerns.

Domain is Everything

I'm sure this dude is good at whatever it is he's doing, but I wouldn't ask him for advice on how to run a restaurant.
I'm sure this dude is good at whatever it is he's doing, but I wouldn't ask him for advice on how to run a restaurant.

As soon as game developers start talking about climbing over the wall around C++ and running off to find a new language, people start evangelizing their favorite languages. X does everything you need for game programming! Y is the best language for all projects! Z meets all the criteria you’ve listed!

Without fail, the people giving this advice have never shipped a game and in fact aren’t game developers at all. They’re usually coming from some other field.

I don’t know what the deal is with this particular discipline, but everyone presumes to know everyone else’s business. I don’t imagine most auto mechanics would casually attempt to tell an airline mechanic how to maintain a turbine. I don’t think the airline mechanic would tell a structural engineer how to construct a tuned mass damper. I would hope the structural engineer wouldn’t go around lecturing NASA engineers about how to construct launch vehicles. We understand that even though all of these professions involve engineering and using tools on machines to some degree, they’re all highly specialized fields with very limited overlap.

Two coders might use different languages to solve different kinds of problems using different hardware at different scales, but they’re not shy about advocating languages and coding practices to each other. The field is full of dogma and online discussions are a mess of peacocking, condescension, and arrogance.

Maybe we tend to treat all programming disciplines the same because they look so similar. You can tell an auto mechanic from a carpenter with a glanceAssuming they’re working, obviously.. But coders working in web development, video games, embedded systems, machine learning, and driver maintenance are all superficially the same. They all sit in chairs and type code on a computer. Maybe this tricks us into thinking these people are all doing the same job.

Some programming projects don’t care about performance as much as code clarity. Others are optimized for a low memory footprint. Others are worried about maintaining code for decades. Others have to sacrifice development time to safeguard against the possibility of errors. As John Carmack once said:

“Now, a great deal of stuff that goes on in the aerospace industry should not be emulated by anyone, and is often self destructive. Most of you have probably read various popular articles about the development process that produces the space shuttle software, and while some people might think that the world would be better if all software developers were that “careful”, the truth is that we would be decades behind where we are now, with no PC’s and no public internet if everything was developed at that snail’s pace.”

Different problems have different solutions, and programmers outside of gaming are often trying to explain to us that their hammers are excellent tools for driving our gaming screws. And to be fair, I’m sure game developers are just as eager to find a non-gamedev programmer and lecture them about how gaming’s screwdrivers are the perfect tool for digging their trenches.

I don’t know. Maybe I’m wrong and auto mechanics really do lecture HVAC engineers about how to maintain their hardware, and I just don’t see it because I don’t hang out in those circles. Still, it seems like engineers who operate on physical hardware are more likely to identify their domain during a discussion, while programmers are more likely to get in arguments without any of them ever making clear what kind of programmers they are.

Domain experience is everything. Game development and systems programming have about as much in common as plumbing and VCR repair. While we’re having this discussion on languages and programming methods, I’d encourage everyone to keep the issue of domain experience in mind. Maybe all developers in domain X are dum-dums for not using your awesome language / tool, or maaaaaaybe there are a bunch of details to X that you don’t know about. Maybe the language / tool that you think is dumb and broken is actually designed for a completely different job than the one you’re doing.

What is a Game?

Before we go any further I should make it clear that as far as this series is concerned, a “game” is a program which:

  • Runs in realtime.
  • Is interactive.
  • Renders some sort of 3D sceneEven if the gameplay itself is 2D..
  • Is targeted at modern gaming hardware like PCs and consoles.

For this series, when we talk about games we are not talking about text-based games like Hammurabi. We’re not talking about strictly narrative experiences like The Writer Will do Something. We’re not talking about classics like the original Myst or King’s Quest.

This is obviously a very narrow definition. It excludes a lot of simple 2D sidescrollers but might include some non-gaming simulations as well as 3D modeling programs like Blender. I’m not trying to change the definition of game on you, and I’m not trying to claim that Peggle and Cooking Mama aren’t games. I’m not using this definition to be a gatekeeping jackass. I fully admit these experiences are actually games and they have just as much artistic merit as anything else with the label “video game” slapped on it.

I’m excluding these things because – from the standpoint of a modern game developer – they’re fairly trivial programming problems and won’t benefit from any of the language stuff I’m going to be talking about. I’m just trying to avoid saying “realtime interactive 3D software for PCs or consoles” every time I’m talking about the challenges of AAA game development. If I make a claim like, “All games need to worry about framerate”, remember that I’m talking about a game with polygons and moving images. I don’t want to get dragged into pedantic arguments over Zork et al.

When programmers wish for a better tool for doing game development, they’re usually working in the AAA space and wishing for a way to escape C++. This is not really a problem for bedroom programmers working on small-scope projects in Unity. The small teams have lots of languages and tools to choose from, and they’re usually worried more about money and less about pushing the hardware to the limits. So for the rest of this series, I’m going to assume that any language intended to displace C++ must therefore be useful to projects on the AAA scale. I’m not promising that Jai will do that, or even that Jon Blow has made that promiseAlthough it is apparently one of his goals.. I’m just saying I think that’s what a challenger language would need to do.

Domain Difficulty

We all have challenges to deal with and things that make our particular domain difficult, and I get that claiming that no existing tool is “good enough” for your domain smacks of arrogance. Everyone will think you’re bragging about how hard your job is, which carries the implied insult that everyone else has it easier. Other programmers will not let this sort of claim go unchallenged.

(For the record, I’m not saying game development is more difficult than other domains, I’m just saying its difficulty takes a different form.)

Hopefully I’ve placated you enough and you’re at least willing to entertain the notion that games programming has challenges you don’t seeOr that are present to a lesser degree. in other kinds of programming. Over the next 12-ish entries, I’m going to talk about some of the major problems that I hope Jai will address.

 

Footnotes:

[1] That’s pretty much what I do here.

[2] Actually, I hear this holds true outside of programming as well.

[3] or fall short of addressing

[4] Assuming they’re working, obviously.

[5] Even if the gameplay itself is 2D.

[6] Although it is apparently one of his goals.

[7] Or that are present to a lesser degree.



From The Archives:
 

126 thoughts on “Game Programming Vexations Part 1: Five Years Later

  1. Mervyn Bickerdyke says:

    My two comments on this: Yes, engineers wouldn’t tell engineers in other domains what to do, but knowing many and being one, they would usually be curious enough to ASK the other engineers and be willing to learn from the answers.

    OK, Granted. Half of those questions will be in the form of “Why don’t you do X (as we do in the Y industry)”…. Well. You know. Engineers. If they were good with people, they’s be in sales.

    So why is this different in software engineering? My guess: If you went through computer science classes you all learned thos nice definitions about Turing completeness and you know that no matter what you’re programming: In the end, it will all be executed as assembler code. Everything else is just a transformation. So every algorithm could be expressed in any language. And this includes your favorite one.

    Which brings me to my question: How much does the language matter anyway? While I support the working definition of “game” for the sake of this discussion – but isn’t it the availability of libraries from OpenGL to complete engines like Unity much more important?

    1. Bloodsquirrel says:

      How much does the language matter anyway?

      A lot. And, yes, the availability of tools in that language is one important feature, but there are issues inherent to the language as well.

      The biggest issue is that the lack of direct access to memory in a managed language (like Java) make certain tasks inherently complicated and inefficient. Yes, you can construct a micro-benchmark test where Java gets close to C++ performance, but they you try something like serialization and find out that Java is simply nowhere close and never can be.

      In C++, for example, you can an array of some class/struct that only contains primitive values, take the memory address of that array, write the data from a file directly to that memory address, and -boom- you have an array of that class/struct. You can’t do that in Java. The abstractions involving both memory and classes in Java requires you to re-build your array of objects manually, which takes more time and requires more memory allocation.

      Unity, of course, is designed to push a lot of this to the backend where you don’t have to worry about it and can just do “game logic” things in C#, but then again that also comes with limitations on what you can do with it.

      1. Leeward says:

        I’m far from a defender of Java’s, but that’s just not true about Java only approaching C++’s performance in specially tuned tiny benchmarks.

        For certain workloads, like batch processing large amounts of data, modern (10 years ago now) JVMs with JIT compilation can exceed the performance of a C++ program. The key is that its weaknesses don’t matter so much for those workloads, while its strengths do.

        Java has strengths just like any other language, and certain kinds of problems play to them. I don’t think many people would argue that writing video games is that kind of problem, but that’s kind of what this whole post is about, isn’t it?

      2. Bork Bjornson says:

        And if the struct contains fields of different sizes and you haven’t manually properly aligned those, *boom* it will fail if compiled “wrong”, because you need to worry about padding. Yes, you can add a #pragma pack, but better don’t operate on these structs in a hot path.

        And if you then want to port your game to a different platform, one with a different endianness, this will be a hell to untangle, too.

        Seriously, I love C and C++, but dumping things directly into a struct was always a bad idea. Always deserialize a struct field by field, with functions that explicitly take the endianness into account.

    2. Viruzzo says:

      Agreed; this seems to me a mostly masturbatory exercise on the part of Blow.

      For any game of reasonable size the actual engine of the game will be the only low-level language part of your stack, which will run your assets and behavioural scripts that will be created with tools and/or defined in a DSL. This is even more relevant now that we have “free” full-featured engines available such as Unity and Unreal Engine.

      My two cents is that JB here suffers from a classic “I’m sure I can do this better from scratch myself!” programmer frustration/hubris effect (we’ve all been there), and it’s especially ridiculous considering neither of his two games have any need for a proprietary engine to begin with by being single player, slow paced and non-high-fidelity.

      1. Redrock says:

        “Masturbatory exercise” is actually a great Steam tag for The Witness.

        1. Hector says:

          It is one of a two games I’ve requested a return for on Steam. I’ve rarely had my time wasted in a more obnoxiously smug manner.

          1. sheer_falacy says:

            How is it obnoxiously smug? It’s a puzzle game with no story. There’s nowhere for the smugness to even be.

            1. FluffySquirrel says:

              Eh, to be fair, the audio pieces do have a weird sorta high philosophical, semi pretentiousness to them

              At first I assumed that was for a reason, and there’d be a story explanation for that.. but.. no. They just added them in for the sake of it

              The puzzle aspect is great though, like you, I’m a bit confused that anyone would stop playing a fun puzzle game because of optional collectible voice clips

              1. DerJungerLudendorff says:

                In my experience, the big problem was the arrogance in the design of the game itself that caused the biggest frustrations. Because it mostly ends up being a guessing game, and if you fail to do exactly what the designer wanted you to do, then the game just wastes your time. With the implication that you weren’t smart enough to get it.

                It throws a massive amount of information at you, and leaves it to the player to sift out the exact patterns and hints that the designer actually put in. For no real reason, because the game could have just told you how it’s mechanics work in the first place.

                Well, that, and the fact that the game literally demands that you sit and do nothing for over half an hour. Multiple times.

                1. Armagrodden says:

                  In fairness, it only actually demands that you sit and do nothing for an hour once, to solve the final perspective puzzle. Unfortunately, because I thought the game might have some kind of “plot” that the videos would be germaine to, I did in fact sit through them all. My main complaints with the game are a) the little recorders and videos really are just incredibly smug little snapshots of the dev team jerking off while gazing at their own pictures, and b) I expected some kind of reward for having done all the perspective puzzles and got nothing (you only have to do the one to get the easter egg). So it felt kind of pointless, although solving the puzzles was kind of enjoyable for its own sake, so it at least it had that over the recorders (which are seriously awful, and only about four of them are relevant to the “plot,” such as it is). I liked the puzzle portion of the game, though.

                2. Nick-B says:

                  Isn’t that fairly common in some games? Obscure, hidden easter-eggs/tricks that involve odd abnormal game behavior. Such as in this game, watching the entirety of a video while someone narrates. Mind you, these “stand-still” puzzles are 100% optional and not necessary to get even what is considered the best ending.

                  As for hand-holding, I felt the clues were sufficient. Older “classics” like Myst were a bit like this, in which you do a puzzle and try various options to see which click. Having no tutorials or explanations gave it a neat kind of “mystery” to it all.

                  Not all mysteries need to be explained, too.

                  Anyway, I guess it just wasn’t for you. I thought it was beautiful, and the bonus easter egg hunt for circles really ticked some box in the back of my mind.

                3. Ninety-Three says:

                  It throws a massive amount of information at you, and leaves it to the player to sift out the exact patterns and hints that the designer actually put in. For no real reason, because the game could have just told you how it’s mechanics work in the first place.

                  That… that’s the game. It doesn’t tell you how its mechanics work because figuring out how its mechanics work is supposed to be part of the challenge.

                  1. DerJungerLudendorff says:

                    Yes, but the problem is that it does so in a terrible way.
                    The game is actually very linear: it requires that you determine some very specific ideas and concepts, but refuses to give any context or real boundaries for those ideas. And since it has an open world of sorts, and hides those concepts in it’s environment, you have a massive amount of information and possibilities.

                    Which results in you having an almost infinite array of options and trains of thought, but only the ones the developer laid out are correct, and you have little to no possibility to test or confirm your ideas and thoughts. The puzzles are binary, and can often be passed without learning any of the concepts.

                    All this results in a massive and pointless waste of time as you keep running around with no idea what to do or where to start, if any of your ideas were correct, if you’ve missed some piece of information, if you need to reinterpret something, etc etc.

                    1. Paul Spooner says:

                      I think the reason The Witness offended so many people is that it requires the spontaneous exercise of humility. Most video games will only present you with challenges you are fully equipped to overcome, and this breeds a kind of arrogant gamer attitude. But when you go up to a puzzle in The Witness that you aren’t ready to complete, that is, a puzzle which presents syntax which you are not fluent in yet, the onus is entirely on you to decide that you should move on. This self-assessment is a really useful skill in a variety of real-life situations, and it’s a shame that so few games ask it of us.

                      I can see how this passive assessment could come off as arrogant, but it is a projected arrogance. The game is basically saying “Admit to me, by going elsewhere, that you’re not ready to solve this puzzle.” and the only time this is a problem is if you, the player, are unwilling to do so, and waste time messing around with things you don’t understand and have no context to parse. The game feels arrogant because you feel it is judging you. But you must realize the truth, that there is no judgement in that assessment. Then you will find that it is not The Witness that is arrogant, it is only yourself.

                      That moon puzzle made me really wish for a fast-forward button though.

                    2. Asdasd says:

                      I think there’s wisdom in what you say, Paul.

                      I find I’m willing to tolerate set-backs in games, but only if the game cultivates a play space in which the possibility of set-back is allowed to exist. If a game is engineered to provide a sense of progress and achievement at every turn, I become frustrated the instant I encounter any difficulty, and often my mood becomes noticeably stroppy, like a child.

                      Puzzle games seem to have an in-built resistance to this. I think it’s because there’s less variables by which difficulty can be subtly smoothed away: you have either solved a puzzle or you haven’t. The player has to grapple with the possibility of failure at all times by necessity, and even could be said to be failing for the entirety of the time that the puzzle is unsolved. While in many other types of games the curve can be so smooth that the idea of failure never occurs to the player until it is suddenly (and unwelcomely) encountered.

                    3. Armagrodden says:

                      I had no problem with the way the puzzles were laid out. But having listened to all of the little recordings I feel safe in saying The Witness is kind of arrogant. ;p

      2. Geebs says:

        Most of the programming done in an Unreal engine game, and the bit that actually defines what the game is, isn’t in “Unreal”, it’s in C. Unreal engine handles rendering (writing a renderer isn’t actually that “hard” a task and hobbyists do it all of the time), UI and file IO tasks.

        I’m not saying that Unreal is bad, I’m saying that it still leaves a heck of a lot of C coding to do; so the existence of Unreal doesn’t actually affect the need for a “language for games”.

        1. Bork Bjornson says:

          Writing any renderer at all isn’t hard, but writing a good, performant universal renderer is hard. If know what kind of data you’re going to throw at the renderer, you can optimize a lot for these cases, but if everything is fair game, it’s getting really difficult.

        2. ElementalAlchemist says:

          One of the big selling points of Unreal 4 is that you technically don’t have to do any coding at all. You can do everything in Blueprints, and the engine will refactor that into code when you compile the project. Of course that will never be as performant/efficient as carrying out those functions with human-written code, but it’s intended for non-coders to be able to make a game without having to learn programming.

    3. neminem says:

      I can’t track down an exact attribution, but there’s a quote that floats around a lot that’s highly relevant: “Programming languages are defined not by what they make possible, but by what they make *easy*”.

      (Caveat: where “programming language” is defined as “definitely Turing complete”, and obviously ignoring external questions like “can it interface with your hardware?”)

      1. Echo Tango says:

        +1 for this. Weakly-typed languages like Python or Javascript are great for learning, or making small programs quickly. If you want to make something bigger, and actually have a guarantee on what data is coming into and out of your function-calls…there’s a reason Python 3 has type-hinting, and Typescript was invented. :)

  2. Lino says:

    This is going to be good! Can’t wait for the next entry!

    1. Socks says:

      Agreed. I like the mental gymnastics of programming.

      For anyone who hasn’t seen it yet, search for ‘jai’ ‘sokoban’ – looks like a pretty 3d take on the classic push boxes puzzler.

  3. kikito says:

    Thanks for starting this series! Eagerly awaiting for the next entries. I will try to refrain from recommending anything.

  4. ShivanHunter says:

    Looking forward to it!

    On the topic of programmers trying to backseat-program other domains – a lot of the foundational knowledge in CS (algorithms, using StackOverflow, etc) is transferable, and to a coder in one domain, coding in another domain can seem like a “simple matter” of learning the tech stack. Of course, it always seems much easier than it is.

    Naturally, we all know the best language for games is COBOL.

    1. Olivier FAURE says:

      Get out.

      1. Echo Tango says:

        Yeah, obviously the best language is PHP.

    2. tmtvl says:

      You laugh, but there was a contest to create a game in a particular implementation about 5-ish years ago.

    3. Duoae says:

      Naturally, we all know the best language for games is COBOL.

      I’m an aspiring programmer, please tell me more!

      1. sheer_falacy says:

        You’re gonna want to schedule some mainframe time, it’s pretty easy so long as you do it a month in advance.

        Also, number your punchcards. If you drop them you really don’t want to have to put them back in order by hand.

        1. Arkady English says:

          There’s some great stories in one of Richard Feynmann’s books (IIRC) about working with punch cards.

          In one a program was being written in one part of the country (or maybe a different country – I can’t remember the detail, tbh, but there’s a detail that makes it very likely), and then shipped elsewhere to be run independently.

          However, the program would run fine on one machine, and fail to work at all at the other end. They kept re-sending it but it kept failing and always in different ways. Both sides were getting annoyed at the other. The recipients were getting annoyed with the senders for sending non-working programs. The senders were getting annoyed with the recipients for apparently not knowing how to run punch cards and then getting mad over it.

          So they decided to have someone chaperone the punch cards through the system. It was a big shoebox sized thing full of punch cards. And at some point it would pass a security (or was it customs?) checkpoint. The security were allowed to check for contraband by taking a sample of anything passing through, and so they’d find the box of cards and just take 2-3 of them at random, and then send the box on the way.

  5. Olivier FAURE says:

    Ok, but seriously, Rust is the best programming language for any use case where you want to switch from C++, including video games. Fight me.

    1. tmtvl says:

      I dunno, I feel like there may be instances where the lack of manual memory management may bite you in the ass.
      Or may at the very least force devs to jump through hoops to wrangle scope into something that keeps variables alive as long as they are needed.

      1. Olivier FAURE says:

        If you’re curious, this video gives a pretty good idea of what Rust gamedev might look like:

        https://www.youtube.com/watch?v=aKLntZcp27M

    2. Arkady English says:

      Fight me.

      Okay, but since you issued the challenge I get to name the terms.

      Venue: any reasonably sized courtyard willing to host us.

      Weapons: Freshly laundered socks, folded into balls and thrown from a range of no less than 4m.

      Winner: One clean hit to the head (from the socks, not from anything else) wins instantly. Else, three clear shots to torso.

      Bring it on!

      1. Duoae says:

        This is genius! I would have gone with rapiers at dawn…

        1. Kylroy says:

          Or Abe Lincoln’s dueling specifications (10th paragraph):

          https://www.historynet.com/abraham-lincoln-prepares-to-fight-a-saber-duel.htm

        2. Matthew Downie says:

          No True Coder would get up at dawn to engage in physical exercise.

          1. Philadelphus says:

            Yeah—if you have to be up that early, might as well just stay up overnight and get some work done while people aren’t around to bother you.

    3. MaxEd says:

      Haven’t tried Rust, but my colleague did, and from his experience, I gather that Rust is just too safe for games. It’s too verbose (in SOME cases), because it tries to be more safe than C++ which often lets you play fast and loose. It’s still a very good language, but maybe not one very well suited for gamedev, where correctness comes distant third to speed of writing code and ability to quickly insert whatever crutches are needed to support latest game designers’ fancy without refactoring the whole thing.

  6. The Wind King says:

    Full article on the front page…

    And I’m mostly here to be impressed, I get I can’t code, I get other people can’t write or sketch, so it’s like looking at something alien to me taking form.

    1. Duoae says:

      Yeah, I have the same problem. I had a module in uni to programme in Fortran 77. It didn’t go well. I couldn’t even make a “Hello world” script.

      However, I have no problem parsing pre-written script. For instance, in Quake 3 Arena, I had no issue re-writing code that allowed specific re-binding of keys to various functions or, for instance, altering the attributes of any item/ability in the game proper. The problem was that I could never write the problem from scratch.

  7. Raion says:

    Not a programmer, but I do have enough surface level understanding of how nightmareish programming is, so I look forward to having a good laugh- I mean, enjoy having the challenges explained to me.

    1. Echo Tango says:

      Fun fact – all problems in programming were caused by other programmers! Sometimes the other programmer was even you, six months ago!

  8. GargamelLenoir says:

    Consider my appetite whet!

  9. krellen says:

    Query: Is Good Robot a “game” by the definition of this series?

    1. Shamus says:

      No freakin’ way.

      I made most of it by myself, engine and all, in my spare time. I mean, it was a lot of work, but that’s peanuts compared to the engines grownups use to make AAA games.

      1. Kai Durbin says:

        So the steps to get GR to count are:

        STEP 1: Sabotage the code so it runs fifty thousand billion times slower.
        STEP 2: It already counted for conditions #1, #2 and #3*, and now it qualifies for #4!
        STEP 3: ???
        STEP 4: (negative) Profit!

        *Wait, uhh… shit. DOES it count for #3? I mean, you use polygons, but you don’t use said ‘gons for 3D purposes (I’m not counting depth, as sprites can be rendered earlier and made smaller to simulate depth). Or we should replace it with ‘intended for human entertainment’? But that excludes ANYTHING from EA due to their business practices. Goddamn it. But jokes aside: I wonder if it does count for #3. It’s interesting for seemingly rigid things to have fuzzy zones like this.

      2. krellen says:

        I assume this is because it’s fundamentally a 2d sprite game and thus doesn’t qualify by standard #3? That is the only condition I wasn’t sure whether it met.

        1. Echo Tango says:

          Putting a 3D scene onto a screen involves an order of magnitude more processing power compared to a 2D scene. Of course even 2D can be done in horribly inefficient ways, if you don’t know how to figure out the time/space complexity of the code you’re writing. Brute-force algorithms are by definition, really slow.

  10. Robert Conley says:

    I concur, learning or a developing programming langauge is one thing but to turn it into something useful for a specific application (or domain) you need additional support usually in the form of libraries or a programming language tuned to the domain as you put it.

    For example I developed motion control software using Visual Basic 6 and we are transitioning over to VB.NET/C# and the .Net Framework. But to make either useful for what I do I need to a half dozen support libraries like serial communication, and libraries that communicate and manipulate the various pieces of motion control hardware I use.

    In addition we also offer support for creating parts, mostly part libraries for the HVAC industry. For that we needed to create a set of libraries that are transferred from version to version. If we were in the business of selling a framework those libraries would be turned into a product that other programmers could use to make HVAC parts.

    In addition because of my work with motion control, I operate in several different programming realms each with their own demands and history of development. The software itself is like many standalone applications developed with a programming language and a popular framework. However the motion control side is a world of PLCs, ladder logic, assembly, and domain specific languages. Operating in a hardware constrained environment of limited RAM, limited storage, discrete I/O, and real time operation.

    While there are time when I wished the motion control side had some of tools I use for software development. Most of it works the way it does because of the domain it is a part of.

    My youngest is getting into Computer Programming, I stress that programming needs context, that it has to coupled with knowledge about a domain, as you aptly named it. Everything we enjoy as a family economically was a result not just my programming skills, but my programming skills coupled with knowledge about motion control, the HVAC industry, and the metal fabricating industry.

  11. Redrock says:

    But eventually the novelty wears off and you realize you’re now obligated to take care of something that no longer delights you.

    Now, I know nothing about programming, but do know about dogs, and let me tell you, a dog never ever ceases to delight. If you have any semblance of a heart on your chest, that is. What I’m saying is, the puppy simile did not work for me in this context.

    1. Lino says:

      I think it was meant more in the sense that a lot of people grossly underestimate what a commitment having a dog is and leave them, because they don’t want to deal with that responsibility anymore: taking it out every day, cleaning up after it, taking it to the vet, playing with it (sometimes you might not feel like it, but as you probably know playing serves as both exercise and socialization for the dog, and is more important than some people give it credit for)…
      The sad truth is that the majority of stray dogs were once pets of people who weren’t up to the responsibility. While I’ve heard of cases where people left their dogs, because they didn’t have enough money to support them, I’ve heard far more stories of “people” abandoning their pets just because they aren’t amused by them anymore, and they don’t want to deal with the responsibility…

      1. Chad Miller says:

        For a more concrete example, popular movies like 101 Dalmatians often result in large waves of adoptions followed by many of those same animals being turned in to shelters or abandoned. (that particular example is especially prone to this problem as Dalmatians are a particularly high-maintenance breed)

    2. shoeboxjeddy says:

      I think a dog ceases to delight when it’s work. Not that you’ll never have a great time again, but does anyone enjoy your dog wanting to be let out for a walk four times in an hour? Or if your dog just keeps barking at something without stopping, ignoring the trained commands to shut up? Or when you walk your dog on the normal schedule and then it shits inside anyway? Or when it’s freezing outside and raining and you’re feeling sick but… dog needs a walk just the same as always.

      Dogs, like human children, need attention and support even when it’s not fun or convenient. That’s why people ditch them (dogs and children…)

      1. swz says:

        I’m sure you know it, but all of your points except the last one are just a sign of a dog with a horrible owner :)

        1. shoeboxjeddy says:

          To be clear, you’re saying if a dog EVER barks for a long period of time, their owner is horrible? Or if they have an accident the owner is horrible? Because that’s… pretty ridiculous. Like, inarguably ridiculous.

    3. krellen says:

      I’m really sick of being called heartless because I do not have the same reflexive “oooh, doggo” reaction that the internet assumes everyone has but it’s still perfectly okay to hate cats and not be heartless.

      Some people like dogs. Some people like cats. Some people don’t like pets because they all give them deadly asthma attacks. None of that makes them heartless.

      1. Echo Tango says:

        You should see the looks I get when I tell people I’m not interested in having children…

        1. Richard says:

          I couldn’t eat a whole one either

      2. D-Frame says:

        I’ve never understood the whole cats vs. dogs thing. You know, as if you’re obliged to pick one. It’s like disliking ice cream because you already like pizza. Sure, they’re completely different, but both great in their own way.

        1. krellen says:

          It’s not an either-or. It’s a “you’re a bad person if you don’t love dogs”. Like people who don’t like ice cream are fine, but if you don’t like pizza? You’re a monster. You’re not allowed to have individual preferences because “only a monster doesn’t like pizza”.

  12. Robert Conley says:

    As an example of how a domain language works.

    If I typed in

    VM XY
    VA 100000
    VD 100000
    VS 10000
    VP 50000, 0
    VP 50000, 50000
    VP 0, 50000
    VP 0, 0
    VE
    BGS

    It would cause a two axis X-Y machine to traverse a square 50,000 units by 50,000 unit at 10,000 units per second, while accelerating or decelerating at 100,000 units/sec^2

    To this traditionally would require a large support library that would take the above info and decomposing into a series of timed pulse directed at the X and Y axis. It would needed to be coupled with a real time operation library. In short there would be a lot of plumbing that I would have to get through to even address the issue of moving around a 50,000 by 50,000 square.

    Each part of which is something that I could screw up or write in a sub optimal way. When you extend this to things like I/O, and parallel processing tasks then most of the project is spent just building the scaffolding just to get to the point of doing the thing the boss wants.

    Sure you could build all the libraries and support you want but then every year some piece of hardware comes out that effects the above. New CPU architecture, new motion control devices and so on. What ideal is to have a vendor doing all the plumbing i.e. programming language and environment. So I can focus on our specific application or needs.

    1. Lino says:

      What ideal is to have a vendor doing all the plumbing i.e. programming language and environment. So I can focus on our specific application or needs.

      Why isn’t there a vendor to do just that? There are companies specializing in all kinds of exotic and obscure software, isn’t there a streamlined piece of software for the industry you work in?

      1. Richard says:

        I’m sure there are many.

        For example, CNC lathes, milling machines, 3D printers, photoplotters and other machine tools are often driven by G-Code (RS-274), Gerber (RS-274X) or other languages.

        These languages abstract away all the nitty-gritty of actually spinning the lathe at a defined RPM, moving the tools in lines and arcs, swapping tools, extruding plastic at the right rate while also moving the print head etc.

        You could write raw (eg) G-Code to 3D print your latest work of art, but it’d be quite difficult.

        So there are a great many CAD applications to write it for you, which are even more domain specific – eg PCB design, 3D printer ‘slicer’ applications etc.

        Most of them will output multiple languages and dialects, as each machine will only support a subset of the language and have other mechanical limitations such as max. acceleration.
        – Obviously a 3D printer wouldn’t support lathe RPM commands, however some machines can’t do 3D or even 2D arcs (so the CAD ‘fakes’ it with short straight movements) etc.

        Also, some codes are manufacturer, model or firmware-version specific in their function.

        So yes, there’s plenty of such tools – but choosing the right one is hard

  13. neminem says:

    I find it sort of funny that your introduction expresses confusion at the number of people who would find this sort of topic interesting, despite which you basically answer your own question midway in ;). I am a programmer, but am not and have never been a game developer, nor do I particularly want to be (3d hurts my head!), but I do find the topic interesting at exactly the high level you talk about it at. I imagine you probably have a lot of such people subscribed to your blog. Obviously not everyone, but I’m sure higher than average for a not-only-programming-topics blog. ;)

  14. Joe Informatico says:

    Still, it seems like engineers who operate on physical hardware are more likely to identify their domain during a discussion, while programmers are more likely to get in arguments without any of them ever making clear what kind of programmers they are.

    I’m coming at this as an outsider, but isn’t a big part of the reason because in more physical engineering and technical disciplines, there’s a definitive process of certification that is necessary for professional, legal, and/or ethical reasons? Whereas in software development, certification seems to exist more for software publishers (or their HR departments) to pass the responsibility of job training onto employees or third-party trainers?

    E.g., if you can demonstrate years of experience in coding in C+, do many employers really care if you’re certified? Whereas in other industries it might not be possible to be employed without recognized credentials. And I can understand the mentality, if the biggest success stories in your industry are mostly guys who never finished their comp sci/comp eng degrees and just spent months or years coding in their dorm rooms or basements until they convinced someone with millions of dollars to throw money at their ideas.

    1. Bloodsquirrel says:

      No, domain-level certification for engineering isn’t that common.

      I’d imagine that it has more to do with how much more domain-specific even the basics are in engineering. In computer science, you have domains. In Engineering, you have disciplines (ie, electrical vs. mechanical), and then within those (and sometimes sort of across them) you have domains (ie, electronics vs. power), and sub-disciplines within those. And within those domains you’re mostly dealing with large amounts of existing infrastructure and relatively modest innovations on top of old designs. In computer science, you can decide to build your own vector library if want. In my job, I can’t just decide to build my own relays, being that they require physical manufacturing and all.

      Another big difference is that, in computer science, you’re always starting from the same place: a computer with a processor, memory, hard drive, etc. In engineering, different domains have different physics that they have to deal with. It’s plausible to think that you can start with a blank slate and create your own game engine with your own rules, but if you want to build a bridge, then you can’t just make up your own loading equations and stress values for steel.

      In general, you’re much less of a god of your own little world in engineering than you are in computer science.

    2. Erik says:

      The primary domain that most relies on certification (e.g., the US “Professional Engineer” certificate or other country equivalents) is building/Civil Engineering. When you’re constructing physical infrastructure, most employers want to be *sure* you know what you’re talking about so it doesn’t fall down and kill hundreds of paying customers.

      Engineering inside a corporate environment generally uses certificates like they use academic degrees, as a proof you’ve studied something and had enough competence not to drop out. It’s much more rare for them to formally require them (aside from HR screening checklists, which can almost always be set aside).

  15. Joshua says:

    “I don’t know what the deal is with this particular discipline, but everyone presumes to know everyone else’s business.”

    Probably something to do with the types of people that typically go into programming, to use some stereotypes. Why do so many table-top gamers want to tell other gamers about exactly what “cool” thing went down in their campaign or all about their character’s background, despite the fact that almost none of them care? Why do so many video-gamers try to explain exactly what strategy someone should use for a particular game (in games where there could be dozens of viable strategies or more)?

  16. Ander says:

    I love reading Carmack.
    “The flight control code for the Armadillo rockets is only a few thousand lines of code, so I took the main tic function and started inlining all the subroutines.”
    Let’s ignore the point of the linked article for now. The guy just downloaded the code to the Armadillo ROCKET and started playing with it, to better understand how to code Doom 3.

    1. Paul Spooner says:

      Well, Carmack founded, funded, and ran Armadillo Aerospace at the time, so he had responsibilities for the rocket code as well.

    2. BlueBlazeSpear says:

      Oddly enough, John Carmack was just on The Joe Rogan podcast of all places for anyone who likes to hear him speak and has two and a half hours to kill.

      1. Shamus says:

        Oh wow. How have I never heard about this before? Thanks so much for the link.

  17. Lee says:

    I’m really looking forward to this series. (Though actual programming “let’s plays” like your old city generation series are even more my jam). (And Paul’s proc gen articles are almost there for me. I think I’m suffering from the fact that I know nothing at all about Blender.)

    On the subject of your definition of “game”, I’m going to suggest you get into the habit of saying “modern game”. Unless you plan on re-iterating that definition paragraph in every article, you’re quickly going to get people who forgot it, or never read it but read one of the later articles. If on the other hand, you use “modern game” each time, it becomes much more obvious that you’re talking about a specific subset of games, not all games ever.

    Of course, some other modifier instead of “modern” might also work. I just came up with that off the cuff, when considering that 2D side scrollers and such can be (and are) referred to “classic” games.

    1. Duoae says:

      On the subject of your definition of “game”, I’m going to suggest you get into the habit of saying “modern game”. Unless you plan on re-iterating that definition paragraph in every article, you’re quickly going to get people who forgot it, or never read it but read one of the later articles. If on the other hand, you use “modern game” each time, it becomes much more obvious that you’re talking about a specific subset of games, not all games ever.

      Or, you know, he could just link this article in the opening blurb of every article….

      1. Echo Tango says:

        “3D AAA game” is also pretty short.

    2. Syal says:

      Extreme Graphics Games.

  18. Daimbert says:

    I think that things are different with programming at least in part because:

    1) Most programmers have at least SOME experience with game programming, either through schooling or through small projects of their own.

    2) A lot of the decisions that the game designers are talking about having to make are decisions that they’ve had to make or had been a part of in their jobs, for things that are much more detailed with far less room for error than games.

    3) In general, the game domain seems to be smaller and more simple, even at the AAA level, than what they’ve worked on. No AAA game can compare to, say, major banking systems, network management systems, or airplane/train control systems.

    All they miss is the specific domain knowledge of games, but even a lot of the things you talk about here and have talked about are things that they’ve had to deal with, like the trade off between power and maintainability/readability. So it doesn’t seem as foreign as some of the other things you mention.

    1. RFS-81 says:

      I don’t know, I can’t come up with a domain that has a similar combination of high performance requirements, low latency and high-powered 3D graphics. Maybe the UI of Blender?

      1. Daimbert says:

        Well, none of these things are identical, but outside of the 3-D graphics a lot of business applications have much more concerns with performance and latency … and have much greater consequences if they crash. So while the specific concerns are different, many of them have had to balance similar concerns and at least have some idea how to go about figuring out what the best language to use is.

        If the people commenting on it aren’t just people advocating for the language they just happen to like the best — which is unfortunately common in all and in cross-domains — for the most part a lot of them will be trying to solve the programming problem presented to them — even if it isn’t their specific problem — the way they’ve always solved it before. Figuring out what language or third-party library is best for a task is pretty common in most programming domains, so they all have an approach and idea on how to do so.

      2. psychicprogrammer says:

        Scientific computing guy here, we don’t quite do 3D rendering, but most of our work is matrix algebra, sometimes on GPU’s which is quite similar. We really care about performance given that we like to run month long calculations on super computers.

        The big difference is that our systems as far less complex from a programming perspective so we don’t really need object orientation.

    2. Dry says:

      You’re extremely delusional or misinformed if you think a banking network is more complicated than a triple A game. It’s 3 orders of magnitude simpler.

  19. Ander says:

    The relevant xkcd’s….
    Here to Help on programmers working outside their domain
    Physicists on oversimplifying another domain

  20. Duoae says:

    I’m really looking forward to this series – despite the fact that I’m one of those people with next-to-zero programming experience that will enjoy your ‘everyperson’ explanations!

    Saying that, here are a few choice joke quotes from the way you laid it all out beforehand… and (hopefully) managed to avoid this sort of criticism and misunderstanding!

    “Cooking Mama” is a “trivial coding experience”. Shamus Young – Eurogamer

    Sexism in gaming is alive and well! – IGN

    “Shamus young calls programming 2D games ‘trivial'” – Gamespot (deceased)

  21. Decius says:

    The thing about the Dunning-Kruger effect is that you know that everyone who is convinced they know all about it knows nothing about it.

    Everyone agrees that it applies to other people. Which means everyone but me agrees that it applies to me as well. The rest of the world must be really messed up, thinking that just because something applies to all known humans it applies to ME.

    1. Geebs says:

      AFAIK Dunning-Kruger has only ever been tested in psychology undergrads, and therefore can only be used to describe illusory superiority in psychologists.

      1. Matthew Downie says:

        Some googling suggests otherwise. “One study of high-tech firms discovered that 32-42% of software engineers rated their skills as being in the top 5% of their companies. A nationwide survey found that 21% of Americans believe that it’s ‘very likely’ or ‘fairly likely’ that they’ll become millionaires within the next 10 years. Drivers consistently rate themselves above average. Medical technicians overestimate their knowledge in real-world lab procedures. In a classic study of faculty at the University of Nebraska, 68% rated themselves in the top 25% for teaching ability, and more than 90% rated themselves above average”

        Then again, Impostor Syndrome seems pretty common, and that’s basically the opposite of D-K.

        1. Geebs says:

          Interestingly, the number of millionaires in the USA has doubled between 2009 and the present day, to about 5 million individuals. The working age population of the USA is about 200 million. That means that on average about 2% of people predicting that they were going to become millionaires were correct. If the survey was conducted in up-and-coming types, and depending on the definitions used for “likely” to become a millionaire, that 21% might actually have been a completely rational assumption by the study participants.

    2. Olivier FAURE says:

      Whether or not Dunning-Kruger is real at all is highly controversial; and even if it is, it isn’t exactly “geniuses think they’re dumb and idiots think they’re geniuses”.

      The effect described in DK’s study is more that everyone thinks they’re more average than they are: very good people think they’re kinda good, and very bad people think they’re kinda bad.

      1. WWWebb says:

        That’s what happens when everyone uses their own yardstick. Most people don’t do a task in a way they KNOW is bad. When everyone else in the world does it a different way, which is more likely:
        1) there is another way to do the thing
        or 2) everyone else in the world is an idiot?

        (obviously the answer is #2 … which you would have known if you were a genius like me)
        ;)

        1. Olivier FAURE says:

          You don’t… that thing you’re saying is the opposite of what I said.

          My point was, the “all the idiots think everyone else is an idiot” effect as widely understood doesn’t exist. People roughly know how smart they are at any given thing. There’s a good argument to be made that the DK effect was just a statistical artifact.

  22. Steve C says:

    You can tell a carpenter from an auto-mechanic by a glance when they aren’t working by counting:
    Fingers (less than symbol) Toes = carpenter
    Fingers (greater than symbol) Toes = auto-mechanic

    (Sigh. Html screwed up my joke.)

    1. Geebs says:

      I laughed, after > five minutes thinking about it.

  23. Agammamon says:

    I don’t want to get dragged into pedantic arguments over Zork et al.

    Look, that cursor blink is just buttery smooth at 120 FPS.

    1. PeteTimesSix says:

      You joke, but the first thing I noticed when I plugged in my new 144hz monitor was that I could no longer see the gaps between frames when I moved the mouse pointer. Did not see *that* coming.

  24. John says:

    I dabble in games-programming, but my games are small, simple and (so far at least) always 2D. I’d simply never finish anything more complex. Even the thought of a 3D game fills me with dread. I don’t want to have to make 3D assets, let alone implement something like camera management. From my perspective, the best (so to speak) programming language is the one that makes things the easiest for me. I don’t worry much at all about things like efficiency or memory usage because my games just aren’t big enough for those to be serious problems.

    I use Java. For my purposes, the virtues of Java, in approximate order of importance, are (1) I already know Java, (2) the Java2D graphics API is pretty straightforward, (3) Java (including the Java2D API) is fairly well documented, and (4) the same code runs on both my Linux and Windows partitions. This is very different from the pitch you get in Java-based game-programming books. Said books–or at least the aged one I happen to own–like to claim that Java is just as good as all those other programming languages for gaming purposes. There are various technical arguments related to, among other things, the claim that Java is too slow for games. I don’t worry too much about these arguments because, for me, they simply aren’t relevant and, honestly, I don’t have the technical expertise to follow them anyway.

    But the thing that makes claims that “Java is great for games, no really!” ring hollow for me is that the list of Java games is, with the exception of Minecraft, a bunch of stuff that either I’ve never heard of or else incredibly undemanding, hardware-wise. it tends to be licensed stuff aimed at, for want of a better term, non-gamers (or maybe non-hardcore gamers). The specific example I have in mind is a Law & Order game of some kind. I’m all for games with low system requirements, but you’re never going to impress the C++ enthusiasts with that kind of argument.

  25. Michael Anderson says:

    I am glad things didn’t get too bogged down in the ‘Domain’ discussion here in the comments – compared with how obtuse you made it in the article! :D.

    “Domain experience is everything.”

    That pretty much sums it up – I am a statistician and optical measurement engineer, but with experience in quality systems and electrical engineering (original degree). There are so many areas of close and distant domains even within my own company (Corning, if anyone cares), let alone across companies in the same industries, and certainly across similar disciplines in different industries!

    And as you say, there are numerous things that happen when someone assumes they have expertise in an area where they simply have unrelated knowledge. Generally – it is annoying. But if that person has sufficient influence, it becomes problematic. I think I have seen literal ‘man-years’ spent either battling against wasting time chasing down leads from people without domain knowledge, or spent undoing harm from such pursuits.

    1. Kathryn says:

      I do care, because it’s really hard to get good, high-quality glass for my applications :-)

  26. Leeward says:

    I think a better analogy than car mechanics and airplane mechanics is people who work on particular types of cars. Formula 1 teams have mechanics, and I used to go to a mechanic that specialized on 4-cylinder Japanese imports. Sure, the guy who works on minivans all day knows the theory behind how race cars works, but the kinds of problems he deals with day to day are still different. Most of the skills transfer, but if you’re working with parts that are designed to last over 100,000 miles, it’s pretty different from an engine that needs to be rebuilt before every race. Likewise, soccer moms don’t get in a huff if a slighly mis-tuned fuel injection system costs them 2 HP.

    I was recently asked about something video-related in an interview for embedded systems. I’ve never worked on a system with a screen before, but I could still estimate the memory requirements added by a display of a certain resolution with a certain color depth. Programming is a particular kind of skill, and while the things you care about as a Javascript developer who works on web sites are different from the things you care about when writing AAA video games, the fundamental skill doesn’t change.

    Turbines are totally different from piston engines, but for loops are for (;;).

    I hope nobody tries to argue that their state machine code generator for embedded systems should be used in your AAA video game development, but as someone who’s worked in a few very different domains of software development, I think you might be overstating how special games are. Still, this whole post is an attempt to avoid pedantic bickering, and I’m genuinely looking forward to seeing why you think games are special and which of C++s many (many) shortcomings hurt game development the most.

    1. Echo Tango says:

      Personally, I think C++ hurts many different disciplines, but I’m also the guy who hates pretty much most programming languages, libraries, frameworks…

    2. Richard says:

      The “real-time on commodity hardware on a commodity OS” requirement is relatively unique.

      Most of the non-gaming applications you run on your PC/phone don’t need to be real-time – and usually aren’t even close.
      When Word sometimes takes twice as long to display a character, you probably won’t even notice. Heck, sometimes Word is half a second behind my typing, and it’s still ‘kind of ok’.

      If your FPS game does that, it’s immediately noticeably annoying, and perhaps even unplayable – or at least, ‘not fun anymore’.

      There are of course other domains which have this requirement, though not many.

  27. KillerAngel says:

    I have a question.

    I just read the hyperlink from “arrogance” about why Lisp is the best language ever but, not being a programmer myself, could someone explain to me why he’s wrong, or if he is? I can feel the arrogance seeping out the words on my screen in terms of the tone of his message, but I am curious to know why (if?) he is wrong from a business and technical perspective.

    1. Ander says:

      I happen to enjoy Lisp-flavor languages, but if we’re talking about this particular article:
      I don’t think there’s something there can I can disprove. He’s talking about his personal business experience with LIsp relative to competitors. Anecdote is hard to prove or disprove. It’s either something that happened or it isn’t, and I don’t know which is true here.
      Now, Lisp as a programming language.
      He says several things about Lisp. But I don’t think he makes much of an argument about the language itself. He name-drops several Lisp features such as recursion and macros, but he doesn’t argue for their importance except with exclusivity. It’s like claiming C++ is superior because it has header files or C# is superior because it doesn’t. His central argument is “more power,” and he doesn’t provide evidence of these features being “better” except, again, with experience (either his own, the reader’s, or the hypothetical Blub programmer). That may persuade or it may not. Personally, I don’t think it’s a strong argument for the language.
      All that being said. He’s not wrong that macros are hard to explain. He’s not wrong that Lisp forces the programmer to think in helpful and different ways. I believe my skill has been enriched by trying it out. Lisp flavors are fun for me; I wish I had more excuse to use one. I break out Lisp for programming challenges, and it does allow flexibility and expansion in surprising ways. There are several benefits of using a Lisp flavor that the writer didn’t mention and I would have*. But he is probably wrong that Lisp is a silver bullet to software competitiveness. Having never used it for business, I can’t speak from experience. My brother loves working with a Lisp variant called Clojure.

      *Wasn’t going to do this, but for the curious, here’s some of what I like. Lisp languages tend to not rely on global variables/global state. When you call a function, it only needs the parameters you give it, so you don’t have to worry about what values might be or exist in other parts of the program. This also makes it easy to test, since you only need to mock up parameters for the function you’re testing, rather than spinning up the whole program or some testing suite. Functions can be passed around like any other object, too, meaning that you can chain them together very easily into a nice, logical flow.

      1. baud says:

        > This also makes it easy to test, since you only need to mock up parameters for the function you’re testing

        From my limited experience in writing tests, I’ve never really saw the point of testing just one method, especially on isolation, compared to integration testing, where you test all the program with normal-looking tasks. Testing one method would just reveal bugs caused by that particular set of inputs, whereas bugs are usually created by method not fulfilling their contract for a particular set of inputs that happens when using the software, so if you didn’t use those inputs in your tests, well they aren’t going to be useful..

    2. Leeward says:

      He’s not wrong. Lisp is the best language ever invented in the 1950s.

      Seriously, though, in the late ’90s he might have been right. Survivorship bias aside, he was very successful with his strategy.

      Technically speaking, the idea is sound: use the highest level language you can to solve the problem at hand. As Paul Graham wrote in the essay, programming languages come in levels of abstractness. At the bottom, there’s machine code, which is just bits that the computer can interpret. There’s no well-defined pinnacle (though Graham claims that it’s Lisp) but higher level is usefully defined as more expressive.

      By expressive, I mean that you can use fewer characters to generate more machine code. It’s not a perfect definition, but it’s quantifiable. If you’re writing in assembler, there’s a pretty fixed ratio of instructions to bytes of machine code. 1 line of assembler code is generally 1 machine code instruction. C abstracts away from it a bit, so a line like printf("Hello, world"); might expand to several instructions for loading some addresses into registers, pushing some other registers to the stack, and calling a function. The only drawback of higher level languages is that they necessarily come with less fine control over things. Sometimes they come with runtime environments that take up large amounts of memory. They come with easy to use predefined data structures, but those are optimized for the general case, not your particular case. Usually this doesn’t matter. Sometimes it really matters.

      Digressions aside, the business perspective is a bit different. The reason why deeply flawed languages like C++ have such staying power is business based. Let’s say I’m running a business that depends on a significant amount of code. Like a good steward of shareholder money, I don’t want to risk having the business cease to function because a single person leaves. Hiring people who know Lisp or Erlang is much harder than hiring for Java or C++. Therefore I would prefer for my code base to be in a popular language.

      Likewise, on the supply side of the labor market, people see lots of jobs out there for Java and decide to spend their time learning Java. If I’m working on a project and I have the freedom to pick which language I use, I’m still incentivized to use a popular one because it looks better when I go to interview for my next job. Companies aren’t looking for people who know Haskell; they’re looking for C++ programmers. So I use a tool that’s less optimal for the task at hand but more optimal for my career trajectory.

      I actually worked at a company that ported its entire product from Ada to C because they couldn’t hire Ada programmers. That was expensive.

      In conclusion, Paul Graham came by his arrogance honestly. He made huge amounts of money working with a tiny team writing software fast. On top of choosing a good tool, he was a talented hacker. The main reason why most companies use the most popular language is their self-perpetuating popularity. That’s not necessarily a bad reason.

    3. Cubic says:

      Naughty Dog started out by writing their own Lisps named GOOL and GOAL and then implemented Crash Bandicoot and Jak and Daxter in them.

      https://en.wikipedia.org/wiki/Game_Oriented_Assembly_Lisp
      https://news.ycombinator.com/item?id=2090554

  28. samuel222 says:

    You know you can totally run your engine in C++, and then do game mechanics in the much more comfortable lua, and the two interact very seamlessly. On top of that modern C++14 is fairly usable compared to the painful dinosaur that is C++98.

    Which is precisely what most big engines nowadays do.

    And if your game is even a little bit below maximum graphical fidelity, you can write the whole damn thing in literally any language and it will run just fine because average hardware is so bloody fast.

    So really, Blow is trying to solve a problem that does not exist, and he is trying to do it in the most difficult manner possible, without having the credentials to do it. Building a programming language that can compete with what we have is a hard task.

    Also I am sceptical about this series: Computer Science is changing rapidly, and you’ve not worked in the field for a decade or so. Most of the things you know are probably somewhat outdated, if not completely replaced, especially when it comes to language design. For example: Did you know that linked lists are literally gone? They get outperformed by arrays in all use-cases due to cache and prefetching. A lot of staple assumptions have completely changed (again) in the last decade.

    1. Shamus says:

      I would be very surprised if you approved of anything I posted, since you’ve only ever left negative comments. Nice of you to start preemptively dismissing me before I’ve even begun to make my case. Well, I guess you did that after being needlessly condescending.

      Are you being unpleasant on purpose, or are you genuinely unaware of how you present yourself?

      1. Echo Tango says:

        Maybe they’re just trolling? Like, write things with juuust enough technical wording to sound like something worth arguing over, and do it in a really aggravating way? It definitely seems possible. :)

    2. Echo Tango says:

      If your idea of software optimization is choosing between arrays and linked-lists, then I think you need to go back and re-read your algorithms textbook. Several times.

      1. Olivier FAURE says:

        The general point he’s making is accurate: algorithms and data structures that were made to minimize big-O complexity are increasingly getting phased out in favor of data-based programming techniques, that focus on CPU cache hits, branch prediction, and easy parallelization and vectorization.

        (also slot maps are the best data structure for game programming; FIGHT ME)

        1. samuel222 says:

          Precisely. I just wanted to demonstrate with an easy example that things I learned at university ten years ago (which were considered fundamentals) are now straight up incorrect in real applications. That is how fast this field moves: This is like finding out in high school that the rules for addition and subtraction you learned in primary school have changed in the mean time.

          With Kotlin, Rust, Closure and Go currently dominating the news, someone who is only fluent in C++98 might not be the ideal person to talk about language design, one of the more difficult areas of computer science.

  29. DGM says:

    For those discussing what will replace C/C++, Eric S. Raymond – one of the tribal elders of the programming world – has some interesting thoughts on what will enable a language to become the new top dog. I should mention that these aren’t aimed at non-programmers like Shamus’s articles are:

    The big break in computer languages: http://esr.ibiblio.org/?p=7724
    Language engineering for great justice: http://esr.ibiblio.org/?p=7745#more-7745

    EDIT: I should also mention that his blog is having trouble loading today for some reason. Keep trying, as it does work sporadically.

    1. Echo Tango says:

      I dunno…take programming advice from somebody whose blog is dodgy and sporadic? ;)

      1. DGM says:

        Heh. Fair point, but I check it often and I assure you it’s not normally like this.

        I just managed to get a comment through mentioning it. Assuming the problem is even on his end I’m sure he’ll get it fixed soon.

      2. Leeward says:

        When it’s ESR, I think we can make an exception. The guy is a giant in the community. Don Knuth’s web site looks straight out of 1998, but I’d still take his advice on any computer sciency stuff.

        1. DGM says:

          Also, it turns out the problem wasn’t on his end anyway. His response:

          “Cert flakiness at ibiblio. Happens a couple times a year; they fix it, but it can take a day or two.”

          It seems to be loading reliably again now.

    2. Olivier FAURE says:

      The Zig language is also starting to look interesting.

  30. Rosseloh says:

    and programmers would be irritated by all the entry-level explanations for things they already understand.

    Random thought: I don’t have my pilot’s license yet, but I do a LOT of flight simulation. I know how to fly a pattern, how to correct for wind drift, how to lean an engine, how to program a flight plan. And a lot more. I’m no expert but I’m reasonably competent.

    And yet, if there’s an article, guide, or youtube video I haven’t yet seen about the basics, written or presented by someone who knows what they’re doing and has a decent style (voice or writing), I’ll read/watch it anyway. Doesn’t matter that I’ve done this a million times before, or that I know everything in it already. I just…like it. I even think about it while I’m reading/watching it…”I already know this, so why do I find this interesting?”

    Maybe these programmers who don’t mind your posts (if they exist, I guess I don’t really read the comments much) are like me in that way?

    1. Matthew Downie says:

      There’s lots of perfectly good reasons for saying, “I probably already know all this, but I’ll watch it anyway.”
      You can help get your thoughts on the subject clearer so you can explain it to others.
      You can remind yourself of details, or cover over gaps in your knowledge.
      You can post comments to point out misleading statements or additional relevant information.
      Or you can just enjoy thinking about something you enjoy thinking about.

  31. Mistwraithe says:

    I’m an experienced business application developer who, as of a couple of years ago, also does game programming in my spare time. I find I am generally interested in most new content Shamus writes because it is entertaining and often thought provoking. The programming posts are no different for me and whatever relevance there is to my own work just adds to that interest…

  32. Ben Matthews says:

    Shamus: you wonder why your programming stuff seems so popular, but looking at your comments… I’d say it’s probably because it gives a bunch of coders an excuse to engage in banter and argument :)

    1. DGM says:

      if (containsElement(TwentySidedPosts[last_post].keywords, “programming”)) then
      {programmers.kibitz = true;
      }

      EDIT: Frickin’ blog software won’t leave my whitespace alone…

  33. MichaelG says:

    Shamus, I sent you some email. No reply yet. Check your spam folder?

Thanks for joining the discussion. Be nice, don't post angry, and enjoy yourself. This is supposed to be fun. Your email address will not be published. Required fields are marked*

You can enclose spoilers in <strike> tags like so:
<strike>Darth Vader is Luke's father!</strike>

You can make things italics like this:
Can you imagine having Darth Vader as your <i>father</i>?

You can make things bold like this:
I'm <b>very</b> glad Darth Vader isn't my father.

You can make links like this:
I'm reading about <a href="http://en.wikipedia.org/wiki/Darth_Vader">Darth Vader</a> on Wikipedia!

You can quote someone like this:
Darth Vader said <blockquote>Luke, I am your father.</blockquote>

Leave a Reply to Olivier FAURE Cancel reply

Your email address will not be published.