• 2 Posts
  • 8 Comments
Joined 6 years ago
cake
Cake day: May 31st, 2020

help-circle
  • Yeah, I always wonder, if it was an intentional decision or just some first draft that stayed in.

    Because I do think, it’s kind of smart. Some macros make sense to call with either () or {}, depending on if you pass a code snippet that’s multi-line or not.
    So, you could come up with a complicated syntax to define which bracket types are acceptable, or you could just not bother. 🙃


  • Ephera@lemmy.mltoComic Strips@lemmy.world•Aging out of it
    link
    fedilink
    arrow-up
    3
    arrow-down
    1
    ·
    2 days ago

    We don’t really do Halloween here, but I still feel like I’ve skipped straight to “finally”.

    I actually would’ve wanted to stock up on groceries earlier today, but then I realized it’s getting dark, so there might be people outside doing Halloween-related activities, so I postponed that to Monday…




  • So,

    • someone googled “racist joke”,
    • decided to include it into a presentation on how not to be racist,
    • decided they themselves don’t want to be racist, so the joke should be told between people of different skin color, and
    • at no point did they get up and just walk into the woods, never to return to human society again.

    That’s certainly not the choices I would’ve made, but sure.




  • Moreso correctness, not security. In the end, your user is shooting themselves in their foot, if they mutate a variable that they shouldn’t, and by making the variable private and only offering a getter, we document that.

    Having said that, there’s also big differences between languages and paradigms, though.
    In object-oriented / garbage-collected languages, you often pass around references to an object into so many places that you need to code defensively versus your own codebase. That’s why getters/setters were taught religiously during the height of OOP.

    In other paradigms, you often just have one place that uses an object and then you can …simply not shoot yourself in the foot there. When you control both the definition and the access, you don’t need to protect yourself from yourself. In particular, you would probably think twice before mutating an object anyways.