[Qt-interest] Semi-OT: indentation with operator<<

Ian Thomson Ian.Thomson at iongeo.com
Tue Jul 27 14:04:59 CEST 2010


Atlant Schmidt wrote:
>   And once you've written about twenty times as much code
>   as you would have written just to use a global variable,
>   the compiler will optimize all those inline functions
>   away again, leaving you with code that's just about as
>   efficient as if you'd used a global variable in the first
>   place. But instead of saying, in embarrassed hushed tones,
>   "Oh, he used a global -- how tragic for him", they'll all
>   instead observe "What a clever C++ programmer he is!".
> 
>                        Atlant
> 

Uh, singletons ARE global variables. They have all the same caveats as 
global variables do.

People don't dislike global variables to be trendy, they dislike them 
because they can cause problems down the line e.g. with threading, 
expansion to multiple instances...

Ian.



More information about the Qt-interest-old mailing list