|
So....what exactly is wrong with that?
|
|
|
|
|
Did you check that the Text property Getter didn't make changes to the underlying data and so make that a valid statement.
e.g.
private string _text;
public string Text
{
Get{
if (_text == null)
{
_text = "Empty";
return _text;
}
if (_text == "Empty")
_text = "";
return _text;
}
}
MVVM # - I did it My Way
___________________________________________
Man, you're a god. - walterhevedeich 26/05/2011
.\\axxx
(That's an 'M')
modified 9-Oct-13 2:33am.
|
|
|
|
|
_Maxxx_ wrote: if (_text = "Empty")
_text = "";
This will be always be true no matter what _text is except for F# but there the if else operation contains then
Microsoft ... the only place where VARIANT_TRUE != true
|
|
|
|
|
Thanks for the human compiler - I've fixed it.
MVVM # - I did it My Way
___________________________________________
Man, you're a god. - walterhevedeich 26/05/2011
.\\axxx
(That's an 'M')
|
|
|
|
|
No it won't. It wouldn't compile...
|
|
|
|
|
It depends on the compiler and the language you are writing in. In c++ it will compile and run and you will be looking for a bug
Microsoft ... the only place where VARIANT_TRUE != true
|
|
|
|
|
AnalogNerd wrote: if ((tbRoute.Text != "") && (tbRoute.Text != "") && (tbRoute.Text != "")) {
Third time is the charm
|
|
|
|
|
I've unintentionally had that happen after some refactoring. A couple text boxes contained values, and were later converted to a single box. Refactoring the name of the second to be the same as the first created the circumstance found here.
Of course, that situation only lasted for a little while, since I did check all the references to make sure nothing too stupid happened...
Software Zen: delete this;
|
|
|
|
|
At least give the guy credit for ensuring that no variable leaves empty-handed.
|
|
|
|
|
Somebody knows the "Tell me 3 times and it must be true" rule (see Heinlein's "Number of the Beast")
|
|
|
|
|
This post is about dates and certificates.
On the 7th of October, 2013 I needed to install the September update of SQL Server 2012 Data Tools (I'll be using the acronym SSDT further). Imagine how surprized I was when after attempting to download something the installer failed claiming that the reason for the failure is a wrong certificate which is already out of a valid date range. I tried to google some solution, but the only thing that I found is a post from some guy which had the same problem.
After some thinking I have come to the solution (just taste it): in order to install the stuff you have to correct a date on your PC to something close to the release date of that update! I used September, 20th. Wonderful, isn't it?
Was it way too hard for the Microsoft guys to just ensure their certificate doesn't expire before they release another update?
lifecycle of a lifecycle of a lifecycle
|
|
|
|
|
When I started working in my current position four years ago, I inherited a system full of bugs and was given the task to iron out all of the bugs.
The first step i though would be to turn on the logger and try to find out where and when the crashes happen.
I turned on the logger and after a few minutes...
BIG MISTAKE!
My system crashed.
It took me 2 days to re-install everything, and turn on the logger again.
and it happened again.
The next time i was smarter, and ghosted my disk.
I also finally found the correct source code version (which was hidden among multiple copies of various
versions and test made by the person), and run it through a debugger.
and then i found out this little beauty:
public void errorCatcher(string msg)
{
RegistryKey key = Registry.CurrentUser.OpenSubKey(KEY_NAME_START + @"\errors", true);
if (key != null)
{
key.SetValue(DateTime.Now.ToString(), msg);
key.Close();
}
}
and every method in the system had the same reference in it's catch clause:
catch (Exception exception)
{
errorCatcher(exception.ToString());
return "";
}
I took me two weeks to rewrite the whole thing, throw away 90% of the code, and roll out a bug free system.
(I still keep the original code as proof, as no one believes me when i tell people about it.)
|
|
|
|
|
Elephant me!
A registry logger? And people wonder why it's getting harder and harder to access it...
The only instant messaging I do involves my middle finger.
|
|
|
|
|
From that day on, whenever i need to get into this person code, i start pounding my head on the wall (literally) and swear.
My boss then calls from the next office: "is it ###### code again?"
|
|
|
|
|
I take it the person in question has departed the company?
The only instant messaging I do involves my middle finger.
|
|
|
|
|
Obviously.
Unfortunately he had enough time to wreck havoc in the company code base.
|
|
|
|
|
Guy Lavi wrote: Obviously.
Because you aren't on remand awaiting a murder trial?
The only instant messaging I do involves my middle finger.
|
|
|
|
|
Exactly!
|
|
|
|
|
I thought, if the person was still there, he would be banging this person's head against the wall instead of his own.
The good thing about pessimism is, that you are always either right or pleasently surprised.
|
|
|
|
|
OriginalGriff wrote: A registry logger? I could top that, believe it or not, if it wasn't for the non disclosure agreement of one of my former employers.
|
|
|
|
|
You made it up!!!
It can't be.
If it's true it can be easily will a gold medal.
I can't understand why such a creative people was send on his way. Company's greatest lost...
I'm not questioning your powers of observation; I'm merely remarking upon the paradox of asking a masked man who he is (V).
|
|
|
|
|
This is "the pearl".
His code contains many more of these gems.
|
|
|
|
|
|
I can imagine a few situations in which this could actually make sense. But of course, it is not meant to be permanently turned on, especially if a lot of exceptions are caught.
~RaGE();
I think words like 'destiny' are a way of trying to find order where none exists. - Christian Graus
Do not feed the troll ! - Common proverb
|
|
|
|
|