| « Prev | Page 1 | Page 2 | Page 3 | Next » |
Nice... |
LOL That is a good one! |
|
And while we're picking on the VS Tools for Office, following is the code required to call Excel's Dialog Show from C# ...
if(xlApp.Dialogs[Excel.XlBuiltInDialog.xlDialogOpen].Show(sTextName, Welcome to Office Interop for .NET. This joyous thing is in .NET 2003, too. 'M I first? |
Re: Another Friday Smorgasbord
2006-07-14 13:52
•
by
NiggerFromNiger
|
|
n1 roflskates
|
Burger King fan?
Alex forgot to mention that Stefanie was brought in to figure out why their server was constantly beeping at odd intervals ;-P
|
If the above is supposed to be written in Java, then it should be String, not string. |
|
public class haveit {}
haveit yourway; |
<obligatory>The real WTF is that they forgot to take it out.</obligatory> |
|
>if(xlApp.Dialogs[Excel.XlBuiltInDialog.xlDialogOpen].Show(sTextName, 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... |
While it may have the wrong case there for Java, it is, in fact, perfectly correct C++. |
..... assuming that string was defined as a type.... otherwise all fingers point to C# ;-) |
Best. Line of code. Ever. |
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: Assessment ass = new Assessment(...); ... if(ass.Dirty) { ... } |
Re: Another Friday Smorgasbord
2006-07-14 14:19
•
by
John Bigboote
|
I swear, I would have used a pipe delimiter and an x variable for the smooch. ass = ass.Split('|')[x] |
Re: Another Friday Smorgasbord
2006-07-14 14:22
•
by
John Bigboote
|
I like to come up with creative sub-classes of exception so that I can write things like catch(BranchOperationRequiredException bare) and catch(DuplicateOperationPreventedException dope) |
Re: Another Friday Smorgasbord - char broiled
2006-07-14 14:25
•
by
Bradlegar the Hobbit
|
|
God is real, unless declared integer.
Captcha: Pizza. And I just finished my lunch ... |
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". |
Or the ever popular: catch (WhenTrueFalse wtf) {
|
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. |
Re: Another Friday Smorgasbord
2006-07-14 14:29
•
by
Matt the Greater
|
or maybe: catch(PriceUnitHolderSelectionException puhse) |
|
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* |
Re: Another Friday Smorgasbord
2006-07-14 14:32
•
by
Matt the Greater
|
That's real by the way :) |
I get the abbreviation with initials, but what else does puhse stand for? |
This is simply a toggle ... no WTF there, except to name it 'private void ToggleControl' |
Re: Another Friday Smorgasbord
2006-07-14 14:42
•
by
Philbert Desanex
|
Two syllables...pronounce it. |
A cat |
|
Man, I gotta start thinking with multiple syllables? It's Friday for God sakes! |
I guess we know where that guy is going to be working |
|
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...
|
Ah, score one for VB.Net, which supports optional arguments. Take that, C# !!! |
i've seen the MetaData Mapping Application and the Load Save Delete module... a blast when combined. |
|
I've come up with a sweet alternative to privatizing the constructor in a class with static object creation methods.
public class Monkey { public Monkey() { PrivateObjectOperationPreventedException poope = new PrivateObjectOperationPreventedException("akk akk akk"); throw poope; } } |
Re: Another Friday Smorgasbord
2006-07-14 14:59
•
by
John Bigboote
|
Mix it up with the Public Collaborative Presentation layer, and you will give the user the belief that they can do just about anything. |
Re: Another Friday Smorgasbord
2006-07-14 14:59
•
by
Jonathan Pryor
|
On a vague tangent, I really wish I could find a compiler/preprocessor 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++: class window_args { Usage thus becomes: void* p = CreateWindow ( This pattern is readily extended to C# and Java. |
dont forget this one: assOLE = chop($ass) |
Re: Another Friday Smorgasbord
2006-07-14 15:17
•
by
Jonathan Allen
|
|
>if(xlApp.Dialogs[Excel.XlBuiltInDialog.xlDialogOpen].Show(sTextName, > 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.
|
Alas, VS2005 cannot support conditional breakpoints in C# however! |
Re: Another Friday Smorgasbord
2006-07-14 15:41
•
by
SadBugKiller
|
|
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) |
|
Mark came across the Dummy16() and Dummy17() methods in the Visual Studio Tools for Office SDK and wondered, what ever happened to Dummy1() through Dummy 15() ? thats actually easy: in public API usually a few dummy() methods are put in to have room to add future API calls without changing object layout/size (vtables and stuff). So Dummy1() to Dummy15() already got replaced with some real functions that had been added to the class. |
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. |
|
"public class" is not valid C++. So it's neither valid Java nor C++. Hoax?
|
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 :) |
It is perfectly valid c# though. |
OK, let's see; Two syllables: puh-se
Not funny at all. |
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.
|
|
A better name might be: catch (ProblemUndoingShortSaleYesterday pussy) |
|
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 |
Re: Another Friday Smorgasbord
2006-07-14 16:19
•
by
John Bigboote
|
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. |
Re: Another Friday Smorgasbord
2006-07-14 16:20
•
by
Philbert Desanex
|
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. |
| « Prev | Page 1 | Page 2 | Page 3 | Next » |