Click here to Skip to main content
15,884,353 members

Welcome to the Lounge

   

For discussing anything related to a software developer's life but is not for programming questions. Got a programming question?

The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.

 
GeneralRe: Cosmetic vs More Efficient Pin
W Balboos, GHB5-May-21 1:20
W Balboos, GHB5-May-21 1:20 
GeneralRe: Cosmetic vs More Efficient Pin
Greg Utas4-May-21 10:01
professionalGreg Utas4-May-21 10:01 
GeneralRe: Cosmetic vs More Efficient Pin
W Balboos, GHB5-May-21 1:09
W Balboos, GHB5-May-21 1:09 
GeneralRe: Cosmetic vs More Efficient Pin
Greg Utas5-May-21 1:17
professionalGreg Utas5-May-21 1:17 
GeneralRe: Cosmetic vs More Efficient Pin
PIEBALDconsult4-May-21 11:04
mvePIEBALDconsult4-May-21 11:04 
GeneralRe: Cosmetic vs More Efficient Pin
obermd4-May-21 18:48
obermd4-May-21 18:48 
GeneralRe: Cosmetic vs More Efficient Pin
Peter Adam4-May-21 22:07
professionalPeter Adam4-May-21 22:07 
GeneralRe: Cosmetic vs More Efficient Pin
BernardIE53174-May-21 23:09
BernardIE53174-May-21 23:09 
I prefer
if(inVal==NULL) inVal = internalDefault;

Why waste a line of screen space. It's easy enough to read.
Though I actually prefer the declaration assign the argument w/ the valid default value as in
return_type whatEver(arg_type inVal=internalDefault);

I simply do not understand the logic of assigning a value to an argument only to immediately discard and replace it. I would be happy to learn of same.
Incidentally I learned from a previous post or article I don't recall which to write e.g.
void foobar(int arg)
{
	if(arg != valid_value) return;
	// remainder of function performs logic for valid argument
}

C++
instead of
void foobar(int arg)
{
	if(arg == valid_value)
	{
		// block performs logic for valid argument
	}
}

so as to minimize the number of indented blocks even though in previous times I preferred minimizing the number of return statements. I find minimizing the number of indented blocks to be easier to understand. - Cheerios
GeneralRe: Cosmetic vs More Efficient Pin
jsc424-May-21 23:31
professionaljsc424-May-21 23:31 
GeneralRe: Cosmetic vs More Efficient Pin
Gary Wheeler5-May-21 1:58
Gary Wheeler5-May-21 1:58 
GeneralRe: Cosmetic vs More Efficient Pin
W Balboos, GHB5-May-21 2:37
W Balboos, GHB5-May-21 2:37 
GeneralRe: Cosmetic vs More Efficient Pin
KateAshman5-May-21 2:27
KateAshman5-May-21 2:27 
GeneralRe: Cosmetic vs More Efficient Pin
W Balboos, GHB5-May-21 2:34
W Balboos, GHB5-May-21 2:34 
GeneralRe: Cosmetic vs More Efficient Pin
KateAshman7-May-21 4:25
KateAshman7-May-21 4:25 
GeneralRe: Cosmetic vs More Efficient Pin
Steve Naidamast5-May-21 4:19
professionalSteve Naidamast5-May-21 4:19 
GeneralRe: Cosmetic vs More Efficient Pin
W Balboos, GHB5-May-21 5:21
W Balboos, GHB5-May-21 5:21 
GeneralRe: Cosmetic vs More Efficient Pin
Al Gonzalez5-May-21 5:32
Al Gonzalez5-May-21 5:32 
GeneralRe: Cosmetic vs More Efficient Pin
SeattleC++5-May-21 5:57
SeattleC++5-May-21 5:57 
GeneralRe: Cosmetic vs More Efficient Pin
JP Reyes5-May-21 6:35
JP Reyes5-May-21 6:35 
GeneralRe: Cosmetic vs More Efficient Pin
Zuoliu Ding5-May-21 8:08
Zuoliu Ding5-May-21 8:08 
GeneralRe: Cosmetic vs More Efficient Pin
W Balboos, GHB5-May-21 8:33
W Balboos, GHB5-May-21 8:33 
GeneralRe: Cosmetic vs More Efficient Pin
Zuoliu Ding5-May-21 8:44
Zuoliu Ding5-May-21 8:44 
GeneralRe: Cosmetic vs More Efficient Pin
Myron Dombrowski5-May-21 19:43
Myron Dombrowski5-May-21 19:43 
GeneralRe: Cosmetic vs More Efficient Pin
W Balboos, GHB6-May-21 1:44
W Balboos, GHB6-May-21 1:44 
GeneralRe: Cosmetic vs More Efficient Pin
Eddy Vluggen6-May-21 9:10
professionalEddy Vluggen6-May-21 9:10 

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.