• 0 Posts
  • 152 Comments
Joined 11 months ago
cake
Cake day: July 31st, 2023

help-circle


  • To offer a differing opinion, why is null helpful at all?

    If you have data that may be empty, it’s better to explicitly represent that possibility with an Optional<T> generic type. This makes the API more clear, and if implicit null isn’t allowed by the language, prevents someone from passing null where a value is expected.

    Or if it’s uninitialized, the data can be stored as Partial<T>, where all the fields are Optional<U>. If the type system was nominal, it would ensure that the uninitialized or partially-initialized type can’t be accidentally used where T is expected since Partial<T> != T. When the object is finally ready, have a function to convert it from Partial<T> into T.


  • pivot_root@lemmy.worldtoLinux@lemmy.mlSSH as a sudo replacement
    link
    fedilink
    arrow-up
    5
    arrow-down
    2
    ·
    7 days ago

    The problem is that they’re trying to frame it as a better replacement for sudo when it’s really not.

    In some respects, it’s safer by not using a setuid binary. In other respects, it massively increases the surface area by relying on the correctness of three separate daemons: systemd, dbus, and polkitd. If any one of those components are misconfigured, you risk an unauthorized user gaining root privileges.

    With sudo, the main concern is the sudo process being exploited through memory safety bugs since it runs at root automatically.

    Don’t get me wrong, sudo has a lot of stupid decisions and problems. There’s a ton of code in sudo for features that almost nobody uses, and there’s bound to be bugs in there somewhere. It needs to be replaced with something simpler, but run0 is not that.











  • pivot_root@lemmy.worldtoLefty Memes@lemmy.dbzer0.comALAT.
    link
    fedilink
    English
    arrow-up
    3
    ·
    edit-2
    1 month ago

    Wikipedia has two significant advantages:

    1. The content is objective, and sources should be cited.
    2. Individual editors are volunteers with actual interest in their topics.

    The former makes for a clear and low-effort bar for determining if a contribution is bad. If it’s not cited, or it’s biased, revert and move on. Figuring out if a user-written review is paid for, factually false, or exaggerated is a lot harder.

    As for the latter… aside from doing it out of spite or as a favor to landlord friends, I have a hard time imagining that many people would volunteer their time moderating the review page about the apartment they rented 14 years ago.







  • pivot_root@lemmy.worldtoMemes@lemmy.mlKnow the difference.
    link
    fedilink
    arrow-up
    3
    arrow-down
    7
    ·
    2 months ago

    From a theoretical point, they don’t count as communist. They entirely dropped the all-important aspect of giving power to the working class.

    Both the USSR and China, in their self-described “communist” periods, were ruled with absolute power and directed by a head of state. The USSR collapsed, and modern China is about as communist as North Korea is democratic.