the nature of truth

42
THE NATURE OF TRUTH An epistemological clusterfuck

Post on 17-Oct-2014

1.818 views

Category:

Technology


8 download

DESCRIPTION

Lightning talk on the nature of truth, originally given at the Ruby Hoedown 2008

TRANSCRIPT

Page 1: The Nature of Truth

THE NATURE OF TRUTHAn epistemological clusterfuck

Page 2: The Nature of Truth

Yossef MendelssohnWorld-Renowned Truthologist

Page 3: The Nature of Truth

WHAT IS TRUTH?

Page 4: The Nature of Truth

WHAT IS TRUE?

Page 6: The Nature of Truth

http://en.wikipedia.org/wiki/Image:Immanuel_Kant_(painted_portrait).jpg

Page 7: The Nature of Truth

http://en.wikipedia.org/wiki/Image:Foucault_Bachelard.png

Page 9: The Nature of Truth

http://en.wikipedia.org/wiki/Image:Jules_Joseph_Lefebvre.jpg

Page 10: The Nature of Truth

TRUTH IN RUBY

Page 12: The Nature of Truth

Truth in Ruby

Page 13: The Nature of Truth

true

Truth in Ruby

Page 14: The Nature of Truth

true

42

Truth in Ruby

Page 15: The Nature of Truth

true

42

0

Truth in Ruby

Page 16: The Nature of Truth

true

42

0

‘this sentence is false’

Truth in Ruby

Page 17: The Nature of Truth

true

42

0

‘this sentence is false’

[ 10, ‘One’, 4 ]

Truth in Ruby

Page 18: The Nature of Truth

true

42

0

‘this sentence is false’

[ 10, ‘One’, 4 ]

[]

Truth in Ruby

Page 19: The Nature of Truth

true

42

0

‘this sentence is false’

[ 10, ‘One’, 4 ]

[]

and many more...

Truth in Ruby

Page 20: The Nature of Truth

Not Truth in Ruby

Page 21: The Nature of Truth

false

Not Truth in Ruby

Page 22: The Nature of Truth

false

nil

Not Truth in Ruby

Page 23: The Nature of Truth

false

nil

That’s it.

Not Truth in Ruby

Page 24: The Nature of Truth

false

nil

That’s it.

Really, stop looking.

Not Truth in Ruby

Page 25: The Nature of Truth
Page 26: The Nature of Truth

if val.empty?

Page 27: The Nature of Truth

if val.empty? if val and val.empty?

Page 28: The Nature of Truth

if val.empty? if val and val.empty?

if val.blank?

Page 29: The Nature of Truth

if val and val.empty?

Page 30: The Nature of Truth

if val

Page 31: The Nature of Truth

if val

Page 32: The Nature of Truth

if val

Page 33: The Nature of Truth

false

nil

That’s it.

Really, stop looking.

Not Truth in Ruby

Page 34: The Nature of Truth

CLEARING UP THE CONFUSION

Page 35: The Nature of Truth

if val

Page 36: The Nature of Truth

5.67 # ? 0 # Is this Perl?[] # Maybe?true # Seriously?false # C'mon!

Page 37: The Nature of Truth

Truthiness

http://thesituationist.files.wordpress.com/2008/02/stephen-colbert.jpg

Page 38: The Nature of Truth

gem install truthy

http://github.com/ymendel/truthy

Page 39: The Nature of Truth

5.67 # ? 0 # Is this Perl?[] # Maybe?true # Seriously?false # C'mon!

Page 40: The Nature of Truth

5.67.truthy? # => true0.truthy? # => true[].truthy? # => truetrue.truthy? # => truefalse.truthy? # => false

Page 41: The Nature of Truth

truthiness- false should not be truthy- nil should not be truthy- true should be truthy- a string should be truthy- even an empty string should be truthy- a string containing nothing but whitespace should still be truthy- a number should be truthy- zero is truthy- infinity is totally truthy- even a negative number is truthy- an array should be truthy- an empty array is truthy- an array containing only non-truthy elements: still truthy- a hash is truthy- an empty hash is truthy- an hash containing only non-truthy things: still truthy- an object is truthy

Finished in 0.02162 seconds

17 examples, 0 failures

Page 42: The Nature of Truth

false

nil

That’s it.

Really, stop looking.

Not Truth in Ruby