Click here to Skip to main content
15,884,388 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: not sure where to put this. introductions (again) Pin
Clumpco28-Jun-20 23:11
Clumpco28-Jun-20 23:11 
GeneralI was sent this, and... Pin
OriginalGriff26-Jun-20 22:34
mveOriginalGriff26-Jun-20 22:34 
GeneralRe: I was sent this, and... Pin
Nelek27-Jun-20 0:06
protectorNelek27-Jun-20 0:06 
GeneralRe: I was sent this, and... Pin
RickZeeland27-Jun-20 0:37
mveRickZeeland27-Jun-20 0:37 
GeneralRe: I was sent this, and... Pin
F-ES Sitecore27-Jun-20 3:10
professionalF-ES Sitecore27-Jun-20 3:10 
GeneralRe: I was sent this, and... Pin
OriginalGriff27-Jun-20 3:59
mveOriginalGriff27-Jun-20 3:59 
GeneralRe: I was sent this, and... Pin
CPallini27-Jun-20 19:32
mveCPallini27-Jun-20 19:32 
Generaldo you like globals? I do not, Sam-I-Am Pin
raddevus26-Jun-20 9:40
mvaraddevus26-Jun-20 9:40 
THis is my rant on Python as I'm helping someone learn it for use in ML.
Did you know that a Python variable declared in the .py file is global to that file?
For example:

Python
def printGlobal():
   print(str(extra))

extra = 35
printGlobal() # prints 35
extra = "Python are stupid."

class Arsinine:
   def __init__(self):
      print(extra)

a = Arsinine() # prints Python are stupid.


Imagine if that .py file grew to be even just long enough to be off the screen. You might do something else with the extra variable and create odd issues since it is global.
Or, if there is more than one dev working on the code.
It's quite terrible.

Objects are for the express point of encapsulation, but you don't get that here.
I know, the class should be created in another file and all that.

843 People Upvoted this Comment
I do not know what kind of mind created this language and why you would want everything on the global scope like that. But here is a snapshot of comment from SO who are are chiming in that globals are not dangerous...
*Are these people devs[^]? Do they understand anything?
I guess they've all been fortunate enough to only work on their own code. Sigh | :sigh:

Yes, yes, anything can be used properly or improperly, but this makes it a bit difficult to use it properly. Probably proof that Python is a kiddie language that isn't concerned about creating larger programs. (I'm expecting to receive the fire after that comment.) Roll eyes | :rolleyes:

*Comment from first answer at: python - Using global variables in a function - Stack Overflow[^]
GeneralRe: do you like globals? I do not, Sam-I-Am Pin
ZurdoDev26-Jun-20 10:19
professionalZurdoDev26-Jun-20 10:19 
GeneralRe: do you like globals? I do not, Sam-I-Am Pin
Greg Utas26-Jun-20 10:38
professionalGreg Utas26-Jun-20 10:38 
GeneralRe: do you like globals? I do not, Sam-I-Am Pin
Nelek26-Jun-20 13:46
protectorNelek26-Jun-20 13:46 
GeneralRe: do you like globals? I do not, Sam-I-Am Pin
Greg Utas26-Jun-20 14:35
professionalGreg Utas26-Jun-20 14:35 
GeneralRe: do you like globals? I do not, Sam-I-Am Pin
Nelek27-Jun-20 0:04
protectorNelek27-Jun-20 0:04 
GeneralRe: do you like globals? I do not, Sam-I-Am Pin
raddevus26-Jun-20 10:45
mvaraddevus26-Jun-20 10:45 
GeneralRe: do you like globals? I do not, Sam-I-Am Pin
ZurdoDev26-Jun-20 10:48
professionalZurdoDev26-Jun-20 10:48 
GeneralRe: do you like globals? I do not, Sam-I-Am Pin
Nelek26-Jun-20 13:50
protectorNelek26-Jun-20 13:50 
GeneralRe: do you like globals? I do not, Sam-I-Am Pin
User 1106097926-Jun-20 10:32
User 1106097926-Jun-20 10:32 
GeneralRe: do you like globals? I do not, Sam-I-Am Pin
raddevus26-Jun-20 10:56
mvaraddevus26-Jun-20 10:56 
GeneralRe: do you like globals? I do not, Sam-I-Am Pin
Greg Utas26-Jun-20 10:59
professionalGreg Utas26-Jun-20 10:59 
GeneralRe: do you like globals? I do not, Sam-I-Am Pin
raddevus26-Jun-20 11:07
mvaraddevus26-Jun-20 11:07 
GeneralRe: do you like globals? I do not, Sam-I-Am Pin
Nelek26-Jun-20 13:48
protectorNelek26-Jun-20 13:48 
GeneralRe: do you like globals? I do not, Sam-I-Am Pin
Greg Utas26-Jun-20 14:37
professionalGreg Utas26-Jun-20 14:37 
GeneralRe: do you like globals? I do not, Sam-I-Am Pin
Nelek27-Jun-20 0:02
protectorNelek27-Jun-20 0:02 
GeneralRe: do you like globals? I do not, Sam-I-Am Pin
Greg Utas27-Jun-20 1:11
professionalGreg Utas27-Jun-20 1:11 
GeneralRe: do you like globals? I do not, Sam-I-Am PinPopular
#realJSOP26-Jun-20 11:32
mve#realJSOP26-Jun-20 11:32 

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.