Skip to content

Commit c49d903

Browse files
committed
Initial commit
1 parent c72d5d3 commit c49d903

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

_posts/2015-10-07-pillars-of-oop.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ image:
1818
<figcaption>”Delicious PIE has everything to do with Object-Oriented Programming.”</figcaption>
1919
</figure>
2020

21-
Don't look at me that way, I'm not crazy. Pie really does have everything to do with OOP, object-oriented programming.
21+
Don't look at me that way, I'm not crazy. Pie really does have everything to do with OOP or **O**bject-**O**riented **P**rogramming.
2222

2323
It's the conceptual base that makes C++ (and Java, Python, Ruby, Simula, etc) what they are, OOP languages. So if you're like me, you learned what the three (or four, depending on who you talk to; but if I added the forth, I couldn't run with this whole pie joke...) pillars of OOP are: polymorphism, inheritance, and encapsulation.
2424

@@ -73,7 +73,7 @@ int main() {
7373
}
7474
{% endhighlight %}
7575

76-
**Note!** If you did not use a vector of `Animal` pointers but used a vector of `Animal` objects (`std::vector<Animal>`), you’d experience a problem in the for-each loop - when `a` is `Dog`, `a` will print “Noise,” like it’s parent class. Why? When you add the `Dog` object to the vector (of `Animal` objects), it will only copy the `Animal` part of `Dog`, leaving all the unique `Dog` bits behind.
76+
**Note!** If you did not use a vector of `Animal` pointers but used a vector of `Animal` objects (`std::vector<Animal>`), you’d experience a problem in the range-based for loop - when `a` is `Dog`, `a` will print “Noise,” like it’s parent class. Why? When you add the `Dog` object to the vector (of `Animal` objects), it will only copy the `Animal` part of `Dog`, leaving all the unique `Dog` bits behind.
7777
{: .notice}
7878

7979
#### Inheritance

0 commit comments

Comments
 (0)