There is ONE exception
Posted Apr 3, 2009 6:01 UTC (Fri) by khim
In reply to: A GNOME 3.0 plan
Parent article: A GNOME 3.0 plan
Using the same logic one could argue that "there is nothing at all you can do in C that you can't do in assembler", including having an object oriented approach.
Unfortunatelly it's not true at all. Yes, you can implement OOP in assembler (heck, TASM 3.0 included a lot of OOP-oriented constructs), but in the end the acholess heel of assembler is the fact that you can not write portable program in assembler. You even may need to call functions differently under different OS with the same CPU! Thus C makes sense as "high-level-portable-assembler".
There is a multitude of reasons why C++ exists, one of them being that much of the drudgery of handling objects is taken care of by the compiler.
Unfortunatelly it only means you must fight the compiler tooth and nail to make it produce somewhat sane code. Take a look on this and compare it with the same things in sane languages (Java or even GObject - even if it's not language it's must easier to make it do what you want and not what it wants).
to post comments)