Share this postProgramming — Table Of Contentswww.rfleury.comCopy linkFacebookEmailNotesOtherProgramming — Table Of ContentsRyan FleuryJan 27, 20231Share this postProgramming — Table Of Contentswww.rfleury.comCopy linkFacebookEmailNotesOtherShareFactorio, Mutation, & LossinessRyan Fleury·Jul 26I heard about Factorio not long after its 2016 release. Within the span of a few months, several friends of mine developed a new addiction—it wasn’t to any kind of physical substance, but it might as well have been. As such, I avoided playing it at first; I wanted to give it a try when I knew I had a few weeks of time off, and such periods become exceed…Read full storyThe Function Is A LieRyan Fleury·May 10I recently mentioned, in conversation, a technique I regularly use for user interface animation, which I’ve written about before. It’s not applicable for all animation curves in all scenarios, but it tightly fits design goals for a user interface, it’s simple, it’s low-cost to implement, and it produces robust animation behavior which gracefully adapts to mid-animation changes. Importantly, this technique introduces no newRead full storyThe Codepath Combinatoric ExplosionRyan Fleury·Apr 12I defined a codepath as “a sequential list of instructions which terminates”. One interesting detail of that definition is that it entirely ignores control flow—there is no way to form loops or conditionals in a codepath (given that definition), because an executor must necessarily execute instructionsRead full storyMain Loops, Refresh Rates, and DeterminismRyan Fleury·Mar 31One of the first lessons in game, simulation, and application programming is on the “main loop”: for(B32 should_quit = 0; should_quit == 0;) { GatherInputs(); // get data encoding input from user Update(); // simulate, using new inputs Draw(); // draw state of simulation on screen }Read full storyA Taxonomy Of Computation ShapesRyan Fleury·Feb 17Many learn to program because they’re fascinated by—and talented at solving—the tricky logic puzzles involved. But those puzzles weren’t my top priority when I started programming. I can appreciate a good puzzle, but I got into programming because, originally, I wanted to build my own video games. I still lovedRead full storyEmergence and CompositionRyan Fleury·December 1, 2022There are only two hard things in Computer Science: cache invalidation and naming things. —Phil Karlton Naming is often called one of the most difficult problems in programming. Surely, at least once during a programming conference of your choice, and almost always by someone who has done a lot of programming.Read full storyIn Defense Of Linked ListsRyan Fleury·November 1, 2022Learning the basics of data structures is a rite of passage for new programmers. On their first day doing so, chances are they’ll encounter the idea of a “node”, and the idea of links between nodes. Both of these ideas can be used to organize data in innumerable ways.Read full storyYou Get What You MeasureRyan Fleury·October 7, 2022I’ve noticed an unfortunate development habit of mine. I’m not the only one, so chances are if you’ve avoided this habit yourself, you’ve at least seen it elsewhere. This habit is over-secrecy in a project’s development. “Nobody can see it until it’sRead full storyUntangling Lifetimes: The Arena AllocatorRyan Fleury·September 23, 2022In every instance when I’ve said that I prefer to write my software in C, the response is—normally—raised eyebrows. Several dominant memes in the programming world make my position unpopular, and thus uncommon to find. I regularly hear, “why would you write new code in an unsafe systems language?”, “performance isn’t everything!”, and perhaps the most c…Read full storyTable-Driven Code GenerationRyan Fleury·July 30, 2022Anyone who has written C has been in the situation—you write an enum, and sooner or later, you’d like to associate values of that enum with strings. You might want to log a value to plaintext in a human-readable form, or you might want to display the value in a user interface.Read full story