Click here to Skip to main content
15,889,704 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: do you like globals? I do not, Sam-I-Am Pin
Nelek27-Jun-20 0:15
protectorNelek27-Jun-20 0:15 
GeneralRe: do you like globals? I do not, Sam-I-Am Pin
David O'Neil27-Jun-20 11:07
professionalDavid O'Neil27-Jun-20 11:07 
GeneralRe: do you like globals? I do not, Sam-I-Am Pin
#realJSOP27-Jun-20 3:24
mve#realJSOP27-Jun-20 3:24 
GeneralRe: do you like globals? I do not, Sam-I-Am Pin
raddevus27-Jun-20 6:02
mvaraddevus27-Jun-20 6:02 
GeneralRe: do you like globals? I do not, Sam-I-Am Pin
David O'Neil27-Jun-20 11:10
professionalDavid O'Neil27-Jun-20 11:10 
GeneralRe: do you like globals? I do not, Sam-I-Am Pin
Greg Utas27-Jun-20 4:10
professionalGreg Utas27-Jun-20 4:10 
GeneralRe: do you like globals? I do not, Sam-I-Am Pin
raddevus27-Jun-20 6:11
mvaraddevus27-Jun-20 6:11 
GeneralRe: do you like globals? I do not, Sam-I-Am Pin
raddevus27-Jun-20 5:58
mvaraddevus27-Jun-20 5:58 
David O'Neil wrote:
Globals are a tool.

I agree with that. I just think that in Python they made globals to default like that to make it easier for people learning to program. However, I don't think it makes it easier really. It is confusing in a different way really.

David O'Neil wrote:
But if I found a place where a Singleton absolutely made sense, I'd use a Singleton

That's good balance. Also, I like a Singleton for app configuration. There really is only one app config but there it is also a good candidate because it is made up of multiple properties which probably means having them all together in one object is nice instead of spread around in the code where you have to look everywhere to find them.
GeneralRe: do you like globals? I do not, Sam-I-Am Pin
David O'Neil27-Jun-20 11:11
professionalDavid O'Neil27-Jun-20 11:11 
GeneralRe: do you like globals? I do not, Sam-I-Am Pin
raddevus28-Jun-20 12:32
mvaraddevus28-Jun-20 12:32 
GeneralRe: do you like globals? I do not, Sam-I-Am Pin
David O'Neil28-Jun-20 12:42
professionalDavid O'Neil28-Jun-20 12:42 
GeneralRe: do you like globals? I do not, Sam-I-Am Pin
raddevus28-Jun-20 13:14
mvaraddevus28-Jun-20 13:14 
GeneralRe: do you like globals? I do not, Sam-I-Am Pin
Super Lloyd26-Jun-20 17:39
Super Lloyd26-Jun-20 17:39 
GeneralRe: do you like globals? I do not, Sam-I-Am Pin
raddevus27-Jun-20 5:59
mvaraddevus27-Jun-20 5:59 
GeneralRe: do you like globals? I do not, Sam-I-Am Pin
Jörgen Andersson26-Jun-20 21:51
professionalJörgen Andersson26-Jun-20 21:51 
GeneralRe: do you like globals? I do not, Sam-I-Am Pin
Richard MacCutchan26-Jun-20 23:24
mveRichard MacCutchan26-Jun-20 23:24 
GeneralRe: do you like globals? I do not, Sam-I-Am Pin
raddevus27-Jun-20 5:53
mvaraddevus27-Jun-20 5:53 
RantPlease don't microwave library books! Pin
Cp-Coder26-Jun-20 8:03
Cp-Coder26-Jun-20 8:03 
GeneralRe: Please don't microwave library books! Pin
ZurdoDev26-Jun-20 10:20
professionalZurdoDev26-Jun-20 10:20 
AnswerRe: Please don't microwave library books! Pin
ZurdoDev26-Jun-20 10:22
professionalZurdoDev26-Jun-20 10:22 
JokeRe: Please don't microwave library books! Pin
raddevus26-Jun-20 10:50
mvaraddevus26-Jun-20 10:50 
GeneralRe: Please don't microwave library books! Pin
DRHuff26-Jun-20 16:55
DRHuff26-Jun-20 16:55 
GeneralRe: Please don't microwave library books! Pin
Joan M27-Jun-20 2:36
professionalJoan M27-Jun-20 2:36 
GeneralRe: Please don't microwave library books! Pin
Sander Rossel28-Jun-20 0:21
professionalSander Rossel28-Jun-20 0:21 
GeneralRe: Please don't microwave library books! Pin
enhzflep28-Jun-20 22:35
enhzflep28-Jun-20 22:35 

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.