SlideShare a Scribd company logo
Lies My OO
Teacher Told
Me
Eric Normand
Registration for Classes
• Go to a department
• Read the list of classes given
• Put your name on the list for each class
• Repeat
Background
• These are lies I have personally experienced in my education.
• Most of my education was in Object Oriented Programming.
• It may seem like I’m attacking Object Oriented Programming.
• But I’m not. I have a lot of respect for OOP.
• But these are things I’ve learned through functional programming.
• And they are universally applicable.
For the video and transcript of
this presentation,
click here:
https://lispcast.com/lies-my-oo-teacher-told-me/
Object Oriented Modeling
Process• Take a natural-language description of the problem
• Underline all of the nouns.
• Make a class for each noun.
• Look for possessive words like “have”, those become
references.
• Underline all of the verbs.
• Make a method for each verb.
Student Registration
• A university allows students to register for courses. Each student
may register for multiple courses. And each course can have
multiple students.
Student Registration
• A university allows students to register for courses. Each student
may register for multiple courses. And each course can have
multiple students.
Student
register(Course)
getCourses()
courses
Course
register(Student)
getStudents()
students
University
getStudents()
getCourses()
courses
students
Student
register(Course)
getCourses()
courses
Course
register(Student)
getStudents()
students
Person
HistoryCourse MathCourse
University
getStudents()
getCourses()
courses
students
LIES!
Lie #1: Noun and Verb?
• Student
• Study
• Studious
• Register
• Registration
• Registry
Takeaways
• We have to look deeper than part of speech.
• We have many more options for modeling.
Command-Query Separation
• Queries:
• Methods that are like questions you ask the object.
• No modifications.
• Commands:
• Methods that modify the object or call a command on another object.
Questions - Queries
• What is your name?
• What is your Student ID?
• What classes are you registered for?
Actions - Commands
• Change your name to “xxx”.
• Change your Student ID to “xxx”.
• Register for X course.
LIES!
Lie #2: Those are interesting
questions
• These are questions, but do they modify?
• What would it take to register you for this course?
• I bet your schedule would be better if you added this course? Is
it?
• What was your schedule last year?
• I know you haven’t decided, but could you give me an example
schedule?
Takeaways
• Easy questions like “What is your name?” are uninteresting.
• Interesting questions are more like commands in an alternate
reality.
• Hypotheticals
• Counterfactuals
Model relationships with
references
• Student.courses - list of pointers to Courses
• Course.students - list of pointers to Students
• University.courses - list of pointers to Courses
• University.students - list of pointers to Students
LIES!
Lie #3: Tracking relationships with
pointers
• Pointing to mutable object.
• It’s changing as you look at it.
• Pointers are ephemeral and out of your control.
• Pointers are different each time you run.
• There could be two Student objects with the same Student ID.
• Same real person, different objects.
Takeaways
• Model relationships with a value
• Something immutable
• With equality semantics
• That represents identity
Let’s model the registration
process
• Construct a University
• Construct a Student
• Construct the Course they want
• Call the register method on Student with Course
• …
• Profit!
LIES!
Lie #4: We want to model the
actors
• Why is the register method on Student?
• Because “A student registers for a course”
• We need to record the course in Student.courses
• Why is the register method on Course?
• Because we need to record the student in Courses.students.
• Will these lists get out of sync?
• Why are we modeling students and courses, anyway?
• OO programming was made for Simulations.
Takeaways
• What should we simulate?
• Exercise:
• How would you run registration if all you had were paper and
pen?
LIES!
Object Oriented Programming
• You can do all of this with OOP.
• Many good programmers already do.
• Lie #1: Noun/verb
• Many OO refactorings convert between class and method
• Lie #2: Queries are interesting
• Simulation is great for counterfactuals.
• Lie #3: Relationships with pointers
• Value objects.
• Lie #4: Modeling all of the actors
• Easily done in OOP.
• OOP is great for exploring different models.
Eric Normand
Follow Eric on:
Eric Normand @EricNormand
eric@lispcast.comlispcast.com

More Related Content

PPTX
2 Day Android Workshop
KEY
ARTDM 171 Web Design: Week 1 Overview
KEY
Ted-Talking: Blogging with Students
PPT
symfony: PHP doesn't have to be crap
PPTX
Educ 1817 intro to tesol
PPTX
Peer editing for hybrid classes
PPTX
From student to graduate trainee : a user perspective / Liz Antel, Graduate L...
PPTX
Using our blackboard course for hybrids
2 Day Android Workshop
ARTDM 171 Web Design: Week 1 Overview
Ted-Talking: Blogging with Students
symfony: PHP doesn't have to be crap
Educ 1817 intro to tesol
Peer editing for hybrid classes
From student to graduate trainee : a user perspective / Liz Antel, Graduate L...
Using our blackboard course for hybrids

Similar to Lies My OO Teacher Told Me (20)

PPTX
3-db-er_3-db-er_3-db-er_3-db-er_3-db-er.pptx
PPT
Conference Presentation Proposal Template 2.ppt
PDF
Seiler Miil & Lepik - Student centred active learning approach in an online i...
PPTX
Essentials for a Better ICT Student in Palestine
PPTX
Learning style workshop
PDF
TA presentation
PPTX
Applying for Graduate School in S.T.E.M.
PPTX
Data and assessment powerpoint presentation 2015
PPTX
Data and assessment powerpoint presentation 2015
PPTX
Writing for Success write on compass media presentation 2014 v1.0
PPTX
1 b class 1
PPTX
Learning environment optimisation: Doing less with more for better outcomes
PPTX
Logistics.pptx
PPTX
1 b class 1
PPTX
Online Homework Help
PPTX
Welcome Comp II
PDF
Hackernote on gsoc
PPTX
Analyzing the Academic Library Job Pool
3-db-er_3-db-er_3-db-er_3-db-er_3-db-er.pptx
Conference Presentation Proposal Template 2.ppt
Seiler Miil & Lepik - Student centred active learning approach in an online i...
Essentials for a Better ICT Student in Palestine
Learning style workshop
TA presentation
Applying for Graduate School in S.T.E.M.
Data and assessment powerpoint presentation 2015
Data and assessment powerpoint presentation 2015
Writing for Success write on compass media presentation 2014 v1.0
1 b class 1
Learning environment optimisation: Doing less with more for better outcomes
Logistics.pptx
1 b class 1
Online Homework Help
Welcome Comp II
Hackernote on gsoc
Analyzing the Academic Library Job Pool
Ad

More from Eric Normand (9)

PDF
You are in a maze of deeply nested maps, all alike
PDF
The elements of a functional mindset
PDF
All I Needed for Functional Programming I Learned in High School Algebra
PDF
What is Functional Programming?
PDF
Functional Programming for Business
PDF
A Theory of Functional Programming LambdUp
PDF
Testing stateful, concurrent, and async systems using test.check
PDF
Building Composable Abstractions
PDF
ClojureScript: I can't believe this is JavaScript
You are in a maze of deeply nested maps, all alike
The elements of a functional mindset
All I Needed for Functional Programming I Learned in High School Algebra
What is Functional Programming?
Functional Programming for Business
A Theory of Functional Programming LambdUp
Testing stateful, concurrent, and async systems using test.check
Building Composable Abstractions
ClojureScript: I can't believe this is JavaScript
Ad

Recently uploaded (20)

PDF
EXPLORING LEARNING ENGAGEMENT FACTORS INFLUENCING BEHAVIORAL, COGNITIVE, AND ...
PDF
August -2025_Top10 Read_Articles_ijait.pdf
PDF
BIO-INSPIRED ARCHITECTURE FOR PARSIMONIOUS CONVERSATIONAL INTELLIGENCE : THE ...
PDF
Soil Improvement Techniques Note - Rabbi
PPTX
AUTOMOTIVE ENGINE MANAGEMENT (MECHATRONICS).pptx
PDF
Improvement effect of pyrolyzed agro-food biochar on the properties of.pdf
PDF
Human-AI Collaboration: Balancing Agentic AI and Autonomy in Hybrid Systems
PPTX
communication and presentation skills 01
PDF
Categorization of Factors Affecting Classification Algorithms Selection
PPTX
6ME3A-Unit-II-Sensors and Actuators_Handouts.pptx
PPTX
Module 8- Technological and Communication Skills.pptx
PDF
Level 2 – IBM Data and AI Fundamentals (1)_v1.1.PDF
PDF
PREDICTION OF DIABETES FROM ELECTRONIC HEALTH RECORDS
PDF
737-MAX_SRG.pdf student reference guides
PDF
Exploratory_Data_Analysis_Fundamentals.pdf
PPTX
introduction to high performance computing
PPTX
Management Information system : MIS-e-Business Systems.pptx
PDF
ChapteR012372321DFGDSFGDFGDFSGDFGDFGDFGSDFGDFGFD
PDF
A SYSTEMATIC REVIEW OF APPLICATIONS IN FRAUD DETECTION
PPTX
Feature types and data preprocessing steps
EXPLORING LEARNING ENGAGEMENT FACTORS INFLUENCING BEHAVIORAL, COGNITIVE, AND ...
August -2025_Top10 Read_Articles_ijait.pdf
BIO-INSPIRED ARCHITECTURE FOR PARSIMONIOUS CONVERSATIONAL INTELLIGENCE : THE ...
Soil Improvement Techniques Note - Rabbi
AUTOMOTIVE ENGINE MANAGEMENT (MECHATRONICS).pptx
Improvement effect of pyrolyzed agro-food biochar on the properties of.pdf
Human-AI Collaboration: Balancing Agentic AI and Autonomy in Hybrid Systems
communication and presentation skills 01
Categorization of Factors Affecting Classification Algorithms Selection
6ME3A-Unit-II-Sensors and Actuators_Handouts.pptx
Module 8- Technological and Communication Skills.pptx
Level 2 – IBM Data and AI Fundamentals (1)_v1.1.PDF
PREDICTION OF DIABETES FROM ELECTRONIC HEALTH RECORDS
737-MAX_SRG.pdf student reference guides
Exploratory_Data_Analysis_Fundamentals.pdf
introduction to high performance computing
Management Information system : MIS-e-Business Systems.pptx
ChapteR012372321DFGDSFGDFGDFSGDFGDFGDFGSDFGDFGFD
A SYSTEMATIC REVIEW OF APPLICATIONS IN FRAUD DETECTION
Feature types and data preprocessing steps

Lies My OO Teacher Told Me

  • 1. Lies My OO Teacher Told Me Eric Normand
  • 2. Registration for Classes • Go to a department • Read the list of classes given • Put your name on the list for each class • Repeat
  • 3. Background • These are lies I have personally experienced in my education. • Most of my education was in Object Oriented Programming. • It may seem like I’m attacking Object Oriented Programming. • But I’m not. I have a lot of respect for OOP. • But these are things I’ve learned through functional programming. • And they are universally applicable.
  • 4. For the video and transcript of this presentation, click here: https://lispcast.com/lies-my-oo-teacher-told-me/
  • 5. Object Oriented Modeling Process• Take a natural-language description of the problem • Underline all of the nouns. • Make a class for each noun. • Look for possessive words like “have”, those become references. • Underline all of the verbs. • Make a method for each verb.
  • 6. Student Registration • A university allows students to register for courses. Each student may register for multiple courses. And each course can have multiple students.
  • 7. Student Registration • A university allows students to register for courses. Each student may register for multiple courses. And each course can have multiple students.
  • 10. LIES!
  • 11. Lie #1: Noun and Verb? • Student • Study • Studious • Register • Registration • Registry
  • 12. Takeaways • We have to look deeper than part of speech. • We have many more options for modeling.
  • 13. Command-Query Separation • Queries: • Methods that are like questions you ask the object. • No modifications. • Commands: • Methods that modify the object or call a command on another object.
  • 14. Questions - Queries • What is your name? • What is your Student ID? • What classes are you registered for?
  • 15. Actions - Commands • Change your name to “xxx”. • Change your Student ID to “xxx”. • Register for X course.
  • 16. LIES!
  • 17. Lie #2: Those are interesting questions • These are questions, but do they modify? • What would it take to register you for this course? • I bet your schedule would be better if you added this course? Is it? • What was your schedule last year? • I know you haven’t decided, but could you give me an example schedule?
  • 18. Takeaways • Easy questions like “What is your name?” are uninteresting. • Interesting questions are more like commands in an alternate reality. • Hypotheticals • Counterfactuals
  • 19. Model relationships with references • Student.courses - list of pointers to Courses • Course.students - list of pointers to Students • University.courses - list of pointers to Courses • University.students - list of pointers to Students
  • 20. LIES!
  • 21. Lie #3: Tracking relationships with pointers • Pointing to mutable object. • It’s changing as you look at it. • Pointers are ephemeral and out of your control. • Pointers are different each time you run. • There could be two Student objects with the same Student ID. • Same real person, different objects.
  • 22. Takeaways • Model relationships with a value • Something immutable • With equality semantics • That represents identity
  • 23. Let’s model the registration process • Construct a University • Construct a Student • Construct the Course they want • Call the register method on Student with Course • … • Profit!
  • 24. LIES!
  • 25. Lie #4: We want to model the actors • Why is the register method on Student? • Because “A student registers for a course” • We need to record the course in Student.courses • Why is the register method on Course? • Because we need to record the student in Courses.students. • Will these lists get out of sync? • Why are we modeling students and courses, anyway? • OO programming was made for Simulations.
  • 26. Takeaways • What should we simulate? • Exercise: • How would you run registration if all you had were paper and pen?
  • 27. LIES!
  • 28. Object Oriented Programming • You can do all of this with OOP. • Many good programmers already do. • Lie #1: Noun/verb • Many OO refactorings convert between class and method • Lie #2: Queries are interesting • Simulation is great for counterfactuals. • Lie #3: Relationships with pointers • Value objects. • Lie #4: Modeling all of the actors • Easily done in OOP. • OOP is great for exploring different models.
  • 29. Eric Normand Follow Eric on: Eric Normand @EricNormand [email protected]