👾 Game Player 🎲 Dice Jailor 💻 Functional Typer 📹 Content Creator 🎧 Air Wiggler 🏹 Arrow Shooter ⛔️ Out of Charac

dneaves.com

  • 0 Posts
  • 30 Comments
Joined 2 years ago
cake
Cake day: July 10th, 2023

help-circle













  • If its something that represents mutually exclusive states, like the license plates examples (Gov’t, Embassy, Learner), an enum like 4wd mentioned is a better idea than many boolean keys. This would also be the switch/case question you posed. For a “regular case”, I would include that in the enum, but if you create an enum that only contains “special cases”, you can always set it to null.

    On the case of booleans, I would suggest avoiding them unless it is necessary, and truly a binary (as in, two-option, not binary numbers), self-contained-in-one-key thing (obligatory anti-boolean video). If the use case is to say what a different key’s object represents, you don’t need it (see: enums. You’ll thank yourself later if you add a third option). If the use case for using it is saying another key contains value(s), you don’t need it. Many languages can handle the idea of “data is present, or not present” (either with “truthy/falsey” behavior interpreting “data-or-null”, or “Maybe/Option” types), so often “data-or-null” can suffice instead of booleans.

    I would suggest trying to always include all keys of a present object, even if it’s value is null or not applicable. It will prevent headaches later when code might try to access that key, but it isn’t present. This approach might also help you decide to reduce the quantity of keys, if they could be consolidated (as in taking booleans and converting to a state-like enum, as mentioned above), or removed (if unused and/or deprecated).


  • DNEAVES@lemmy.worldtoProton @lemmy.worldProtonVPN on Steam Deck
    link
    fedilink
    English
    arrow-up
    1
    ·
    edit-2
    1 year ago

    There is some way to get things going on startup on Steamdeck, even in Steam-mode (Big Picture mode? Not-desktop mode?). I had to do it for Syncthing, I just don’t remember exactly what I did. I probably made a service file if I had to take a guess, but I think an “@reboot” cron job might work too



  • I say there are four categories:

    • “standalones”: anything that is only described as itself. Separation just results in smaller versions of itself.
    • sandwiches: organized or layered arrangements of foods. Can typically be separated into it’s composing parts.
    • salads: tossed or jumbled arrangements of foods. Could be separated into its parts, albeit cumbersome.
    • sauces: perfectly combined or blended arrangements of foods. Can no longer be separated into its composing parts, but differs from a standalone because it was still composed of other foods, and can still be identified or described as all of the parts.



  • Elm

    In short, it’s ruined my expectations of languages. It’s a functional language, like the style of Haskell, and transpiles to html or js (its meant for web). There’s very little that it allows for going wrong, and for things that could fail, it either tells you to port that out to JS and bring it back when you’re done, or you have to handle a Result type or Maybe type.

    It sounds strict, yes, but not having to deal with issues later is so nice.