sargalias.hashnode.devDefensive & 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...Jan 16, 2022·15 min read
sargalias.hashnode.devNulls 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 read
sargalias.hashnode.devExceptions 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...Dec 29, 2021·8 min read
sargalias.hashnode.devBest 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...Nov 19, 2021·11 min read
sargalias.hashnode.devError 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 read