# FP For The Working Programmer: Why Is null Bad?

DevFeed: [FP For The Working Programmer: Why Is null Bad?](<https://devfeed.tech/articles/fp-for-the-working-programmer-why-is-null-bad-33405.md>)

Original publisher: [Read original article](<https://timkellogg.me/blog/2014/06/24/why-is-null-bad>)

Published: 2014-06-24T00:00:00Z

Content type: tutorial

Language: en

Sources: [Tim Kellogg](<https://devfeed.tech/sources/tim-kellogg.md>)

Topics: [Scala](<https://devfeed.tech/topics/scala.md>), [Java](<https://devfeed.tech/topics/java.md>), [C++](<https://devfeed.tech/topics/c-plus-plus.md>), [C#](<https://devfeed.tech/topics/csharp.md>), [Ruby](<https://devfeed.tech/topics/ruby.md>)

Tags: [c-plus-plus](<https://devfeed.tech/tags/c-plus-plus.md>), [c-sharp](<https://devfeed.tech/tags/c-sharp.md>), [compiler](<https://devfeed.tech/tags/compiler.md>), [concepts](<https://devfeed.tech/tags/concepts.md>), [error](<https://devfeed.tech/tags/error.md>), [java](<https://devfeed.tech/tags/java.md>), [ruby](<https://devfeed.tech/tags/ruby.md>), [scala](<https://devfeed.tech/tags/scala.md>), [types](<https://devfeed.tech/tags/types.md>)

## AI overview

This article explains why null values can lead to difficult-to-trace bugs and argues that type systems should distinguish present values from potentially absent ones. It presents Scala's Option type as a safer way to represent missing values and access or transform them safely.

## Source excerpt

Null is dangerous. This is a tough statement to accept for a lot of people I've worked with. The concept of null is deeply ingrained into the languages we use. In C/C++, if you access a member of a null pointer, the program can sometimes continue to run but generate strange results. This led to bugs that were sometimes very difficult to trace. Java improved the situation by causing programs to fail the instant a null pointer was accessed.