LWN.net Logo

There is ONE exception

There is ONE exception

Posted Apr 3, 2009 6:16 UTC (Fri) by qg6te2 (guest, #52587)
In reply to: There is ONE exception by khim
Parent article: A GNOME 3.0 plan

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).

I'm not sure about "fighting the compiler tooth and nail". If one does that, it generally means one is fighting against the language rather than using it properly. Any language can be abused, and C++ is no exception. Furthermore, the link provided above leads to much Qt-specific code, which shouldn't be equated with all of C++ code. Qt has far more specific idiosyncrasies than gtkmm, for example.


(Log in to post comments)

There is ONE exception

Posted Apr 3, 2009 13:06 UTC (Fri) by nix (subscriber, #2304) [Link]

Actually, most of the stuff in that link is about not violating the
compiler's invariants regarding class definitions that change. As this is
technically a violation of the One Definition Rule in the C++ Standard,
it's unsurprising that it's a bit of a nest of snakes... but you come
across *exactly the same problem in C* if you have a system that makes
heavy use of structures and you want to change some of them without
recompiling all their users. The rules just *look* odder because the
structures are automatically built for you by the compiler: if you had to
build them by hand, *all the same issues would arise anyway*.

Copyright © 2013, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds