Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » Extra libraries, Code snippets, applications etc. » U++ users applications in progress and useful code snippets, including reference examples! » Window without title bar
Re: Window without title bar [message #14138 is a reply to message #14135] Thu, 14 February 2008 18:07 Go to previous message
mr_ped is currently offline  mr_ped
Messages: 825
Registered: November 2005
Location: Czech Republic - Praha
Experienced Contributor
mrjt wrote on Thu, 14 February 2008 16:18

Isn't the difference that Singletons/Single<>s only get memory allocated on heap when they are first used?

Not that this is ever really useful Smile


That's completely true.
And I'm still missing any real world scenario where you need global variable allocated as late as possible. I mean, I can't even imagine one, and I really tried for couple of minutes. Smile
Even if such need would arise, you can still have global pointer to some memory huge object which is instantiated later into the program (at the moment when you find it appropriate).

I mean, the singletons are nice in the way you don't need to think what part of program you are in, and if that global variable has been already initialized. While some people may find this property as an advantage, I think it's actually major drawback instead. They sort of hide the structure of code and data-flow by making the initialization and usage to look the same.
It's better to understand when/how/why are executed parts of your application and when components need to be initialized, than fixing lack of understanding by using fool-proof classes.

I mean the fool-proof part of code is not a bad thing, but it should save you in case of your mistake (and detect+report that in ideal world so it gets noticed), not deliberately using it all the time and working without clue why you are doing that piece of code there but it "oh, just works anyway so who cares".
 
Read Message icon5.gif
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Sometimes, you don't want to update the GUI...
Next Topic: print multiple postscript/PDF in windows
Goto Forum:
  


Current Time: Sun Apr 28 02:10:51 CEST 2024

Total time taken to generate the page: 0.05576 seconds