Null Safety

Creator
Creator
Seonglae ChoSeonglae Cho
Created
Created
2021 Jul 20 14:22
Editor
Edited
Edited
2022 Dec 1 23:22
Refs
Refs
Nullable types and non-null types
Null을 안전하게 처리하는 방법
 
 
 
 
Kotlin - Null을 안전하게 처리하는 방법 (Null safety, 널 안정성)
자바의 경우 int, boolean과 같은 primitive type을 제외한 객체들은 항상 null이 될 수 있습니다. 코틀린은 자바와 다르게 Nullable과 Non-nullable 타입으로 프로퍼티를 선언할 수 있습니다. Non-nullable 타입으로 선언하면 객체가 null이 아닌 것을 보장하기 때문에 null check 등의 코드를 작성할 필요가 없습니다. 이 글에서는 코틀린에서 Null 객체를 다루는 방법들을 소개합니다.
Kotlin - Null을 안전하게 처리하는 방법 (Null safety, 널 안정성)
Null safety | Kotlin
Kotlin's type system is aimed at eliminating the danger of null references, also known as The Billion Dollar Mistake. One of the most common pitfalls in many programming languages, including Java, is that accessing a member of a null reference will result in a null reference exception.
Retrofitting null-safety onto Java at Meta
We developed a new static analysis tool called Nullsafe that is used at Meta to detect NullPointerException (NPE) errors in Java code. Interoperability with legacy code and gradual deployment model were key to Nullsafe's wide adoption and allowed us to recover some null-safety properties in the context of an otherwise null-unsafe language in a multimillion-line codebase.
Retrofitting null-safety onto Java at Meta
 
 

Recommendations