Artwork

thoughtbot에서 제공하는 콘텐츠입니다. 에피소드, 그래픽, 팟캐스트 설명을 포함한 모든 팟캐스트 콘텐츠는 thoughtbot 또는 해당 팟캐스트 플랫폼 파트너가 직접 업로드하고 제공합니다. 누군가가 귀하의 허락 없이 귀하의 저작물을 사용하고 있다고 생각되는 경우 여기에 설명된 절차를 따르실 수 있습니다 https://ko.player.fm/legal.
Player FM -팟 캐스트 앱
Player FM 앱으로 오프라인으로 전환하세요!

432: The Semantics and Meaning of Nil

38:13
 
공유
 

Manage episode 427970829 series 1401614
thoughtbot에서 제공하는 콘텐츠입니다. 에피소드, 그래픽, 팟캐스트 설명을 포함한 모든 팟캐스트 콘텐츠는 thoughtbot 또는 해당 팟캐스트 플랫폼 파트너가 직접 업로드하고 제공합니다. 누군가가 귀하의 허락 없이 귀하의 저작물을 사용하고 있다고 생각되는 경우 여기에 설명된 절차를 따르실 수 있습니다 https://ko.player.fm/legal.

The term ‘nil’ refers to the absence of value, but we often imbue it with much more meaning than just that. Today, hosts Joël and Stephanie discuss the various ways we tend to project extra semantics onto nil and the implications of this before unpacking potential alternatives and trade-offs.

Joël and Stephanie highlight some of the key ways programmers project additional meaning onto nil (and why), like when it’s used to create a guest session, and how this can lead to bugs, confusion, and poor user experiences. They discuss solutions to this problem, like introducing objects for improved readability, before taking a closer look at the implications of excessive guard clauses in code.

Our hosts also explore the three-state Boolean problem, illustrating the pitfalls of using nullable Booleans, and why you should use default values in your database. Joël then shares insights from the Elm community and how it encourages rigorous checks and structured data modeling to manage nil values effectively.They advocate for using nil only to represent truly optional data, cautioning against overloading nil with additional meanings that can compromise code clarity and reliability. Joël also shares a fun example of modeling a card deck, explaining why you might be tempted to add extra semantics onto nil, and why the joker always inevitably ends up causing chaos!

Key Points From This Episode

  • The project Joël is working on and why he’s concerned about bugs and readability.
  • Potential solutions for a confusing constant definition in a nested module.
  • A client work update from Stephanie: cleaning up code and removing dead dependencies.
  • How she used Figjam to discover dependencies and navigate her work.
  • Today’s topic: how programmers project extra semantics onto nil.
  • What makes nil really tricky to use, like forcing you to go down a default path.
  • How nil sweeps the cases you don’t want to think too hard about under the rug.
  • Extra semantics that accompany nil (that you might not know about) like a guest session.
  • Examples of how these semantics mean different things in different contexts.
  • How these can lead to bugs, hard-to-find knowledge, confusion, and poor user experiences.
  • Introducing objects to replace extra nil semantics, improve readability, and other solutions.
  • Some of the reasons why programmers tend to project extra semantics onto nil.
  • How to notice that nil has additional meanings, and when to model it differently.
  • The implications of excessive guard clauses in code.
  • An overview of the three-state Boolean problem with nullable Booleans.
  • Connecting with the Elm community: how it can help you conduct more rigorous checks.
  • Some of the good reasons to have nil as a value in your database.
  • The benefits of using nil only to represent truly optional data.

Links Mentioned in Today’s Episode

Support The Bike Shed

  continue reading

448 에피소드

Artwork

432: The Semantics and Meaning of Nil

The Bike Shed

2,445 subscribers

published

icon공유
 
Manage episode 427970829 series 1401614
thoughtbot에서 제공하는 콘텐츠입니다. 에피소드, 그래픽, 팟캐스트 설명을 포함한 모든 팟캐스트 콘텐츠는 thoughtbot 또는 해당 팟캐스트 플랫폼 파트너가 직접 업로드하고 제공합니다. 누군가가 귀하의 허락 없이 귀하의 저작물을 사용하고 있다고 생각되는 경우 여기에 설명된 절차를 따르실 수 있습니다 https://ko.player.fm/legal.

The term ‘nil’ refers to the absence of value, but we often imbue it with much more meaning than just that. Today, hosts Joël and Stephanie discuss the various ways we tend to project extra semantics onto nil and the implications of this before unpacking potential alternatives and trade-offs.

Joël and Stephanie highlight some of the key ways programmers project additional meaning onto nil (and why), like when it’s used to create a guest session, and how this can lead to bugs, confusion, and poor user experiences. They discuss solutions to this problem, like introducing objects for improved readability, before taking a closer look at the implications of excessive guard clauses in code.

Our hosts also explore the three-state Boolean problem, illustrating the pitfalls of using nullable Booleans, and why you should use default values in your database. Joël then shares insights from the Elm community and how it encourages rigorous checks and structured data modeling to manage nil values effectively.They advocate for using nil only to represent truly optional data, cautioning against overloading nil with additional meanings that can compromise code clarity and reliability. Joël also shares a fun example of modeling a card deck, explaining why you might be tempted to add extra semantics onto nil, and why the joker always inevitably ends up causing chaos!

Key Points From This Episode

  • The project Joël is working on and why he’s concerned about bugs and readability.
  • Potential solutions for a confusing constant definition in a nested module.
  • A client work update from Stephanie: cleaning up code and removing dead dependencies.
  • How she used Figjam to discover dependencies and navigate her work.
  • Today’s topic: how programmers project extra semantics onto nil.
  • What makes nil really tricky to use, like forcing you to go down a default path.
  • How nil sweeps the cases you don’t want to think too hard about under the rug.
  • Extra semantics that accompany nil (that you might not know about) like a guest session.
  • Examples of how these semantics mean different things in different contexts.
  • How these can lead to bugs, hard-to-find knowledge, confusion, and poor user experiences.
  • Introducing objects to replace extra nil semantics, improve readability, and other solutions.
  • Some of the reasons why programmers tend to project extra semantics onto nil.
  • How to notice that nil has additional meanings, and when to model it differently.
  • The implications of excessive guard clauses in code.
  • An overview of the three-state Boolean problem with nullable Booleans.
  • Connecting with the Elm community: how it can help you conduct more rigorous checks.
  • Some of the good reasons to have nil as a value in your database.
  • The benefits of using nil only to represent truly optional data.

Links Mentioned in Today’s Episode

Support The Bike Shed

  continue reading

448 에피소드

ทุกตอน

×
 
Loading …

플레이어 FM에 오신것을 환영합니다!

플레이어 FM은 웹에서 고품질 팟캐스트를 검색하여 지금 바로 즐길 수 있도록 합니다. 최고의 팟캐스트 앱이며 Android, iPhone 및 웹에서도 작동합니다. 장치 간 구독 동기화를 위해 가입하세요.

 

빠른 참조 가이드