Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
NULLに関する一考察 #TechLunch
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
Livesense Inc.
PRO
April 23, 2014
Technology
65
0
Share
NULLに関する一考察 #TechLunch
2011/10/05(水) @ Livesense TechLunch
発表者:桂 大介
Livesense Inc.
PRO
April 23, 2014
More Decks by Livesense Inc.
See All by Livesense Inc.
28新卒_Webエンジニア職採用_会社説明資料
livesense
PRO
0
55
27新卒_総合職採用_会社説明資料
livesense
PRO
0
4.6k
27新卒_Webエンジニア職採用_会社説明資料
livesense
PRO
0
9k
株式会社リブセンス・転職会議 採用候補者様向け資料
livesense
PRO
0
350
株式会社リブセンス 会社説明資料(報道関係者様向け)
livesense
PRO
1
1.7k
データ基盤の負債解消のためのリプレイス
livesense
PRO
0
600
26新卒_総合職採用_会社説明資料
livesense
PRO
0
13k
株式会社リブセンス会社紹介資料 / Invent the next common.
livesense
PRO
2
63k
26新卒_Webエンジニア職採用_会社説明資料
livesense
PRO
1
13k
Other Decks in Technology
See All in Technology
freeeで運用しているAIQAについて
qatonchan
0
290
変化の激しい時代をゴキゲンに生き抜くために 〜ストレスマネジメントのススメ〜
kakehashi
PRO
4
1.2k
AWS Transform CustomでIaCコードを自由自在に変換しよう
duelist2020jp
0
250
『生成AI時代のクレデンシャルとパーミッション設計 — Claude Code を起点に』の執筆企画
takuros
3
2.3k
Anthropic「Long-running a gents」をGeminiで再現してみた
tkikuchi
0
790
雑談は、センサーだった
bitkey
PRO
2
210
SLI/SLO、「完全に理解した」から「チョットデキル」へ
maruloop
1
130
「誰一人取り残されない」 AIエージェント時代のプロダクト設計思想 Product Management Summit 2026
mizushimac
1
3k
要件定義の精度を高めるための型と生成AIの活用 / Using Types and Generative AI to Improve the Accuracy of Requirements Definition
haru860
0
310
試作とデモンストレーション / Prototyping and Demonstrations
ks91
PRO
0
190
Databricks Academic Series 〜 大規模言語モデル / エージェント編 〜 / academic-series-llm
databricksjapan
0
110
AIと乗り切った1,500ページ超のヘルプサイト基盤刷新とさらにその先の話
mugi_uno
2
310
Featured
See All Featured
How to Build an AI Search Optimization Roadmap - Criteria and Steps to Take #SEOIRL
aleyda
1
2k
The Hidden Cost of Media on the Web [PixelPalooza 2025]
tammyeverts
2
290
How To Speak Unicorn (iThemes Webinar)
marktimemedia
1
450
Learning to Love Humans: Emotional Interface Design
aarron
275
41k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
231
23k
技術選定の審美眼(2025年版) / Understanding the Spiral of Technologies 2025 edition
twada
PRO
118
110k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
32
3k
Agile Leadership in an Agile Organization
kimpetersen
PRO
0
140
Bootstrapping a Software Product
garrettdimon
PRO
307
120k
Rebuilding a faster, lazier Slack
samanthasiow
85
9.5k
エンジニアに許された特別な時間の終わり
watany
106
240k
Prompt Engineering for Job Search
mfonobong
0
290
Transcript
NULL に関する ー 考 察
[email protected]
NULL に関する ー 考 察
[email protected]
/nʌl/
nullus
From ne (“not”) + ūllus (“any”), literally meaning "not any".
Differences in dealing with null
null = undefined
PHP $value // null isset($value) // false is_null($value) // true
$value === null // true unset($value) $value = null $hash = array('key' => null) array_key_exists('key', $hash) // true isset($hash['key']) // false
Perl 5 $value // undef defined $value // false undef
$value
Perl 6 my $value $value // Any() $value = Nil
$value // Any() $value.defined // Bool::False
null and undefined
Javascript value; // undefined typeof value === 'undefined' // true
value === void 0 // true value = void 0; value = null value === null // true
null only
Ruby value // NameError defined? value // nil(false?) undef value
value = nil value.nil? // true
Python value // NameError del value value = None value
is None // true
wrapped null
Scala Option v1 = Some(1) v2 = None v1.getOrElse(2) //
1 v2.getOrElse(2) // 2
Haskell Maybe v1 = Just 1 v2 = Nothing getValueOrTwo
v = case v of Just x -> x Nothing -> 2 getValueOrTwo v1 // 1 getValueOrTwo v2 // 2
int main() { for(int j=-5; j<=5; ++j) { optional<int> x
= sqrt(j); if( x ) cout << *x << endl; else cout << "invalid" << endl; } } boost::optional
boxing
C# nullable int? value = null value.HasValue // false Nullable.GetValueOrDefault(value,
123) // 123 Value ?? 123 // 123
making null
C++ nullptr const class nullptr_t { public: template<class T> operator
T*() const { return 0; } template<class C, class T> operator T C::*() const { return 0; } private: void operator&() const; } nullptr = {};
One more thing
void f( tribool b ) { if( b ) cout
<< "True" << endl; else if( !b ) cout << "False" << endl; else cout << "Indeterminate" << endl; } int main() { tribool x = indeterminate; f(x); // Indeterminate f(true && x); // Indeterminate f(true || x); // True } boost::logic::tribool
考察 • null は必要だけど null チェック地獄 • null と値でインターフェースを合わせるのが時 代の流れ
• →Option, nullable • →coffee script • →presence • →null object pattern
次回予告
None