Skip to content

Instantly share code, notes, and snippets.

@uyu423
Created September 2, 2025 14:48
Show Gist options
  • Select an option

  • Save uyu423/0284db85c94d1b642a7e78e3a002c061 to your computer and use it in GitHub Desktop.

Select an option

Save uyu423/0284db85c94d1b642a7e78e3a002c061 to your computer and use it in GitHub Desktop.
EasyToReadCodeSample01.kt
// 코틀린 숙련도가 낮은 팀에선 아래처럼 작성하는 편이 이해하기 쉽다
val user = userRepository.findById(userId)
if (user != null) {
sendWelcomeMessage(user)
}
// 숙련된 팀이라면 코틀린스럽게 더 간결하게 쓸 수 있다
userRepository.findById(userId)?.let { sendWelcomeMessage(it) }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment