SlideShare a Scribd company logo
1 of 53
The Power of Abstraction
Barbara Liskov
March 2013
MIT CSAIL
InfoQ.com: News & Community Site
• 750,000 unique visitors/month
• Published in 4 languages (English, Chinese, Japanese and Brazilian
Portuguese)
• Post content from our QCon conferences
• News 15-20 / week
• Articles 3-4 / week
• Presentations (videos) 12-15 / week
• Interviews 2-3 / week
• Books 1 / month
Watch the video with slide
synchronization on InfoQ.com!
http://www.infoq.com/presentations
/programming-abstraction-liskov
Presented at QCon London
www.qconlondon.com
Purpose of QCon
- to empower software development by facilitating the spread of
knowledge and innovation
Strategy
- practitioner-driven conference designed for YOU: influencers of
change and innovation in your teams
- speakers and topics driving the evolution and innovation
- connecting and catalyzing the influencers and innovators
Highlights
- attended by more than 12,000 delegates since 2007
- held in 9 cities worldwide
Software is Complex
 Systems are big
 and they do complicated things
 and they may be distributed and/or
concurrent
Addressing Complexity
 Algorithms, data structures, protocols
Addressing Complexity
 Algorithms, data structures, protocols
 Programming methodology
 Programming languages
This Talk
 Programming methodology as it
developed
 Programming languages
 Programming languages today
The Situation in 1970
 The software crisis!
Programming Methodology
 How should programs be designed?
 How should programs be structured?
The Landscape
 E. W. Dijkstra. Go To Statement
Considered Harmful. Cacm, Mar. 1968
The Landscape
 N. Wirth. Program Development by
Stepwise Refinement. Cacm, April 1971
The Landscape
 D. L. Parnas. Information Distribution
Aspects of Design Methodology. IFIP
Congress, 1971
 “The connections between modules are
the assumptions which the modules
make about each other.”
Modularity
 A program is a collection of modules
Modularity
 A program is a collection of modules
 Each module has an interface,
described by a specification
Modularity
 A program is a collection of modules
 Each has an interface, described by a
specification
 A module’s implementation is correct if it
meets the specification
 A using module depends only on the
specification
Modularity
 A program is a collection of modules
 Each has an interface, described by a
specification
 A module’s implementation is correct if it
meets the specification
 A using module depends only on the
specification
 E.g. a sort routine sort(a)
Benefits of Modularity
 Local reasoning
 Modifiability
 Independent development
The Situation in 1970
 Procedures were the only type of
module
 Not powerful enough, e.g., a file system
 Not used very much
 Complicated connections
Partitions
 B. Liskov. A Design Methodology for
Reliable Software Systems. FJCC, Dec.
1972
Partitions
Partition state
op1 op2 op3
From Partitions to ADTs
 How can these ideas be applied to
building programs?
Idea
 Connect partitions to data types
Meeting in Savanah
 ACM Sigplan-Sigops interface meeting.
April 1973. (Sigplan Notices, Sept.
1973)
 Started to work with Steve Zilles
The Landscape
 Extensible Languages
 S. Schuman and P. Jourrand. Definition
Mechanisms in Extensible Programming
Languages. AFIPS. 1970
 R. Balzer. Dataless Programming. AFIPS.
1967
The Landscape
 O-J. Dahl and C.A.R. Hoare. Hierarchical
Program Structures. Structured
Programming, Academic Press, 1972
The Landscape
 J. H. Morris. Protection in Programming
Languages. Cacm. Jan. 1973
Abstract Data Types
 B. Liskov and S. Zilles. Programming
with Abstract Data Types. ACM Sigplan
Conference on Very High Level
Languages. April 1974
What that paper proposed
 Abstract data types
 A set of operations
 And a set of objects
 The operations provide the only way to use
the objects
 A sketch of a programming language
From ADTs to CLU
 Participants
 Russ Atkinson
 Craig Schaffert
 Alan Snyder
Why a Programming
Language?
 Communicating to programmers
 Do ADTs work in practice?
 Getting a precise definition
 Achieving reasonable performance
Some Facts about CLU
 Static type checking
 Heap-based
 Separate compilation
 No concurrency, no gotos, no
inheritance
CLU Mechanisms
 Clusters
 Polymorphism
 Iterators
 Exception handling
Clusters
IntSet = cluster is create, insert, delete, …
% representation for IntSet objects
% implementation of the operations
end IntSet
Clusters
IntSet = cluster is create, insert, delete, …
% representation for IntSet objects
% implementation of the operations
end IntSet
IntSet s = IntSet$create( )
IntSet$insert(s, 3)
Polymorphism
Set = cluster[T: type] is create, insert, …
% representation for Set object
% implementation of Set operations
end Set
Set[int] s := Set[int]$create( )
Set[int]$insert(s, 3)
Polymorphism
Set = cluster[T: type] is create, insert, …
where T has equal: proctype(T, T)
returns (bool)
Iterators
 For all x in C do S
Iterators
 For all x in C do S
 Destroy the collection?
 Complicate the abstraction?
Visit to CMU
 Bill Wulf and Mary Shaw, Alphard
 Generators
Iterators
sum: int := 0
for e: int in Set[int]$members(s) do
sum := sum + e
end
Also
 Exception handling
 Strong specifications, e.g., IntSet$choose
 First class Procedures and Iterators
After CLU
 Argus and distributed computing
 Programming methodology
 Modular program design
 Reasoning about correctness
 Type hierarchy
From CLU to Object-Oriented
Programming
 SmallTalk provided inheritance
The Landscape
 Inheritance was used for:
 Implementation
 Type hierarchy
Type Hierarchy
 Wasn’t well understood
 E.g., stacks vs. queues
The Liskov Substitution
Principle (LSP)
 Objects of subtypes should behave like
those of supertypes if used via
supertype methods
 B. Liskov. Data abstraction and
hierarchy. Sigplan notices, May 1988
What Next?
 Modularity based on abstraction is the
way things are done
Programming Languages
Today
 Languages for experts, e.g., Java, C#
Programming 1A
 E.g., Python
Challenges
 A programming language for novices
and experts
 Ease of use vs. expressive power
 Readability vs. writeability
 Modularity and encapsulation
 Powerful abstraction mechanisms
 State matters
Challenges
 Massively-parallel computers
 Programming methodology
 Programming language support
The Power of Abstraction
Barbara Liskov
March 2013
MIT CSAIL

More Related Content

More from C4Media

Service Meshes- The Ultimate Guide
Service Meshes- The Ultimate GuideService Meshes- The Ultimate Guide
Service Meshes- The Ultimate GuideC4Media
 
Shifting Left with Cloud Native CI/CD
Shifting Left with Cloud Native CI/CDShifting Left with Cloud Native CI/CD
Shifting Left with Cloud Native CI/CDC4Media
 
CI/CD for Machine Learning
CI/CD for Machine LearningCI/CD for Machine Learning
CI/CD for Machine LearningC4Media
 
Fault Tolerance at Speed
Fault Tolerance at SpeedFault Tolerance at Speed
Fault Tolerance at SpeedC4Media
 
Architectures That Scale Deep - Regaining Control in Deep Systems
Architectures That Scale Deep - Regaining Control in Deep SystemsArchitectures That Scale Deep - Regaining Control in Deep Systems
Architectures That Scale Deep - Regaining Control in Deep SystemsC4Media
 
ML in the Browser: Interactive Experiences with Tensorflow.js
ML in the Browser: Interactive Experiences with Tensorflow.jsML in the Browser: Interactive Experiences with Tensorflow.js
ML in the Browser: Interactive Experiences with Tensorflow.jsC4Media
 
Build Your Own WebAssembly Compiler
Build Your Own WebAssembly CompilerBuild Your Own WebAssembly Compiler
Build Your Own WebAssembly CompilerC4Media
 
User & Device Identity for Microservices @ Netflix Scale
User & Device Identity for Microservices @ Netflix ScaleUser & Device Identity for Microservices @ Netflix Scale
User & Device Identity for Microservices @ Netflix ScaleC4Media
 
Scaling Patterns for Netflix's Edge
Scaling Patterns for Netflix's EdgeScaling Patterns for Netflix's Edge
Scaling Patterns for Netflix's EdgeC4Media
 
Make Your Electron App Feel at Home Everywhere
Make Your Electron App Feel at Home EverywhereMake Your Electron App Feel at Home Everywhere
Make Your Electron App Feel at Home EverywhereC4Media
 
The Talk You've Been Await-ing For
The Talk You've Been Await-ing ForThe Talk You've Been Await-ing For
The Talk You've Been Await-ing ForC4Media
 
