Your SlideShare is downloading. ×
The Language of Abstraction in Software Development
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

The Language of Abstraction in Software Development

243
views

Published on

A short view into the language of abstraction in software development.

A short view into the language of abstraction in software development.

Published in: Technology

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
243
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
4
Comments
0
Likes
0
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. The Language of Abstraction Sam Goldman @nontrivialzeros Tuesday, July 23, 13
  • 2. Software is Big • 400 page book: ~20,000 LOC • MSVista: ~120,000,000 LOC (6,000 books) • MS Apps: ~140,000,000 LOC (7,000 books) Kay,Alan.“Programming and Scaling.” HPI Colloquium. Hasso-Plattner-Institut Postdam. 2011. http://www.tele-task.de/archive/video/flash/14029/ Tuesday, July 23, 13
  • 3. Layers of Abstraction Electronic Switches Logic Gates Binary Machine Language High-Level Language Your Application Tuesday, July 23, 13
  • 4. Switches to Gates Primitives Combination Abstraction Tuesday, July 23, 13
  • 5. Gates to Binary Primitives Combination Abstraction 1 1 1 1 1 (carried digits) 0 1 1 0 1 + 1 0 1 1 1 ------------- = 1 0 0 1 0 0 = 36 Tuesday, July 23, 13
  • 6. Primitive Obsession • Using a primitive from the wrong layer of abstraction • Particularly primitives provided by your programming language, e.g., dictionaries • Create useful primitives in a new language • Provide a means of combination and a means of abstraction Tuesday, July 23, 13
  • 7. Framework Obsession • We use frameworks that provide lots of functionality: routing, ORM, templating • Express your application in the language of the domain, not the language of the framework. Tuesday, July 23, 13
  • 8. Linguistic Abstraction • Simpler mental models of software • Self-documenting code • Complexity where it matters Tuesday, July 23, 13
  • 9. TCP/IP Tuesday, July 23, 13
  • 10. Tell, Don’t Ask • Depending on collaborators’ states breaks encapsulation • Depend on behaviors, not state • Law of Demeter Tuesday, July 23, 13
  • 11. AskingQuestionnaire = Struct.new(:questions) do def render(html) html.form questions.each do |question| html.fieldset { case question when ShortAnswerQuestion html.label(:for => question.id) { html.text question.prompt } html.input(:type => "text", :id => question.id, :name => question.id) when MultipleChoiceQuestion html.label { html.text question.prompt } html.ul { question.choices.each do |choice| html.li { html.label(:for => choice.id) { html.text choice.title } html.input(:type => "radio", :id => choice.id, :name => choice.id) } end } end } end end end end Tuesday, July 23, 13
  • 12. Telling Questionnaire = Struct.new(:questions) do def render(html) html.form do questions.each do |question| html.fieldset { question.render(html) } end end end end Tuesday, July 23, 13
  • 13. Telling ShortAnswerQuestion = Struct.new(:id, :prompt) do def render(html) html.label(:for => id) { html.text prompt } html.input(:type => "text", :id => id, :name => id) end end MultipleChoiceQuestion = Struct.new(:id, :prompt, :choices) do def render(html) html.label { html.text prompt } html.ul { choices.each do |choice| html.li { choice.render(html) } end } end end Choice = Struct.new(:id, :title) do def render(html) html.label(:for => id) { html.text title } html.input(:type => "radio", :id => id, :name => id) end end Tuesday, July 23, 13
  • 14. Encapsulation • Limits the number of components affected by change • Allows for extension Tuesday, July 23, 13
  • 15. Virtual Memory Tuesday, July 23, 13
  • 16. Services • Fulfill needs determined though wishful thinking • Hide concrete implementation details Tuesday, July 23, 13
  • 17. Thank you @smartlogic facebook.com/smartlogic github.com/smartlogic Tuesday, July 23, 13