When you create a new instance with #new automatically #initialize is sent. The default #initialize is provided in ProtoObject at the highest level of the class hierarchy (doing nothing). If you look deeper in the hierarchy you will notice that - some subclasses of Object override the #initialize method and call "super initialize" - some subclasses of Object override the #initialize method without calling "super initialize" No problem at the moment as there is no initialization done in Object or ProtoObject at the current point in time. But the question is should we care if there may be in the future? Thx T.
On Thu, Jun 26, 2014 at 9:46 AM, Torsten Bergmann <astares@gmx.de> wrote:
But the question is should we care if there may be in the future?
I think there is a lint rule that checks if #initialize calls super initialize. -- Damien Cassou http://damiencassou.seasidehosting.st "Success is the ability to go from one failure to another without losing enthusiasm." Winston Churchill
On 26 Jun 2014, at 11:30, Damien Cassou <damien.cassou@gmail.com> wrote:
On Thu, Jun 26, 2014 at 9:46 AM, Torsten Bergmann <astares@gmx.de> wrote:
But the question is should we care if there may be in the future?
I think there is a lint rule that checks if #initialize calls super initialise.
on instance side only Ben
-- Damien Cassou http://damiencassou.seasidehosting.st
"Success is the ability to go from one failure to another without losing enthusiasm." Winston Churchill
When you create a new instance with #new automatically #initialize is sent.
The default #initialize is provided in ProtoObject at the highest level of the class hierarchy (doing nothing).
If you look deeper in the hierarchy you will notice that
- some subclasses of Object override the #initialize method and call "super initialize" - some subclasses of Object override the #initialize method without calling "super initialize"
No problem at the moment as there is no initialization done in Object or ProtoObject at the current point in time.
But the question is should we care if there may be in the future? I prefer to have a super call for consistency reasons. Igor jokes me usually on that. Now there should not be an initialize in ProtoObject and Object in the future.
So which ones - some subclasses of Object override the #initialize method without calling "super initialize" Stef
Thx T.
Am 26.06.2014 um 18:48 schrieb stepharo <stepharo@free.fr>:
When you create a new instance with #new automatically #initialize is sent.
The default #initialize is provided in ProtoObject at the highest level of the class hierarchy (doing nothing).
If you look deeper in the hierarchy you will notice that
- some subclasses of Object override the #initialize method and call "super initialize" - some subclasses of Object override the #initialize method without calling "super initialize"
No problem at the moment as there is no initialization done in Object or ProtoObject at the current point in time.
But the question is should we care if there may be in the future? I prefer to have a super call for consistency reasons. Igor jokes me usually on that. I'm on your side. Screw Igor :)
Norbert
Now there should not be an initialize in ProtoObject and Object in the future.
So which ones
- some subclasses of Object override the #initialize method without calling "super initialize"
Stef
Thx T.
Hi: On 26 Jun 2014, at 18:48, stepharo <stepharo@free.fr> wrote:
I prefer to have a super call for consistency reasons. Igor jokes me usually on that. Now there should not be an initialize in ProtoObject and Object in the future.
Just curios, whatâs the reasoning behind not having #initialize in Object? Initialization isnât a core concept Object should support? I am asking because in SOM, Object indeed does not have #initialize, and well, I find that a little annoying. Because often enough I need to add a #new method that sends #initialize, but since it is not available implicitly everywhere, the system is rather inconsistent in that regard. Different classes end up using slightly different approaches to initialization, which is confusing. Best regards Stefan -- Stefan Marr INRIA Lille - Nord Europe http://stefan-marr.de/research/
participants (6)
-
Benjamin -
Damien Cassou -
Norbert Hartl -
Stefan Marr -
stepharo -
Torsten Bergmann