Click here to Skip to main content
15,892,746 members

Welcome to the Lounge

   

For discussing anything related to a software developer's life but is not for programming questions. Got a programming question?

The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.

 
GeneralRe: I have a horrible feeling I've been using a pattern for years... Pin
Kirk 1038982127-Nov-17 4:47
Kirk 1038982127-Nov-17 4:47 
GeneralRe: I have a horrible feeling I've been using a pattern for years... Pin
Nagy Vilmos24-Nov-17 6:05
professionalNagy Vilmos24-Nov-17 6:05 
JokeRe: I have a horrible feeling I've been using a pattern for years... Pin
Duncan Edwards Jones24-Nov-17 6:28
professionalDuncan Edwards Jones24-Nov-17 6:28 
GeneralRe: I have a horrible feeling I've been using a pattern for years... Pin
OriginalGriff24-Nov-17 6:41
mveOriginalGriff24-Nov-17 6:41 
PraiseRe: I have a horrible feeling I've been using a pattern for years... Pin
Jeremy Falcon24-Nov-17 13:12
professionalJeremy Falcon24-Nov-17 13:12 
GeneralRe: I have a horrible feeling I've been using a pattern for years... Pin
BillWoodruff25-Nov-17 5:01
professionalBillWoodruff25-Nov-17 5:01 
GeneralRe: I have a horrible feeling I've been using a pattern for years... Pin
Marc Clifton24-Nov-17 8:59
mvaMarc Clifton24-Nov-17 8:59 
GeneralRe: I have a horrible feeling I've been using a pattern for years... Pin
CodeWraith25-Nov-17 1:54
CodeWraith25-Nov-17 1:54 
Global variables of any flavor have that problem, that's why I would only do something like that for things that remain mostly constant throughout the program's lifetime.

Remember the Win32 hInstance parameter? It was passed to WinMain() as a parameter and remained unchanged from then on and you needed it for many Win32 API calls. The four bytes for a global variable were not much of a problem (yes, it was memory that was not cleaned up until the program ended) and it sure beats passing around that value to every window and dialog.

When memory hogging is under control, state is not problematic (or even constant), and when I need it all over the place, I will not go through the trouble of routing that object or variable to the remotest parts of the application.
I have lived with several Zen masters - all of them were cats.

GeneralRe: I have a horrible feeling I've been using a pattern for years... Pin
BillWoodruff25-Nov-17 7:25
professionalBillWoodruff25-Nov-17 7:25 
GeneralRe: I have a horrible feeling I've been using a pattern for years... Pin
lopatir24-Nov-17 18:45
lopatir24-Nov-17 18:45 
GeneralRe: I have a horrible feeling I've been using a pattern for years... Pin
CodeWraith25-Nov-17 1:04
CodeWraith25-Nov-17 1:04 
GeneralRe: I have a horrible feeling I've been using a pattern for years... Pin
Mike Hankey25-Nov-17 2:15
mveMike Hankey25-Nov-17 2:15 
GeneralRe: I have a horrible feeling I've been using a pattern for years... Pin
BillWoodruff25-Nov-17 4:57
professionalBillWoodruff25-Nov-17 4:57 
GeneralRe: I have a horrible feeling I've been using a pattern for years... Pin
OriginalGriff25-Nov-17 5:23
mveOriginalGriff25-Nov-17 5:23 
GeneralRe: I have a horrible feeling I've been using a pattern for years... Pin
Dave Sexton26-Nov-17 21:11
Dave Sexton26-Nov-17 21:11 
GeneralRe: I have a horrible feeling I've been using a pattern for years... Pin
Gary Wheeler27-Nov-17 1:25
Gary Wheeler27-Nov-17 1:25 
GeneralRe: I have a horrible feeling I've been using a pattern for years... Pin
Gerry Schmitz27-Nov-17 3:14
mveGerry Schmitz27-Nov-17 3:14 
GeneralRe: I have a horrible feeling I've been using a pattern for years... Pin
jschell27-Nov-17 9:14
jschell27-Nov-17 9:14 
GeneralRe: I have a horrible feeling I've been using a pattern for years... Pin
Richard Deeming28-Nov-17 3:49
mveRichard Deeming28-Nov-17 3:49 
QuestionProgramming Question of the Week? Pin
megaadam24-Nov-17 0:34
professionalmegaadam24-Nov-17 0:34 
AnswerRe: Programming Question of the Week? Pin
theoldfool24-Nov-17 1:02
professionaltheoldfool24-Nov-17 1:02 
AnswerRe: Programming Question of the Week? Pin
CPallini24-Nov-17 1:42
mveCPallini24-Nov-17 1:42 
AnswerRe: Programming Question of the Week? Pin
lopatir24-Nov-17 1:46
lopatir24-Nov-17 1:46 
JokeRe: Programming Question of the Week? Pin
V.24-Nov-17 1:49
professionalV.24-Nov-17 1:49 
AnswerRe: Programming Question of the Week? Pin
super24-Nov-17 2:30
professionalsuper24-Nov-17 2:30 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.