DOH!!!!
-
So I posted a question in the C# forum trying to figure out why my app settings were not reloading. My class has properties for each setting:
public bool IsSensorListVisible
{
get { return _IsSensorListVisible; }
set
{
if (_IsSensorListVisible != value)
{
_IsSensorListVisible = value;**save();** } }
}
.
.
.Notice the call to Save?? So the CTOR calls Load, which sets each property, which then calls Save... DOH!!!
If it's not broken, fix it until it is
-
So I posted a question in the C# forum trying to figure out why my app settings were not reloading. My class has properties for each setting:
public bool IsSensorListVisible
{
get { return _IsSensorListVisible; }
set
{
if (_IsSensorListVisible != value)
{
_IsSensorListVisible = value;**save();** } }
}
.
.
.Notice the call to Save?? So the CTOR calls Load, which sets each property, which then calls Save... DOH!!!
If it's not broken, fix it until it is
This is the very first thing a junior programmer is smacked over the head with -- do not have hidden functionality ESPECIALLY IN PROPERTY SETTERS *Smack* Marc
Imperative to Functional Programming Succinctly Contributors Wanted for Higher Order Programming Project!
-
So I posted a question in the C# forum trying to figure out why my app settings were not reloading. My class has properties for each setting:
public bool IsSensorListVisible
{
get { return _IsSensorListVisible; }
set
{
if (_IsSensorListVisible != value)
{
_IsSensorListVisible = value;**save();** } }
}
.
.
.Notice the call to Save?? So the CTOR calls Load, which sets each property, which then calls Save... DOH!!!
If it's not broken, fix it until it is
-
This is the very first thing a junior programmer is smacked over the head with -- do not have hidden functionality ESPECIALLY IN PROPERTY SETTERS *Smack* Marc
Imperative to Functional Programming Succinctly Contributors Wanted for Higher Order Programming Project!
I'm still dealing with code like that which was written by a very senior programmer who is no longer here. GRRRRRRRRRRRRRRR X| :mad: X| :mad: X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| &
-
I'm still dealing with code like that which was written by a very senior programmer who is no longer here. GRRRRRRRRRRRRRRR X| :mad: X| :mad: X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| &
-
Yeah, it must've. I copied it from someone else. :-O
#SupportHeForShe
If your actions inspire others to dream more, learn more, do more and become more, you are a leader.-John Q. Adams You must accept 1 of 2 basic premises: Either we are alone in the universe or we are not alone. Either way, the implications are staggering!-Wernher von Braun Only 2 things are infinite, the universe and human stupidity, and I'm not sure about the former.-Albert Einstein
-
Yeah, it must've. I copied it from someone else. :-O
#SupportHeForShe
If your actions inspire others to dream more, learn more, do more and become more, you are a leader.-John Q. Adams You must accept 1 of 2 basic premises: Either we are alone in the universe or we are not alone. Either way, the implications are staggering!-Wernher von Braun Only 2 things are infinite, the universe and human stupidity, and I'm not sure about the former.-Albert Einstein
-
I call it object-reuse! ;P
#SupportHeForShe
If your actions inspire others to dream more, learn more, do more and become more, you are a leader.-John Q. Adams You must accept 1 of 2 basic premises: Either we are alone in the universe or we are not alone. Either way, the implications are staggering!-Wernher von Braun Only 2 things are infinite, the universe and human stupidity, and I'm not sure about the former.-Albert Einstein
-
I call it object-reuse! ;P
#SupportHeForShe
If your actions inspire others to dream more, learn more, do more and become more, you are a leader.-John Q. Adams You must accept 1 of 2 basic premises: Either we are alone in the universe or we are not alone. Either way, the implications are staggering!-Wernher von Braun Only 2 things are infinite, the universe and human stupidity, and I'm not sure about the former.-Albert Einstein
-
That's just copy & paste, i.e. code duplication. Object reuse would have been to link to the post containing this "picture". ;P
The good thing about pessimism is, that you are always either right or pleasently surprised.
It's a subclass, actually. Mine is slightly different. ;P
#SupportHeForShe
If your actions inspire others to dream more, learn more, do more and become more, you are a leader.-John Q. Adams You must accept 1 of 2 basic premises: Either we are alone in the universe or we are not alone. Either way, the implications are staggering!-Wernher von Braun Only 2 things are infinite, the universe and human stupidity, and I'm not sure about the former.-Albert Einstein