3 ms·
> I have on a few occasions tried to write NULL-less code, and it adds a good bit of work. Really depends on the language. On Java / C#, it's hard to avoid nul
by jcelerier 8y ago
> I have on a few occasions tried to write NULL-less code, and it adds a good bit of work.
Really depends on the language. On Java / C#, it's hard to avoid null-checking a lot of stuff. In C++ you will never encounter a null std::string outside of code written by indian students learning on Turbo C++ 3.5. So you don't need to check for anything: if it's a value, it exists.
- rusk 8y agoStrings are an easy case. Default initialisation to "" (empty string). You'll still encounter NULL when modelling other domains however.