- 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
Any method that takes more than five or six parameters at most is a WTF in itself.
Admin
on langs with hash/dictionarys you can pass a array of parameters
DrawString($string,array("color"=>"red","family"=>"sans","bold"=>true));
has VBA dictionarys?
Admin
Just an idea - try tiling the application and debuger's windows - this way Invalidate (I hope by Invalidate you mean receiving WM_PAINT and friends) won't happen. This will not solve all your problems but it may help from time to time
Admin
That's pretty exaggerated. But I'll agree that if you find yourself writing a method with more than half a dozen parameters it's time to stop for a few minutes and ask yourself whether you are in fact using the best approach.
Admin
How 'Front End' of you. The clue is that it was a server process.
Admin
I meant the guy who commented on the beep thing - why didn't you just put a break line in the debugger. Hell Sonny - when you grow into writing some real programs you will realise that not everything happens on your freaking desktop.
Bleeping and wtiting things to debug logs is alive and well in child process land.
Admin
For i = 1 To CumRate
cnn.Execute ("INSERT ROD INTO asshole")
Next i
Admin
And here's another variation -- in Fortran 90 -- of this from Richard Shaw ...
It must be in base 21.145591083961146480807893875815!
Admin
static variables are instance variables! Windows is Linux! Oceania has always been at war with Iraq...
Admin
Language of origin? Can you use it in a sentence please?
let me try. "PEW" + hhhhh + "seh".
While we're at it, how do YOU Pronounce WHQL?
Admin
Ohh, thanks for the "explanation". Maybe if catching that wasn't such an exceptional condition...
Admin
Optional parameters are actually a good idea... when they are optional for real. These are not optional parameters in my book, since it's required to include them in your funcall.
I don't know if it's usable yet, but the Nice language (that runs on a JVM and -- i'm pretty sure -- is a superset of vanilla Java) has things like named and optional (default) parameters.
It also has first-class functions (and anonymous functions), tuples and tuples unpacking, closures, nullable types, type inference, a much better type system (the NPE and ClassCastException are supposedly absent from any Nice program) and some other stuff.
And it run on a 1.2 JVM
Hardly necessary, but awfully nice, and much easier to use (both as the creator of methods and as the user of the aforementioned methods) than that kind of boilerplate.
Hell, even Ruby's lets-use-our-bizarro-hash-syntax-to-emulate-named-parameters is better (thank god it should be replaced by real named parameters in Ruby2 though)
With 5 times more boilerplate...
Admin
Followup of
Soustrup's method also limits the programming styles you can use as it forbids functional-style programming for example (put arguments in, get results out) and forbits any kind of useful return, as you unconditionally have to return a reference to your object for the chain to work.
Admin
Aha. I did misinterpret your comment. I thought you were saying C# has no support for optional arguments, which it does. Not being a VB developer, i did not realise it had that feature. My guess is that the compiler adds in empty values, because they appear to be required in the intermediate language, and thus C#. A very handy shortcut for ridiculously long argument lists.
Thanks for explaining your comment. It makes a lot more sense now.
Admin
"I thought you were saying C# has no support for optional arguments, which it does."
Just to clarify, i meant arguments can be made optional by overloading methods, which is not what BradC described.
Admin
Just a side note... although that's pretty horrific code, it's technically valid and will run fine as long COrderSummary has no virtual methods declared. The class would have no vtable, and hence,
obj
will not be dereferenced at runtime. This example would make a devious interview question.