Python Forum
Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help with classes
#7
self doesn't cost anything
removing global variables is worth it.

As you write larger and larger code, sooner or later a global will burn you badly.

consider the following where two programmers are working on the same code.
both use the same global variable, but in different functions.
Programmer A changes the global variable.
Programmer B had changed the global variable at the start of his routine, prior to the change that
programmer A made.
Next, based on the value in the global, programmer B executes code that erases backup files.
Not good
Reply


Messages In This Thread
Help with classes - by lucaswinnerton - Feb-06-2019, 06:33 PM
RE: Help with classes - by woooee - Feb-06-2019, 08:22 PM
RE: Help with classes - by lucaswinnerton - Feb-06-2019, 08:26 PM
RE: Help with classes - by Larz60+ - Feb-06-2019, 08:23 PM
RE: Help with classes - by woooee - Feb-06-2019, 09:40 PM
RE: Help with classes - by lucaswinnerton - Feb-06-2019, 10:01 PM
RE: Help with classes - by Larz60+ - Feb-07-2019, 01:23 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Using classes? Can I just use classes to structure code? muteboy 5 5,076 Nov-01-2017, 04:20 PM
Last Post: metulburr

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020