Good morning, class.
And welcome to OOP 101.
.container { background: blue; color: red; } .container .text { color: green; }
What is this? CSS from
the previous class?
As you may know, CSS is not real programming.
In this class, we'll learn about the object-oriented paradigm and proper programming.
Abstraction, inheritance, polymorphism, classes... by the end of this course you'll master them!
class Vehicle { protected String color = "red"; protected Int length = 200; protected Int posX = 0; public void move() { this.posX += 2; } } class Car extends Vehicle { public String color = "blue"; }
That's a lot better!
Unfortunately, some of you seem
to struggle with Java's notation...
Too verbose, too much new syntax...
So, I came up with a simpler beginners' notation for you
Let's remove the class and inheritance keywords for now...


...And replace them with something smaller, like a dot.
Then, we remove the variable types and modifiers...


...We'll reattach them once we view the access modifiers on chapter 4.
And we simplify other things like the properties and values, the indentation, and the functions, and... there it is!
.vehicle { color: red; width: 200; left: 0; &.move { animation: moveLeft 2s; } } .car.vehicle { color: blue; }
I found that with these changes, students understand the concepts better...
...While preserving all of the OOP core ideas perfectly.
.vehicle { color: red; width: 200; left: 0; &.move { animation: moveLeft 2s; } } .car.vehicle { color: blue; }
Any questio...?
See more comics