Click here to Skip to main content
15,894,955 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: Which do you prefer? A programming question! Pin
Reelix2-Jul-21 5:35
Reelix2-Jul-21 5:35 
GeneralRe: Which do you prefer? A programming question! Pin
sasadler2-Jul-21 6:20
sasadler2-Jul-21 6:20 
GeneralRe: Which do you prefer? A programming question! Pin
charlieg2-Jul-21 11:49
charlieg2-Jul-21 11:49 
GeneralRe: Which do you prefer? A programming question! Pin
r_hyde2-Jul-21 12:05
r_hyde2-Jul-21 12:05 
GeneralRe: Which do you prefer? A programming question! Pin
Gerry Schmitz2-Jul-21 19:11
mveGerry Schmitz2-Jul-21 19:11 
GeneralRe: Which do you prefer? A programming question! Pin
Martin ISDN3-Jul-21 3:19
Martin ISDN3-Jul-21 3:19 
GeneralRe: Which do you prefer? A programming question! Pin
AnotherKen3-Jul-21 17:55
professionalAnotherKen3-Jul-21 17:55 
GeneralRe: Which do you prefer? A programming question! Pin
rjmoses4-Jul-21 0:40
professionalrjmoses4-Jul-21 0:40 
It depends!

1) If the section of code is executed frequently, then #2 adds the cpu overhead of the call/return therefore slowing the program down.

2) If the DoSomething code is relatively simple and is only used in this one location, then it should be coded in place in order to make readability, understandability and comprehension better.

3) If the Dosomething code is frequently used code, then #1 makes it clearer when something is done.

The answer to this question is a choice of balancing performance vs readability vs understandability vs comprehension.

To me, code should always be written such that I or anyone else can comprehend the intent and methodology of the original programmer in a few seconds.
GeneralRe: Which do you prefer? A programming question! Pin
Member 140926054-Jul-21 23:52
Member 140926054-Jul-21 23:52 
GeneralRe: Which do you prefer? A programming question! Pin
PSU Steve6-Jul-21 3:26
professionalPSU Steve6-Jul-21 3:26 
GeneralThought of the Day Pin
OriginalGriff1-Jul-21 4:38
mveOriginalGriff1-Jul-21 4:38 
GeneralRe: Thought of the Day Pin
k50541-Jul-21 4:53
mvek50541-Jul-21 4:53 
GeneralRe: Thought of the Day Pin
DRHuff1-Jul-21 5:03
DRHuff1-Jul-21 5:03 
GeneralRe: Thought of the Day Pin
Mike Hankey1-Jul-21 5:08
mveMike Hankey1-Jul-21 5:08 
GeneralRe: Thought of the Day Pin
W Balboos, GHB1-Jul-21 5:10
W Balboos, GHB1-Jul-21 5:10 
AnswerRe: Thought of the Day Pin
SeeSharp21-Jul-21 5:11
SeeSharp21-Jul-21 5:11 
GeneralRe: Thought of the Day Pin
W Balboos, GHB1-Jul-21 5:16
W Balboos, GHB1-Jul-21 5:16 
GeneralRe: Thought of the Day Pin
Daniel Pfeffer1-Jul-21 5:51
professionalDaniel Pfeffer1-Jul-21 5:51 
GeneralRe: Thought of the Day Pin
PIEBALDconsult1-Jul-21 5:53
mvePIEBALDconsult1-Jul-21 5:53 
GeneralRe: Thought of the Day Pin
FreedMalloc1-Jul-21 6:05
FreedMalloc1-Jul-21 6:05 
GeneralRe: Thought of the Day Pin
jeron11-Jul-21 6:16
jeron11-Jul-21 6:16 
GeneralRe: Thought of the Day Pin
rnbergren1-Jul-21 9:46
rnbergren1-Jul-21 9:46 
GeneralRe: Thought of the Day Pin
CodeWomble1-Jul-21 12:12
CodeWomble1-Jul-21 12:12 
GeneralRe: Thought of the Day Pin
Slow Eddie2-Jul-21 9:52
professionalSlow Eddie2-Jul-21 9:52 
GeneralSo I am a developer now (At last!) PinPopular
Cp-Coder1-Jul-21 4:38
Cp-Coder1-Jul-21 4:38 

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.