Click here to Skip to main content
15,890,973 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
#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 
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 
David O'Neil wrote:
If it works for you, though, it works. And that's all that really matters.

Yeah, I agree to a point. I'm working on some old prod code right now that is written in Java.
Because the original dev didn't understand anything he created every variable as a global.
The code is 2500 lines or so and it does some important prod work that is very simple --- or could be simple if the code wasn't so terrible.

Now you can't tell if you can change the variable you are looking at in the method way down on line 1000 because it may be used somewhere else and you can't tell if your change will kill it.

Side Effects
These are side effects. And they are really bad. The new paradigm of Functional Programming has a main point of attempting to remove all side effects because they are so difficult to manage. In Functional Programming, no function should ever create a side effect. Globals do the exact opposite.

Also, my main point about Python is the way that everything you declare and use automatically gets placed in the global namespace. That will always seem crazy to me.
Thumbs Up | :thumbsup:
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 
JokeRe: Please don't microwave library books! Pin
Jeremy Falcon28-Jun-20 6:01
professionalJeremy Falcon28-Jun-20 6:01 
GeneralRe: Please don't microwave library books! Pin
enhzflep28-Jun-20 22:38
enhzflep28-Jun-20 22:38 

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.