Saturday, March 18, 2017

Object Oriented Programming

OOP is just one approach to creating computing abstractions that's very popular because it's based on how we already think and perceive. We see the world in terms of things (objects) doing things (methods), and thus a programming language that allows us to define computing processes using that way of thinking feels much more familiar than, say, writing ones and zeros. OOP languages are all just variants of how to formally define those abstractions to a computer. 

When I learned about object oriented programming in college using Java, I first learned a bunch of weird buzzwords like encapsulation, inheritance, polymorphism and that you need to make classes of things before they can do things. Oh and that in order to share the same set of behaviors in one class in the definition of another you have to use the "extends" keyword. So boring.  

This kind of introduction to OOP that starts with the unique terms of OO and language specific keywords makes it harder to grasp the essence of the why behind OOP. Students don't need to know the difference between an abstract class or an interface to "get" OOP. 

Regardless of what OO language you use, you'll always be dealing with objects and data structures. They're both data, but objects are a higher level abstraction that also comes with actions whereas data structures is just pure data. All the other terms surrounding OO that are language specific are just ways that that language allows you to define the behavior of those objects and their relationships with other objects. 

Concepts like "polymorphism" and "encapsulation" are just things that are made easier by OO programming, but are not exclusive to OO programming languages. I think it's much more effective to teach how to model processes with OO first, then introduce more specialized concepts once the basic big picture understanding is cemented. Things like "encapsulation" starts to make perfect sense once you start seeing the benefits of hiding the details of how a thing does something. 


1 comment:

  1. I was diagnosed as HEPATITIS B carrier in 2013 with fibrosis of the
    liver already present. I started on antiviral medications which
    reduced the viral load initially. After a couple of years the virus
    became resistant. I started on HEPATITIS B Herbal treatment from
    ULTIMATE LIFE CLINIC (www.ultimatelifeclinic.com) in March, 2020. Their
    treatment totally reversed the virus. I did another blood test after
    the 6 months long treatment and tested negative to the virus. Amazing
    treatment! This treatment is a breakthrough for all HBV carriers.

    ReplyDelete