The same person as Daedskin@lemm.ee and Daedskin@programming.dev

  • 0 Posts
  • 17 Comments
Joined 5 months ago
cake
Cake day: June 26th, 2025

help-circle


  • One thing you can do that I find comes up pretty often in C is start using switch statements to avoid code duplication. Because your operators all take 2 numbers, you’ve separated out the input handling into its own block; that alone is a really good insight.
    You can take it another step further by making your print statement also, mostly, one block of code, with the only difference being the operation being preformed. By printing “The” followed by using an if-else block — or, again, preferably a switch statement — to both print the operation text, and compute memory, you can print the remainder of the line the same way for every operation.
    It may seem nitpicky for such a simple program; but the use case of C is for programs which require tight execution and often contain complex, low-level logic. Reducing complexity whenever possible helps make C more readable, as well as signal when the complexity is necessary.


  • I once worked on a project doing firmware that a lot of people have likely used (printer firmware for a big-name company). One of the more trafficked functions was something like 1500 lines of “if-elseif-elseif…” with something like 13 or 14 different cases.
    It did end up getting refactored to something polymorphic and based on a configuration file to cut out any unnecessary steps, but it was like that for a while before I got there, and was like that for most of the year that I was part of the project.








  • In no particular order, and without adjusting for recency bias:

    Single player

    • Hollow Knight
    • Undertale
    • Outer Wilds

    Multiplayer

    • The Finals
    • Awesomenauts*
    • YOMI Hustle

    * Right now the game is in a weird state where the original company who owned it went backrupt, and the game is in the process of being revived by a different company. In the meantime, the already low player count got lower. On top of that, there’s two versions of the game: an old version that used Steam matchmaking (as the matchmaking server went down when the game original closed); and what had been the current patch, being accessible on a beta branch, which currently has issues making it hard to actaully play a match.







  • I’ve never been called out as AI for using them; but if I ever am, I have the strategy of knowing the alt code for them (0151). I even know the shortcut in word to insert one — pressing alt-X with your cursor at the end of “2014”. I also have a vscode macro set up that is just an emdash, just in case I’m in a situation where there’s not a way I know to insert one.