Click here to Skip to main content
15,885,141 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
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 
You are overthinking this.

First - it is script-like. The C++ was just a posting choice for formatting - apparently a poor choice on my part as many others also though I meant in the C++ context.

Second - this was really a question on preferences. Aside from your disassembly, the clear difference is one would (as written) always MOVe a value and the other only conditionally - both doing the same conditional test. The question is, for most applications, which would you rather see - in your own code and someone else's your stuck looking at.

The script style of the function, very PHP-like, was to illustrate the function declaration and content all in one small location. In a PHP script roughly like this it acts in a similar manner to a C++ function overload (one with an arg, one without).

On the other hand, I appreciate your thoughts and dis-assembly. I've not disassembled code ( once upon a time I had a x86 commenting disassembler) in a very many years.

Ravings en masse^
"The difference between genius and stupidity is that genius has its limits." - Albert Einstein
"If you are searching for perfection in others, then you seek disappointment. If you seek perfection in yourself, then you will find failure." - Balboos HaGadol Mar 2010

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 
GeneralRe: Cosmetic vs More Efficient Pin
Gerry Schmitz7-May-21 14:01
mveGerry Schmitz7-May-21 14:01 
GeneralMay the 4th be with you. Pin
AnotherKen4-May-21 5:38
professionalAnotherKen4-May-21 5:38 
GeneralRe: May the 4th be with you. Pin
OriginalGriff4-May-21 6:04
mveOriginalGriff4-May-21 6:04 
GeneralRe: May the 4th be with you. Pin
The Other John Ingram4-May-21 19:41
The Other John Ingram4-May-21 19:41 
GeneralRe: May the 4th be with you. Pin
jeron15-May-21 7:40
jeron15-May-21 7:40 
GeneralThought of the Day Pin
OriginalGriff4-May-21 4:31
mveOriginalGriff4-May-21 4:31 
GeneralRe: Thought of the Day Pin
W Balboos, GHB4-May-21 6:32
W Balboos, GHB4-May-21 6:32 
GeneralRe: Thought of the Day Pin
Daniel Pfeffer4-May-21 7:37
professionalDaniel Pfeffer4-May-21 7:37 
GeneralRe: Thought of the Day Pin
AnotherKen4-May-21 8:02
professionalAnotherKen4-May-21 8:02 
GeneralRe: Thought of the Day Pin
DRHuff4-May-21 8:44
DRHuff4-May-21 8:44 
JokeDid you hear about this new restaurant called Karma? PinPopular
Johnny J.4-May-21 0:34
professionalJohnny J.4-May-21 0:34 
GeneralRe: Did you hear about this new restaurant called Karma? Pin
OriginalGriff4-May-21 0:54
mveOriginalGriff4-May-21 0:54 
GeneralRe: Did you hear about this new restaurant called Karma? PinPopular
rnbergren4-May-21 0:58
rnbergren4-May-21 0:58 

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.