Nulls and null checks - How to work safely with nulls in any codebase

preview_player
Показать описание
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 the absence of a value. For example, a user may fill in a form that has optional fields. They may leave the optional fields blank. That’s one reason for nulls.

The problem is that nulls can be difficult to work with and track.

In this video, we examine how we can work with nulls effectively in a codebase.

Chapters:
0:00 Intro
0:12 About nulls
1:16 Problem with nulls
2:03 Place a null check around everything
3:13 Try / catch instead of null checks
4:00 Default values
7:52 Null object pattern
10:09 Remember to check for every null
10:48 Type systems that force null checks
10:43 Option type
13:55 Which one should you use?
14:32 Outro

Video links:

Channel links:

Resources used in video:
Music:
Artist: MARION
Title: High Hopes

#programmingduck #programming #coding
Рекомендации по теме