Future of Data Engineering
Future of Data EngineeringFuture of Data Engineering
Future of Data EngineeringC4Media
 
Automated Testing for Terraform, Docker, Packer, Kubernetes, and More
Automated Testing for Terraform, Docker, Packer, Kubernetes, and MoreAutomated Testing for Terraform, Docker, Packer, Kubernetes, and More
Automated Testing for Terraform, Docker, Packer, Kubernetes, and MoreC4Media
 
Navigating Complexity: High-performance Delivery and Discovery Teams
Navigating Complexity: High-performance Delivery and Discovery TeamsNavigating Complexity: High-performance Delivery and Discovery Teams
Navigating Complexity: High-performance Delivery and Discovery TeamsC4Media
 
High Performance Cooperative Distributed Systems in Adtech
High Performance Cooperative Distributed Systems in AdtechHigh Performance Cooperative Distributed Systems in Adtech
High Performance Cooperative Distributed Systems in AdtechC4Media
 
Rust's Journey to Async/await
Rust's Journey to Async/awaitRust's Journey to Async/await
Rust's Journey to Async/awaitC4Media
 
Opportunities and Pitfalls of Event-Driven Utopia
Opportunities and Pitfalls of Event-Driven UtopiaOpportunities and Pitfalls of Event-Driven Utopia
Opportunities and Pitfalls of Event-Driven UtopiaC4Media
 
Datadog: a Real-Time Metrics Database for One Quadrillion Points/Day
Datadog: a Real-Time Metrics Database for One Quadrillion Points/DayDatadog: a Real-Time Metrics Database for One Quadrillion Points/Day
Datadog: a Real-Time Metrics Database for One Quadrillion Points/DayC4Media
 
Are We Really Cloud-Native?
Are We Really Cloud-Native?Are We Really Cloud-Native?
Are We Really Cloud-Native?C4Media
 
CockroachDB: Architecture of a Geo-Distributed SQL Database
CockroachDB: Architecture of a Geo-Distributed SQL DatabaseCockroachDB: Architecture of a Geo-Distributed SQL Database
CockroachDB: Architecture of a Geo-Distributed SQL DatabaseC4Media
 

More from C4Media (20)

Service Meshes- The Ultimate Guide
Service Meshes- The Ultimate GuideService Meshes- The Ultimate Guide
Service Meshes- The Ultimate Guide
 
Shifting Left with Cloud Native CI/CD
Shifting Left with Cloud Native CI/CDShifting Left with Cloud Native CI/CD
Shifting Left with Cloud Native CI/CD
 
CI/CD for Machine Learning
CI/CD for Machine LearningCI/CD for Machine Learning
CI/CD for Machine Learning
 
Fault Tolerance at Speed
Fault Tolerance at SpeedFault Tolerance at Speed
Fault Tolerance at Speed
 
Architectures That Scale Deep - Regaining Control in Deep Systems
Architectures That Scale Deep - Regaining Control in Deep SystemsArchitectures That Scale Deep - Regaining Control in Deep Systems
Architectures That Scale Deep - Regaining Control in Deep Systems
 
ML in the Browser: Interactive Experiences with Tensorflow.js
ML in the Browser: Interactive Experiences with Tensorflow.jsML in the Browser: Interactive Experiences with Tensorflow.js
ML in the Browser: Interactive Experiences with Tensorflow.js
 
Build Your Own WebAssembly Compiler
Build Your Own WebAssembly CompilerBuild Your Own WebAssembly Compiler
Build Your Own WebAssembly Compiler
 
User & Device Identity for Microservices @ Netflix Scale
User & Device Identity for Microservices @ Netflix ScaleUser & Device Identity for Microservices @ Netflix Scale
User & Device Identity for Microservices @ Netflix Scale
 
Scaling Patterns for Netflix's Edge
Scaling Patterns for Netflix's EdgeScaling Patterns for Netflix's Edge
Scaling Patterns for Netflix's Edge
 
Make Your Electron App Feel at Home Everywhere
Make Your Electron App Feel at Home EverywhereMake Your Electron App Feel at Home Everywhere
Make Your Electron App Feel at Home Everywhere
 
The Talk You've Been Await-ing For
The Talk You've Been Await-ing ForThe Talk You've Been Await-ing For
The Talk You've Been Await-ing For
 
