r/Python • • Jan 05 '18

Really??

Post image
2.0k Upvotes

317 comments sorted by

View all comments

Show parent comments

2

u/scootstah Jan 09 '18

But they're not globals. They disappear when references are lost. Globals don't do that.

It has the same effect. If you're no longer holding reference to something, why does it need to still exist?

I could link you three dozen articles explaining why globals are a code smell, but I'll let you look it up yourself.

In the mean time, we can agree to disagree.

1

u/[deleted] Jan 09 '18

It doesn't change the fact that they're not globals. You don't need to maintain references to globals to keep them existing.

And it is something that Java doesn't do, code smell or not.

Just pack it in --- you've lost this one. I showed you something that Python can do that Java cannot.

2

u/scootstah Jan 09 '18

I guess you'll just have to get out of your box and learn to code the correct way.

1

u/[deleted] Jan 09 '18

Sorry, you're picking on the wrong guy. I've got several years of Java and Python and several other languages under my belt.

Just admit defeat, admit that Python can do things that Java can't, and move on with your life. It's OK to be wrong.

2

u/scootstah Jan 09 '18

I don't agree that "Python can do things that Java can't" based solely on the fact that Java doesn't implement globals.

Any problem that you can solve with Python, you can solve with Java. Simple as that.

1

u/[deleted] Jan 09 '18

Who would disagree with that? They're both Turing complete, after all.

But that wasn't what I asserted and it wasn't what was asked.