Encapsulation and Performance in C++
←Older revision | Revision as of 07:03, 27 September 2012 | ||
Line 5: | Line 5: | ||
I've noticed an interesting article describing why [[C]] is more effective than [[C++]] and in general most of [[OOP]] languages. The [http://www.250bpm.com/blog:8 article] claims that by using [[OOP]] and insisting on encapsulation one cannot implement linked list as effectively as in [[C]]. I sort of agreed, but then I found that by using [[trait]] in [[Scala]] one can [[trait|implement effective list]] while keeping encapsulation. | I've noticed an interesting article describing why [[C]] is more effective than [[C++]] and in general most of [[OOP]] languages. The [http://www.250bpm.com/blog:8 article] claims that by using [[OOP]] and insisting on encapsulation one cannot implement linked list as effectively as in [[C]]. I sort of agreed, but then I found that by using [[trait]] in [[Scala]] one can [[trait|implement effective list]] while keeping encapsulation. | ||
- | Not a long time after that a reader subscribed as ''jtulach'' (stands for Jirka Tulach probably - as I am not aware of any other Tulach who would observe my [[blogs]], could spell [[C++]] and who's name would start with ''J'') [[Talk:Trait|argued and proved]] that one can achieve the same in [[C++]]. Here is jtulach's final code snippet: | + | Not a long time after that a reader subscribed as ''jtulach'' (stands for my cousin Jirka Tulach probably - as I am not aware of any other Tulach who would observe my [[blogs]], could spell [[C++]] and who's name would start with ''J'') [[Talk:Trait|argued and proved]] that one can achieve the same in [[C++]]. Here is jtulach's final code snippet: |
<source lang="cpp"> | <source lang="cpp"> |