PHPnews.io

Overview for 'tomasvotruba'

It's not Null, it's Enum

Written by Tomáš Votruba / Original link on Feb. 22, 2021

Last weekend I got into reading a good old post Null Hell by Afilina, a fellow legacy archeologist. Null parameters are evil, which turns code into "maybe" and "just in case" conditions with ifs everywhere. I was wondering how difficult it is to get rid of nullable parameters in a project. I made…



Tree Coding vs. Bush Coding

Written by Tomáš Votruba / Original link on Feb. 11, 2021

How does circular reference look like? It is a point where you wait for your doctor; they wait for a state to accept the vaccine, and the state waits on people like your to come to the doctor. Who has the responsibility? Who can change the state? In the past, we used singletons and static calls to…



Effective Debug Tricks: Narrow Scoping

Written by Tomáš Votruba / Original link on Feb. 1, 2021

Writing a code that only you work with is easy. Debugging such code is a bit harder. Writing a code for someone else review is quite hard. The code must be understandable to the other reader to pass the code review. How hard is reading a code that someone else wrote three months ago? But what about…