• 163 Posts
  • 980 Comments
Joined 3 years ago
cake
Cake day: July 2nd, 2023

help-circle





  • C, C++, C#, to name the main ones. And quite a lot of languages are compiled similarly to these.

    To be clear, there’s a lot of caveats to the statement, and it depends on architecture as well, but at the end of the day, it’s rare for a byte or bool to be mapped directly to a single byte in memory.

    Say, for example, you have this function…

    public void Foo()
    {
        bool someFlag = false;
        int counter = 0;
    
        ...
    }
    

    The someFlag and counter variables are getting allocated on the stack, and (depending on architecture) that probably means each one is aligned to a 32-bit or 64-bit word boundary, since many CPUs require that for whole-word load and store instructions, or only support a stack pointer that increments in whole words. If the function were to have multiple byte or bool variables allocated, it might be able to pack them together, if the CPU supports single-byte load and store instructions, but the next int variable that follows might still need some padding space in front of it, so that it aligns on a word boundary.

    A very similar concept applies to most struct and object implementations. A single byte or bool field within a struct or object will likely result in a whole word being allocated, so that other variables and be word-aligned, or so that the whole object meets some optimal word-aligned size. But if you have multiple less-than-a-word fields, they can be packed together. C# does this, for sure, and has some mechanisms by which you can customize field packing.





  • I’d say it depends on WHY you like the art. Does it tie into the toxic or reprehensible traits of the artist? Was the artist trying to send a toxic or reprehensible message with this art?

    If not, then it’s just a matter of ensuring that your enjoyment of the art doesn’t translate into support for the artist. Or, at least, that it doesn’t cross your personal line of support for the artist.

    So, for example, does the Kanye music you like have nazi themes or messaging? Far as I’m aware, no, the nazi-ism is just his newest shit, so you’re probably fine as long as you’re not streaming from Spotify or YouTube, or otherwise giving him revenue.









  • The REAL problem is that the industry collectively uses JS almost exclusively for shit it was never meant to do. Like you say, it’s intended for it to not throw errors and kill your whole web page, because it was only ever intended to be used for minor scripts inside mostly-static HTML and CSS web pages. Then we all turned it into the most-popular language in the world for building GUI applications.


  • Honestly, if you’re having trouble finding stuff for vanilla JS, I’d recommend looking at jQuery. Not that you should USE jQuery, necessarily, but the library is basically a giant wrapper around all the native JS APIs, so the approach to building stuff is essentially the same: it all focuses on tracking and manipulation of DOM elements.

    I do vanilla JS (actually TypeScript) dev at work, daily, and that was my big takeaway from spearheding our team’s migration from jQuery to vanilla TypeScript: I honestly don’t know what benefit jQuery provides, over vanilla, because all the most-common jQuery APIs that we were using have a 1:1 native equivalent.

    We do also use 2 third-party libraries alongside vanilla, so I’l mention those: require.js and rx.js. Require you probably don’t need, with modern JS having bundling and module support built-in but we still use it for legacy reasons. But rx.js is a huge recommend, for me. Reactive programming is the IDEAL way to build GUIs, in my opinion.


  • Blue Prince sure feels like it counts, our whole family is hooked, and has been playing it every day for about 2 weeks now. Even well after rolling credits.

    In a similar vein, I’d have to say Hollow Knight and Outer Wilds. Together with Blue Prince, they all have a storytelling strategy of “you have to put some effort into getting the story out of it”, but the effort makes every new discovery or revelation feel super rewarding.

    Celeste is the one that comes to mind for a more traditional story that REALLY hit.

    Persona 5 comes to mind, too. I was ENGROSSED in that story for months. Even if it went off the rails a couple times.

    I’m also gonna shout-out Tales of Symphonia. That game was formative for me.