Click here to Skip to main content
15,906,816 members

Survey Results

Are optional parameters for methods good or bad?   [Edit]

Survey period: 28 Feb 2005 to 6 Mar 2005

C++ has them, C# doesn't. Overall, what's your preference?

OptionVotes% 
Good84865.48
Bad28722.16
Undecided16012.36



 
GeneralA proposal that (I think) would make everyone happy Pin
Don Clugston6-Mar-05 15:51
Don Clugston6-Mar-05 15:51 
GeneralRe: A proposal that (I think) would make everyone happy Pin
Michael Flanakin10-Mar-05 11:25
Michael Flanakin10-Mar-05 11:25 
GeneralDepends on the language... Pin
Jeremy Falcon6-Mar-05 4:55
professionalJeremy Falcon6-Mar-05 4:55 
GeneralThere should be no parararmeters Pin
Anonymous3-Mar-05 18:00
Anonymous3-Mar-05 18:00 
GeneralDefaults promote bad design Pin
Peter Ritchie3-Mar-05 15:35
Peter Ritchie3-Mar-05 15:35 
GeneralNone is best! Pin
Bob Stanneveld28-Feb-05 20:39
Bob Stanneveld28-Feb-05 20:39 
GeneralRe: None is best! Pin
netclectic28-Feb-05 23:38
netclectic28-Feb-05 23:38 
GeneralRe: None is best! Pin
Nemanja Trifunovic1-Mar-05 2:56
Nemanja Trifunovic1-Mar-05 2:56 
GeneralRe: None is best! Pin
tom_dx1-Mar-05 1:58
tom_dx1-Mar-05 1:58 
GeneralRe: None is best! Pin
Bob Stanneveld1-Mar-05 3:29
Bob Stanneveld1-Mar-05 3:29 
If you design your methods, classes and libraries like that, I suggest that you follow a workshop or 2!

I design my applications and such as flexible as possible! I hardcode almost nothing. I even put all the strings on my GUI in a string table in a seperate DLL, even if the application is only in one language.

My major language is C++ and I have worked on a DX project with a friend of mine. After the design phase, we thought that we had a sound design, but after getting to know DX we redesigned the whole program, just to be able to create a reusable DX library for follow-ups...

Now I ask you, if you have your method painting the background red and after you decide that blue is also nice to have, you overload the method. Now you start thinking that yellow, purple and green are possible backgrounds you want. Are you going to overload the method another 3 times or do you slam yourself that you didn't design the method to be flexible in the first place?

That is a typical thing why a lot of old school DX programmers write spaghetti code. They use globals where they can and hardcode the as much as they can just to save a CPU cylce or 2. I prefer less optimal code and more flexible and maintainable code because the only bottleneck nowdays is the graphics card...

I hope that this gives you a view about my way of designing and programming.

P.S.
The way I let DX know which window handle to use is to pass the window handle as the FIRST parameter in every method that might need a window handle...
GeneralRe: None is best! Pin
Anonymous3-Mar-05 14:09
Anonymous3-Mar-05 14:09 
GeneralRe: None is best! Pin
tom_dx3-Mar-05 14:10
tom_dx3-Mar-05 14:10 
Generalpowerful feature Pin
Member 129322928-Feb-05 19:20
Member 129322928-Feb-05 19:20 
GeneralAn alternative! Pin
Eddie de Bear28-Feb-05 17:11
Eddie de Bear28-Feb-05 17:11 
GeneralRe: An alternative! Pin
Bob Stanneveld28-Feb-05 20:30
Bob Stanneveld28-Feb-05 20:30 
GeneralI hate them. They foul up generic code. Pin
Don Clugston28-Feb-05 13:40
Don Clugston28-Feb-05 13:40 
GeneralDepends Pin
Giancarlo Aguilera28-Feb-05 9:17
Giancarlo Aguilera28-Feb-05 9:17 
GeneralMissing classes in the model Pin
Daniel Turini28-Feb-05 8:17
Daniel Turini28-Feb-05 8:17 
GeneralOverload nitemare Pin
leppie27-Feb-05 19:57
leppie27-Feb-05 19:57 
GeneralRe: Overload nitemare Pin
WillemM27-Feb-05 20:01
WillemM27-Feb-05 20:01 
GeneralRe: Overload nitemare Pin
Corneliu Tusnea27-Feb-05 22:07
Corneliu Tusnea27-Feb-05 22:07 
GeneralRe: Overload nitemare Pin
WoR27-Feb-05 23:36
WoR27-Feb-05 23:36 
GeneralRe: Overload nitemare Pin
paulccc28-Feb-05 0:59
paulccc28-Feb-05 0:59 
GeneralRe: Overload nitemare Pin
Chris Meech28-Feb-05 1:46
Chris Meech28-Feb-05 1:46 
GeneralRe: Overload nitemare Pin
Blake Miller28-Feb-05 5:13
Blake Miller28-Feb-05 5:13 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.