Latest Tech News

Stay updated with the latest in technology, AI, cybersecurity, and more

Filtered by: enum Clear Filter

Nullable vs. Nullable in C#

Nullable vs nullable in C# One of the most unfortunate parts of the nullability narrative in C# is the reuse of the T? syntax to denote two completely separate concepts for value types and reference types. This leads to some odd and confusing behaviour. As you may know, nullable value types is a much older concept than nullable reference types. Nullable value types were introduced in C# 2.0, whereas nullable reference types came in C# 8.0. And they’re not the same. Nullable isn’t nullable. Fo

That boolean should probably be something else

Monday, June 30, 2025 One of the first types we learn about is the boolean. It's pretty natural to use, because boolean logic underpins much of modern computing. And yet, it's one of the types we should probably be using a lot less of. In almost every single instance when you use a boolean, it should be something else. The trick is figuring out what "something else" is. Doing this is worth the effort. It tells you a lot about your system, and it will improve your design (even if you end up usi

Math Not Required (2023)

Let's examine a problem that we could math our way out of, but assume we don't know how. We'll lean on our programming to teach us what we don't know. The Monty Hall problem comes from an old game show called Let's Make a Deal, hosted by Monty Hall. In the show, Monty would show three closed doors to a contestant and explain that one holds a car while the other two hold goats. The contestant then chose a door. After this first pick, Monty would reveal one unchosen door that was hiding a goat. T

Topics: end enum heads switch win

Error handling in Rust

On Error Handling in Rust The current standard for error handling, when writing a crate, is to define one error enum per module, or one for the whole crate that covers all error cases that the module or crate can possibly produce, and each public function that returns a Result will use said error enum. This means, that a function will return an error enum, containing error variants that the function cannot even produce. If you match on this error enum, you will have to manually distinguish whi