Click here to Skip to main content
15,175,575 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 6:35
MemberReelix2-Jul-21 6:35 
GeneralRe: Which do you prefer? A programming question! Pin
sasadler2-Jul-21 7:20
Membersasadler2-Jul-21 7:20 
GeneralRe: Which do you prefer? A programming question! Pin
charlieg2-Jul-21 12:49
Membercharlieg2-Jul-21 12:49 
GeneralRe: Which do you prefer? A programming question! Pin
r_hyde2-Jul-21 13:05
Memberr_hyde2-Jul-21 13:05 
GeneralRe: Which do you prefer? A programming question! Pin
Gerry Schmitz2-Jul-21 20:11
mveGerry Schmitz2-Jul-21 20:11 
GeneralRe: Which do you prefer? A programming question! Pin
Martin ISDN3-Jul-21 4:19
MemberMartin ISDN3-Jul-21 4:19 
GeneralRe: Which do you prefer? A programming question! Pin
AnotherKen3-Jul-21 18:55
professionalAnotherKen3-Jul-21 18:55 
GeneralRe: Which do you prefer? A programming question! Pin
rjmoses4-Jul-21 1:40
professionalrjmoses4-Jul-21 1: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 140926055-Jul-21 0:52
MemberMember 140926055-Jul-21 0:52 
GeneralRe: Which do you prefer? A programming question! Pin
PSU Steve6-Jul-21 4:26
professionalPSU Steve6-Jul-21 4:26 
GeneralThought of the Day Pin
OriginalGriff1-Jul-21 5:38
mveOriginalGriff1-Jul-21 5:38 
GeneralRe: Thought of the Day Pin
k50541-Jul-21 5:53
mvek50541-Jul-21 5:53 
GeneralRe: Thought of the Day Pin
DRHuff1-Jul-21 6:03
MemberDRHuff1-Jul-21 6:03 
GeneralRe: Thought of the Day Pin
Mike Hankey1-Jul-21 6:08
professionalMike Hankey1-Jul-21 6:08 
GeneralRe: Thought of the Day Pin
W Balboos, GHB1-Jul-21 6:10
mveW Balboos, GHB1-Jul-21 6:10 
AnswerRe: Thought of the Day Pin
SeeSharp21-Jul-21 6:11
MemberSeeSharp21-Jul-21 6:11 
GeneralRe: Thought of the Day Pin
W Balboos, GHB1-Jul-21 6:16
mveW Balboos, GHB1-Jul-21 6:16 
GeneralRe: Thought of the Day Pin
Daniel Pfeffer1-Jul-21 6:51
professionalDaniel Pfeffer1-Jul-21 6:51 
GeneralRe: Thought of the Day Pin
PIEBALDconsult1-Jul-21 6:53
professionalPIEBALDconsult1-Jul-21 6:53 
GeneralRe: Thought of the Day Pin
FreedMalloc1-Jul-21 7:05
MemberFreedMalloc1-Jul-21 7:05 
GeneralRe: Thought of the Day Pin
jeron11-Jul-21 7:16
Memberjeron11-Jul-21 7:16 
GeneralRe: Thought of the Day Pin
rnbergren1-Jul-21 10:46
Memberrnbergren1-Jul-21 10:46 
GeneralRe: Thought of the Day Pin
Mark Tumilty1-Jul-21 13:12
MemberMark Tumilty1-Jul-21 13:12 
GeneralRe: Thought of the Day Pin
Slow Eddie2-Jul-21 10:52
professionalSlow Eddie2-Jul-21 10:52 
GeneralSo I am a developer now (At last!) Pin
Cp-Coder1-Jul-21 5:38
MemberCp-Coder1-Jul-21 5: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.