Defensive & offensive programmingDefensive programming is a term that many programmers have heard of. It's related to error handling and having correct programs. For some programs, defensive programming is essential. For others, it may be useful to use here and there. Along with tha...1BJan 16, 2022 · 15 min readsargalias.hashnode.dev
Nulls and null checks - How to work safely with nulls in any codebaseAn important part of clean code is handling nulls properly. Nulls have been a tricky problem in programming for decades. Tony Hoare, the inventor of the null even called it a billion-dollar mistake. Semantically, nulls are necessary. They represent t...Jan 1, 2022 · 13 min readsargalias.hashnode.dev
Exceptions vs error valuesExceptions vs error values has been a debate in error handling for ages. Some people have firm stances on them. For example, in the book Clean Code, Uncle Bob recommends exceptions. In his post on Exceptions, Joel mentions that he prefers error value...1MDec 29, 2021 · 8 min readsargalias.hashnode.dev
Best practices for error catching and handlingCatching and handling errors is an important part of error handling. Here are some best practices for it. Generally, it's good to: be very thorough with your error checking do your error checking first handle errors at the earliest appropriate place...4AEYNov 19, 2021 · 11 min readsargalias.hashnode.dev
Error recording - How to record errors in your application to debug laterRecording errors is an important part of error handling. In short, when certain errors occur in programs, you want to know about it. This is particularly important with bugs. You need to: know that they occurred have useful information about them so...Nov 9, 2021 · 4 min readsargalias.hashnode.dev