- Feature Articles
- CodeSOD
- Error'd
- Forums
-
Other Articles
- Random Article
- Other Series
- Alex's Soapbox
- Announcements
- Best of…
- Best of Email
- Best of the Sidebar
- Bring Your Own Code
- Coded Smorgasbord
- Mandatory Fun Day
- Off Topic
- Representative Line
- News Roundup
- Editor's Soapbox
- Software on the Rocks
- Souvenir Potpourri
- Sponsor Post
- Tales from the Interview
- The Daily WTF: Live
- Virtudyne
Admin
<FONT face=Arial>Nice...</FONT>
Admin
LOL
That is a good one!
Admin
And while we're picking on the VS Tools for Office, following is the code required to call Excel's Dialog Show from C# ...
Admin
n1 roflskates
Admin
Burger King fan?
Buried inside of a large ACH validation routine, Stefanie found this line ...
Alex forgot to mention that Stefanie was brought in to figure out why their server was constantly beeping at odd intervals ;-P
The following variable names (submitted by A and O, respectively) are best enjoyed with a maturity age of fourteen years or less ...
All an essential part of the PrisonCellMate class ;-)
<p>
Matt Spicer understands that this following function is called like "EnableDisable(true);" but still wondered exactly what would happen ...
Actually, after trying to find something funny to say about this function, it becomes quite obvious what it does.
The function doesn't return a value, and the parameter is not a boolean. Therefore, we can assume that the value
passed is what we want to be done. The name of the parameter is Enable. So, if Enable is true, it enables the
controls. If it is false, it disables it.
Admin
If the above is supposed to be written in Java, then it should be String, not string.
Admin
public class haveit {}
haveit yourway;
Admin
I've done stuff like this in a lot of programs. It's obviously there for debugging, and probably he set a breakpoint on syscall_beep(). There obviously was a problem with thing 892, and in an effort to debug, and not have to trace through the previous 891 things, you put in a line of code with no effect, inside of an if, and break on it.
<obligatory>The real WTF is that they forgot to take it out.</obligatory>Admin
>if(xlApp.Dialogs[Excel.XlBuiltInDialog.xlDialogOpen].Show(sTextName,
> Type.Missing
NOW do we understand why optional params are a bad idea?? Over f'ing load the method, people, I think even VB.NET can handle that. Suppose this was just a COM wrapper though...
Admin
While it may have the wrong case there for Java, it is, in fact, perfectly correct C++.
Admin
..... assuming that string was defined as a type.... otherwise all fingers point to C# ;-)
Admin
Best. Line of code. Ever.
Admin
One of my favorite pieces of code that is similar to this is in the system at my company. Written by yours truly, it looks a little something like this:
<font face="Courier New" size="2">Assessment ass = </font><font color="#0000ff" face="Courier New" size="2">new </font><font face="Courier New" size="2">Assessment(...);
...
</font><font color="#0000ff" face="Courier New" size="2">if</font><font face="Courier New" size="2">(ass.Dirty)
{
...
}</font>
Admin
I swear, I would have used a pipe delimiter and an x variable for the smooch.
ass = ass.Split('|')[x]
Admin
I like to come up with creative sub-classes of exception so that I can write things like
<font face="Courier New">catch(BranchOperationRequiredException bare)
and
catch(DuplicateOperationPreventedException dope)
</font>
Admin
God is real, unless declared integer.
Captcha: Pizza. And I just finished my lunch ...
Admin
public class Winston
{
public static final int TWO_PLUS_TWO = 5;
}
In all fairness, I see "cum" used as an abbreviation for "cumulative" rather often. I guess I just tune it out after a while. Though I personally have a strict policy of avoiding abbrevations as much as possible, except for very common ones like "XML".
Admin
Or the ever popular:
Admin
Yeah, COM is that chunk of Win16 that stubbornly refuses to die, giving up a steady stream of WTF from 1992 to present.
On a vague tangent, I really wish I could find a compiler/preprocessor that supported named arguments in C, C++, C#, or Java. Everytime I touch win32 code after a month or two elsewhere I come back and end up clueless as to what arguments are doing, especially surrounded by a random number of NULLs.
Admin
or maybe:
catch(PriceUnitHolderSelectionException puhse)
Admin
Several years ago, we worked on a system that wreaked of buzzword bingo. We had to add a new db table to hold transaction log records, locally called record-of-diary, but all the good acronyms (relevant to the system) were already used. My boss, in a fit of frustration, told the dba to just name the table 'asshole'. He did. Two days later, we started getting nasty e-mails from the operations group complaining about log entries that looked like this:
inserting ROD into asshole ...
*sigh*
Admin
That's real by the way :)
Admin
I get the abbreviation with initials, but what else does puhse stand for?
Admin
This is simply a toggle ... no WTF there, except to name it 'private void ToggleControl'
Admin
Two syllables...pronounce it.
Admin
A cat
Admin
What a whopper that is!
This cracks me up! ;)
Admin
Man, I gotta start thinking with multiple syllables? It's Friday for God sakes!
Admin
I guess we know where that guy is going to be working
Admin
the real WTF then is that they're not using a debugger with conditional f-breakpoints! come on, this technology has been in debuggers for at least the last ten years...
Admin
Ah, score one for VB.Net, which supports optional arguments.
Take that, C# !!!
Admin
i've seen the MetaData Mapping Application and the Load Save Delete module... a blast when combined.
Admin
I've come up with a sweet alternative to privatizing the constructor in a class with static object creation methods.
<font face="Courier New">public class Monkey
{
public Monkey()
{
PrivateObjectOperationPreventedException poope = new </font><font face="Courier New">PrivateObjectOperationPreventedException("akk akk akk");
throw poope;
</font><font face="Courier New"> }
}
</font>
Admin
Mix it up with the Public Collaborative Presentation layer, and you will give the user the belief that they can do just about anything.
Admin
This is actually fairly easy to do within the C++, C#, and Java languages. Stroustrup gave an example in The Design and Evolution of C++, showing that named arguments weren't necessary.
The solution is to introduce a new type with methods which return itself. For C++:
Usage thus becomes:
This pattern is readily extended to C# and Java.
Admin
dont forget this one:
assOLE = chop($ass)
Admin
>if(xlApp.Dialogs[Excel.XlBuiltInDialog.xlDialogOpen].Show(sTextName,
> Type.Missing
> NOW do we understand why optional params are a bad idea?? Over f'ing load the method, people, I think even VB.NET can handle that. Suppose this was just a COM wrapper though...
Lets see, I can either have 2^30 overloads to account for all the cases or I can just make one function with optionals. I think I'll stick with optionals for awhile longer.
Admin
Alas, VS2005 cannot support conditional breakpoints in C# however!
Admin
3
Right, it's there and completely unusable - just set a conditional breakpoint somewhere to enjoy 10x decrease in performance. Unconditional breakpoint inside an if operator behaves much better (I'm talking about Visual Studio up to 2005, I haven't tried that one; and C++ code - I haven't touched C# for a long time but as far as I remember it was the same story)
Admin
You don't get puhse? I guess if you don't understand what it is you never will. Oh well, more for me I guess.
Captcha: batman. A man that probably understands the meaning of puhse very well.
Admin
"public class" is not valid C++. So it's neither valid Java nor C++. Hoax?
Admin
There's no problem with optional params. The real WTF lies in the fact that C# can't freaking handle optional params.
A bit of a nitpick, but string is defined as a type if you're using the STL.
captcha: chocobot - Should be chocobo :)
Admin
It is perfectly valid c# though.
Admin
OK, let's see;
Two syllables: puh-se
- puh, as in Winne the Pooh?
- se, as in Standard Edition?
Pronounced: [pu:se]Not funny at all.
Admin
When I first read it, I read it aloud with a long 'u', silent 'h', soft 's' and silent 'e' - sorta like 'piews' - had no clue - been a long f*g week - tgif! Gotta go home to wife/kids and not get me some.
Admin
A better name might be:
catch (ProblemUndoingShortSaleYesterday pussy)
Admin
The worst (?) one I ever saw was from this person who was extremely intelligent, who created a project acronym that, for obvious reasons, never got used:
Common Library Internals Tying Original Real Income Server
Admin
If I caught more of that type of exception in college, I might not be a programmer today. It's a pretty rare scenario for most coders.
Admin
Beautifully unambiguous.
When asked for a project estimate, I tell folks that I use the Millenial Year Application Software System to pull my numbers from.
Admin
Ah, I love "solutions" that will probably work 99% of the time but if you shift to exactly the wrong compiler will break...
I'm not sure how I like this to be honest. It's certainly an imaginitive way to call a conceptually static function. (You could always do (static_cast<COrderSummary*> NULL)->XMLParse(someXMLString)...)