cf2014 - code matters
DESCRIPTION
「コードをしたためる」ということは「プログラマー」という「職人」の「仕事」だと巷では認識されているようです。 その認識が誤りで、どう誤りで、誤った認識のままだと何がおこるのか。本講演がその認識を改めるきっかけとなれば幸いです。TRANSCRIPT
Code Matters@dankogai
What’s Code?
Dictionary says…1.a system of words, letters,
figures, or other symbols substituted for other words, letters, etc., esp. for the purposes of secrecy:
2. Computing program instructions:
3.a systematic collection of laws or regulations:
Dictionary says…1.a system of words, letters,
figures, or other symbols substituted for other words, letters, etc., esp. for the purposes of secrecy:
2. Computing program instructions:
3.a systematic collection of laws or regulations:
Dictionary says…1.暗号
2.軟件
3.法律
What gives?1.Not so easy to read.
2.Not only readable, but executable.
3.Not always executed as written.
An Example
A Pair of Cords of Code• Decoded in 1953
• ATGC = 4 letters = 2 bits
• 3 bases = 1 codon = 6 bits
• 6 billion bases = 1.5 GBytes
• Micro SD card can hold 20 of us (without compression :-)
Physics vs. Logics
Physics: conservation
Physics: conservation•Mass + Energy •Moment •Angular Moment •Electric Charges •…
Physics: conservationTo give something, it must be taken from somewhere.
Logics: propagation
Logics: propagation•Copying is easier than moving
•To move something, you first copy then delete the original
Logics: propagation•Copying is easier than moving
•To move something, you first copy then delete the original
•What happens if you forget to delete the source?
Economics: Physics or Logics?
Economics: Physics or Logics?
•It’s Physics! •If I give you a 10,000 yen, you have 10,000 yen more
and I have 10,000 yen
Economics: Physics or Logics?
•It’s Logics! •I just left 10,000 dollars in my bank account. It is
now 10,300 dollars. Where’s that 300 dollars come from?
Economics: Physics AND Logics
•It conserves spatially •It propagates temporally •It is an emulation of what we look, hear, and feels at
the reality
Our Reality != Physics
Our Reality == Physics + Logics
•See how we design money •Emulates physics, adjusted to our perception
•See how we design UI •Emulates physics, adjusted to our perception
Adjusted to Perception• A physically impossible
building
• Looks so real
• Why?
Physics + Logics ⇒ Real + Imaginary
Fundamental Theorem of Algebra
• The field of complex numbers is Algebraically closed
• You need not only real numbers but also imaginary numbers
Hardware: Physical Economy
•Hardcoded •Cost of production ∝ Number of Units ↓ Inventory required ↓ You have to repair the broken parts to fix it ↑ People are used to paying for it
Software: Logical Economy
•(soft)coded •The cost of single copy ≒ The cost of billion copies ↑ No Inventory required ↑You can fix the broken parts later ↓People are used to paying for it
Hardware + Software = i + P*
• iPhone itself = Physical
• No one else but Samsung can make 200 million of them a year
• iOS = Logical
• Samsung has to import Android to complete the product
Reality changes• Introduced in 2007
• "A Phone, an iPod, an internet communicator"
• People are least impresssed with "an internet communicator"
• 7 years later
• who makes a phone call with smart phones?
Reality changes - but only slowly
• iOS is NOT quite logical
• Look and feel = physics
• > 90% of iOS is used up to emulate physics
• But it is getting less physical generation by generation
• iOS6 -> iOS7
Q. Why did Apple Make iPhones Big?
Don’t bet against the code
Don’t bet agains the code• (Unless you are a scholar)
• When physics does not work, think logics
• When logics does not work, think physics
• Reality is complex, not real or imaginary.
That’s it - for nowfor q in questions { q.answer()}
Further Reading小飼弾のコードなエッセイ
小飼弾
技術評論社
ISBN:978-4774156644