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 |
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
|
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.
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".
|
|
|
|
|
Window without title bar
By: DoggyDog on Tue, 12 February 2008 16:48
|
|
|
Re: Window without title bar
By: DoggyDog on Wed, 13 February 2008 12:37
|
|
|
Re: Window without title bar
|
|
|
Re: Window without title bar
By: DoggyDog on Wed, 13 February 2008 13:02
|
|
|
Re: Window without title bar
By: DoggyDog on Wed, 13 February 2008 13:54
|
|
|
Re: Window without title bar
By: Werner on Wed, 13 February 2008 16:41
|
|
|
Re: Window without title bar
By: DoggyDog on Wed, 13 February 2008 17:16
|
|
|
Re: Window without title bar
By: Werner on Wed, 13 February 2008 21:06
|
|
|
Re: Window without title bar
By: DoggyDog on Thu, 14 February 2008 13:15
|
|
|
Re: Window without title bar
By: Werner on Thu, 14 February 2008 13:38
|
|
|
Re: Window without title bar
By: mr_ped on Thu, 14 February 2008 16:15
|
|
|
Re: Window without title bar
By: mrjt on Thu, 14 February 2008 16:18
|
|
|
Re: Window without title bar
|
|
|
Re: Window without title bar
By: Werner on Thu, 14 February 2008 18:54
|
|
|
Re: Window without title bar
By: Werner on Thu, 14 February 2008 22:06
|
|
|
Re: Window without title bar
By: mr_ped on Thu, 14 February 2008 18:07
|
Goto Forum:
Current Time: Sun Apr 28 02:10:51 CEST 2024
Total time taken to generate the page: 0.05576 seconds
|