Future of Data Engineering
Future of Data EngineeringFuture of Data Engineering
Future of Data Engineering
 
Automated Testing for Terraform, Docker, Packer, Kubernetes, and More
Automated Testing for Terraform, Docker, Packer, Kubernetes, and MoreAutomated Testing for Terraform, Docker, Packer, Kubernetes, and More
Automated Testing for Terraform, Docker, Packer, Kubernetes, and More
 
Navigating Complexity: High-performance Delivery and Discovery Teams
Navigating Complexity: High-performance Delivery and Discovery TeamsNavigating Complexity: High-performance Delivery and Discovery Teams
Navigating Complexity: High-performance Delivery and Discovery Teams
 
High Performance Cooperative Distributed Systems in Adtech
High Performance Cooperative Distributed Systems in AdtechHigh Performance Cooperative Distributed Systems in Adtech
High Performance Cooperative Distributed Systems in Adtech
 
Rust's Journey to Async/await
Rust's Journey to Async/awaitRust's Journey to Async/await
Rust's Journey to Async/await
 
Opportunities and Pitfalls of Event-Driven Utopia
Opportunities and Pitfalls of Event-Driven UtopiaOpportunities and Pitfalls of Event-Driven Utopia
Opportunities and Pitfalls of Event-Driven Utopia
 
Datadog: a Real-Time Metrics Database for One Quadrillion Points/Day
Datadog: a Real-Time Metrics Database for One Quadrillion Points/DayDatadog: a Real-Time Metrics Database for One Quadrillion Points/Day
Datadog: a Real-Time Metrics Database for One Quadrillion Points/Day
 
Are We Really Cloud-Native?
Are We Really Cloud-Native?Are We Really Cloud-Native?
Are We Really Cloud-Native?
 
CockroachDB: Architecture of a Geo-Distributed SQL Database
CockroachDB: Architecture of a Geo-Distributed SQL DatabaseCockroachDB: Architecture of a Geo-Distributed SQL Database
CockroachDB: Architecture of a Geo-Distributed SQL Database
 

Recently uploaded

The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessPixlogix Infotech
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 

Recently uploaded (20)

The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 

Keynote: The Power of Abstraction

  • 1. The Power of Abstraction Barbara Liskov March 2013 MIT CSAIL
  • 2. InfoQ.com: News & Community Site • 750,000 unique visitors/month • Published in 4 languages (English, Chinese, Japanese and Brazilian Portuguese) • Post content from our QCon conferences • News 15-20 / week • Articles 3-4 / week • Presentations (videos) 12-15 / week • Interviews 2-3 / week • Books 1 / month Watch the video with slide synchronization on InfoQ.com! http://www.infoq.com/presentations /programming-abstraction-liskov
  • 3. Presented at QCon London www.qconlondon.com Purpose of QCon - to empower software development by facilitating the spread of knowledge and innovation Strategy - practitioner-driven conference designed for YOU: influencers of change and innovation in your teams - speakers and topics driving the evolution and innovation - connecting and catalyzing the influencers and innovators Highlights - attended by more than 12,000 delegates since 2007 - held in 9 cities worldwide
  • 4. Software is Complex  Systems are big  and they do complicated things  and they may be distributed and/or concurrent
  • 5. Addressing Complexity  Algorithms, data structures, protocols
  • 6. Addressing Complexity  Algorithms, data structures, protocols  Programming methodology  Programming languages
  • 7. This Talk  Programming methodology as it developed  Programming languages  Programming languages today
  • 8. The Situation in 1970  The software crisis!
  • 9. Programming Methodology  How should programs be designed?  How should programs be structured?
  • 10. The Landscape  E. W. Dijkstra. Go To Statement Considered Harmful. Cacm, Mar. 1968
  • 11. The Landscape  N. Wirth. Program Development by Stepwise Refinement. Cacm, April 1971
  • 12. The Landscape  D. L. Parnas. Information Distribution Aspects of Design Methodology. IFIP Congress, 1971  “The connections between modules are the assumptions which the modules make about each other.”
  • 13. Modularity  A program is a collection of modules
  • 14. Modularity  A program is a collection of modules  Each module has an interface, described by a specification
  • 15. Modularity  A program is a collection of modules  Each has an interface, described by a specification  A module’s implementation is correct if it meets the specification  A using module depends only on the specification
  • 16. Modularity  A program is a collection of modules  Each has an interface, described by a specification  A module’s implementation is correct if it meets the specification  A using module depends only on the specification  E.g. a sort routine sort(a)
  • 17. Benefits of Modularity  Local reasoning  Modifiability  Independent development
  • 18. The Situation in 1970  Procedures were the only type of module  Not powerful enough, e.g., a file system  Not used very much  Complicated connections
  • 19. Partitions  B. Liskov. A Design Methodology for Reliable Software Systems. FJCC, Dec. 1972
  • 21. From Partitions to ADTs  How can these ideas be applied to building programs?
  • 23. Meeting in Savanah  ACM Sigplan-Sigops interface meeting. April 1973. (Sigplan Notices, Sept. 1973)  Started to work with Steve Zilles
  • 24. The Landscape  Extensible Languages  S. Schuman and P. Jourrand. Definition Mechanisms in Extensible Programming Languages. AFIPS. 1970  R. Balzer. Dataless Programming. AFIPS. 1967
  • 25. The Landscape  O-J. Dahl and C.A.R. Hoare. Hierarchical Program Structures. Structured Programming, Academic Press, 1972
  • 26. The Landscape  J. H. Morris. Protection in Programming Languages. Cacm. Jan. 1973
  • 27. Abstract Data Types  B. Liskov and S. Zilles. Programming with Abstract Data Types. ACM Sigplan Conference on Very High Level Languages. April 1974
  • 28. What that paper proposed  Abstract data types  A set of operations  And a set of objects  The operations provide the only way to use the objects  A sketch of a programming language
  • 29. From ADTs to CLU  Participants  Russ Atkinson  Craig Schaffert  Alan Snyder
  • 30.
  • 31. Why a Programming Language?  Communicating to programmers  Do ADTs work in practice?  Getting a precise definition  Achieving reasonable performance
  • 32. Some Facts about CLU  Static type checking  Heap-based  Separate compilation  No concurrency, no gotos, no inheritance
  • 33. CLU Mechanisms  Clusters  Polymorphism  Iterators  Exception handling
  • 34. Clusters IntSet = cluster is create, insert, delete, … % representation for IntSet objects % implementation of the operations end IntSet
  • 35. Clusters IntSet = cluster is create, insert, delete, … % representation for IntSet objects % implementation of the operations end IntSet IntSet s = IntSet$create( ) IntSet$insert(s, 3)
  • 36. Polymorphism Set = cluster[T: type] is create, insert, … % representation for Set object % implementation of Set operations end Set Set[int] s := Set[int]$create( ) Set[int]$insert(s, 3)
  • 37. Polymorphism Set = cluster[T: type] is create, insert, … where T has equal: proctype(T, T) returns (bool)
  • 38. Iterators  For all x in C do S
  • 39. Iterators  For all x in C do S  Destroy the collection?  Complicate the abstraction?
  • 40. Visit to CMU  Bill Wulf and Mary Shaw, Alphard  Generators
  • 41. Iterators sum: int := 0 for e: int in Set[int]$members(s) do sum := sum + e end
  • 42. Also  Exception handling  Strong specifications, e.g., IntSet$choose  First class Procedures and Iterators
  • 43. After CLU  Argus and distributed computing  Programming methodology  Modular program design  Reasoning about correctness  Type hierarchy
  • 44. From CLU to Object-Oriented Programming  SmallTalk provided inheritance
  • 45. The Landscape  Inheritance was used for:  Implementation  Type hierarchy
  • 46. Type Hierarchy  Wasn’t well understood  E.g., stacks vs. queues
  • 47. The Liskov Substitution Principle (LSP)  Objects of subtypes should behave like those of supertypes if used via supertype methods  B. Liskov. Data abstraction and hierarchy. Sigplan notices, May 1988
  • 48. What Next?  Modularity based on abstraction is the way things are done
  • 49. Programming Languages Today  Languages for experts, e.g., Java, C#
  • 51. Challenges  A programming language for novices and experts  Ease of use vs. expressive power  Readability vs. writeability  Modularity and encapsulation  Powerful abstraction mechanisms  State matters
  • 52. Challenges  Massively-parallel computers  Programming methodology  Programming language support
  • 53. The Power of Abstraction Barbara Liskov March 2013 MIT CSAIL