instance counter

P

Pit Capitain

2008/10/21 Robert Klemme said:
I thought this was what you wanted since you can use @@foo inside instances.

I needed it from the class level, so Joel's solution would be what I needed.
Anyway, the point was to demonstrate that there is a clear and easy
solution that does not need class variables. Whether it's mine or
yours does not really matter that much. I for my part would rather
have this solution (which is probably a bit more verbose than the
class variable solution) then resort to class variables because they
make code fragile because the declaration order matters.

I guess we have to agree to disagree here. To me the code shown was
neither more easy nor more clear than using class variables, but to
each his own. The declaration order of class variables didn't matter
in my case. (In fact I think you have to invent some very special load
orders and class variable creation code to be hitten by this problem
in reality.)

Regards, and thank you and Joel for showing some alternatives,
Pit
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,778
Messages
2,569,605
Members
45,238
Latest member
Top CryptoPodcasts

Latest Threads

Top