|
How ugly that code is with its inconsistent naming! Tell those poor code monkeys to clean it up:
it must be boolOrphan instead of orphan , and strMessage instead of message !
How come it they forgot half of their VB6 wisdom?
|
|
|
|
|
Hungarian Notation:
For when intellisense just seems too hard.
"There are three kinds of lies: lies, damned lies and statistics."
- Benjamin Disraeli
|
|
|
|
|
'False' Hungarian uses the prefixes to describe types. Instead, the prefixes were intended to describe the usage of the variable. Remember such things as 'lpstr', a long pinter to a string terminated by zero? Can Intellisense do that as well?
The language is JavaScript. that of Mordor, which I will not utter here
This is Javascript. If you put big wheels and a racing stripe on a golf cart, it's still a f***ing golf cart.
"I don't know, extraterrestrial?"
"You mean like from space?"
"No, from Canada."
If software development were a circus, we would all be the clowns.
|
|
|
|
|
An absolutely fair point that unfortunately does not describe the usage I see in web applications.
I apologize for maligning Hungarian Notation. I may have simply lost my mind after seeing lblLabel one too many times.
"There are three kinds of lies: lies, damned lies and statistics."
- Benjamin Disraeli
|
|
|
|
|
That's why I still like oldschool machine code. You can't do very much wrong with hexadecimal.
The language is JavaScript. that of Mordor, which I will not utter here
This is Javascript. If you put big wheels and a racing stripe on a golf cart, it's still a f***ing golf cart.
"I don't know, extraterrestrial?"
"You mean like from space?"
"No, from Canada."
If software development were a circus, we would all be the clowns.
|
|
|
|
|
if (orphan)
{
string message = "orphan detected intJobCategoryJobTypeID=" + intId.ToString();
this.state.Status = message;
}
if (orphan)
{
string message = "";
message = "orphan detected intJobCategoryJobTypeID=";
message += intId.ToString();
this.state.Status = message;
}
Of course concatenating strings is not very productive, so you could create a Stringbuilder, concatenate the pieces, create a string with the toString method and set that string to the Status variable.
Forgive the person who wrote that, he's just a padawan learner
|
|
|
|
|
A stringbuilder to concatenate two strings is overkill, you could just use string.Concat, it has the same benefits of the StringBuilder without the overhead of creating an object and without any risk that memory needs reallocated multiple times. You should only use stringbuilder if the size of the resultant text can't easily be known, or if you know you are going to do a lot of concatenation.
|
|
|
|
|
it was a quick joke, not a serious reply.
|
|
|
|
|
Code iz serius bizness!!1
|
|
|
|
|
|
Control docking and anchoring are well understood by everybody and we all know that the two techniques are mutally exclusive. The help pages says something like "Only one can be set at a time, and the last one set takes precedence".
I've always believed what I'm told by my elders and betters and was certain that code like the following would create an anchored control.
FancyControl fc = new FancyControl();
fc.Anchor = AnchorStyles.Top | AnchorStyles.Left;
SomePanel.Controls.Add(fc);
My FancyControl would typically be used fully docked and the constructor helpfully presets that condition. On the very rare occasion it should be anchored then just assign a value as shown.
Why oh why then, did the control remained dicked?
FancyControl fc = new FancyControl();
Debug.Print("Dock: {0} Anchor: {1}", fc.Dock, fc.Anchor);
fc.Anchor = AnchorStyles.Top | AnchorStyles.Left;
SomePanel.Controls.Add(fc);
On reading the Anchor property all became clear as the value was already Top|Left. Perhaps the Anchor property ignores redundant assignments? Of course it does and a delve into the published reference source confirms this. Search for DefaultLayout.SetAnchor in Reference Source[^] if you are interested.
The final solution for the simple task of setting the control's anchor property is
FancyControl fc = new FancyControl();
fc.Dock = DockStyle.None;
SomePanel.Controls.Add(fc);
OK I should have included the statement fc.Anchor = AnchorStyles.Top | AnchorStyles.Left; after undocking but it's redundant!
AlanN
aka Alan "2f hours debugging" N
|
|
|
|
|
Alan N wrote: did the control remained dicked?
Is that gender-specific control property?
Marc
|
|
|
|
|
No, having a dick does not imply gender at all these days.
#SupportHeForShe
Government can give you nothing but what it takes from somebody else. A government big enough to give you everything you want is big enough to take everything you've got, including your freedom.-Ezra Taft Benson
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
|
|
|
|
|
Anchoring is not use in WPF. Docking is used if you use a DockPanel.
|
|
|
|
|
|
Could only ever reliably be called from the WhatDoYouGetIfYouMulitply6x9() method.
|
|
|
|
|
That should throw the Call6x7MethodInstead exception.
Jeremy Falcon
|
|
|
|
|
It should immediately throw the find_question event.
"There are three kinds of lies: lies, damned lies and statistics."
- Benjamin Disraeli
|
|
|
|
|
No, it shouldn't. The event should only be thrown after 6 million years of intensive computation.
If you have an important point to make, don't try to be subtle or clever. Use a pile driver. Hit the point once. Then come back and hit it again. Then hit it a third time - a tremendous whack.
--Winston Churchill
|
|
|
|
|
I strongly suspect that the event function just contains:
stdout << "I'll have to think about it.";
Thread.Sleep(189345600000000000);
sdout << "I have it!";
"There are three kinds of lies: lies, damned lies and statistics."
- Benjamin Disraeli
|
|
|
|
|
Oh my word...[^]
O_O
What do you get when you cross a joke with a rhetorical question?
The metaphorical solid rear-end expulsions have impacted the metaphorical motorized bladed rotating air movement mechanism.
Do questions with multiple question marks annoy you???
|
|
|
|
|
|
Wtf is that? I wondered when I started up a small tool on a Windows 8 Embedded machine: most of its UI was in English (as expected, because Windows' UI is in English), but an enumeration control was in German. How can that happen? Did I forget to copy a file? No, can't be: the English texts are always compiled into the main assemblies, only translated texts make it into satellite assemblies.
I investigated the issue further. And had to see:
Current Culture: de-DE
Current UI Culture: en-US
What an odd combination! And while the ResourceManager normally uses CurrentUICulture , the EnumDescriptionConverter used CurrentCulture ...
|
|
|
|
|
It's a mess, but there's a method in the madness.
I'm using a computer with an english UI (CurrentUICulture) so that I can easier search error messages. But I still want to have Swedish format (CurrentCulture) on money, date, time, decimal comma and so on.
The fact that to few people have a clue on what's what or how to us them, is a completely different question.
|
|
|
|
|
Exactly that's the background of the mixed English/German cultures. That's the first time I was faced with such a mixture. And thus I learned to take a closer look what type of Culture to use in future: CurrentUICulture for language, CurrentCulture for formats.
|
|
|
|