Re: Unintuitive behavior of class-side initialize
Posted by
kilon.alios on
Aug 27, 2014; 5:30pm
URL: https://forum.world.st/Unintuitive-behavior-of-class-side-initialize-tp4775042p4775110.html
yeah python does not need initialisation for class variables like it does for instance variables, but then same applies for instance variables, for example you can add instance variables and even instance method after the instance is created , pharo does something similar too.
Well OOP is a deep subject and this is an advanced topic that I would not want to put in an introductionary chapter.
I had issues with initialise on class side recently where i was told i had to initialise the class myself instead I chose to go down the ifNil route and initialise my class variables inside other methods. This way I avoided the creation of an initialise method, and probably i will avoid using it in the future too. From what I see most classes (metaclasses) dont use an initialise method either.