55
Code Smells Catalog (luzkan.github.io)
you are viewing a single comment's thread
view the rest of the comments
[-] Kissaki@programming.dev 4 points 1 week ago* (last edited 1 week ago)

with this in mind

With what in mind? Evading NULL?

Languages that make use of references rather than pointers don't have this Dualism. C# has nullable references and nullability analysis, and null as a keyword.

What does your reasoning mean in that context?

[-] FizzyOrange@programming.dev 5 points 1 week ago* (last edited 1 week ago)

Languages that make use of references rather than pointers don’t have this Dualism.

It's not about references vs pointers. You could easily have a language that allowed "null references" (edit: too much C++; of course many languages allow null references, e.g. Javascript) or one that properly separated null pointers out in the type system.

I agree with your point though, using a special Null value is usually worse than using Option or similar. And nullptr_t doesn't help with this at all.

[-] lysdexic@programming.dev 0 points 1 week ago

With what in mind? Evading NULL?

Depends on your perspective. It's convenient to lean on type checking to avoid a whole class of bugs. You can see this either as avoiding NULL or use your type system to flag misuses.

Languages that make use of references rather than pointers don’t have this Dualism. C# has nullable references and nullability analysis, and null as a keyword.

C#'s null keyword matches the monadic approach I mentioned earlier. Nullable types work as a Maybe monad. It's the same concept shoehorned differently due to the different paths taken by these languages.

[-] baseless_discourse@mander.xyz 1 points 1 week ago* (last edited 1 week ago)

as far as I know, C# don't have proper ergonomic monadic bind as in F# (computation expression), Haskell (do expression), and Ocaml (let*), but I could be wrong.

this post was submitted on 05 Sep 2024
55 points (92.3% liked)

Programming

16991 readers
152 users here now

Welcome to the main community in programming.dev! Feel free to post anything relating to programming here!

Cross posting is strongly encouraged in the instance. If you feel your post or another person's post makes sense in another community cross post into it.

Hope you enjoy the instance!

Rules

Rules

  • Follow the programming.dev instance rules
  • Keep content related to programming in some way
  • If you're posting long videos try to add in some form of tldr for those who don't want to watch videos

Wormhole

Follow the wormhole through a path of communities !webdev@programming.dev



founded 1 year ago
MODERATORS