Click here to Skip to main content
14,428,415 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: Ccc - you win! Pin
Member 798912210-Dec-19 7:27
MemberMember 798912210-Dec-19 7:27 
GeneralRe: Ccc - you win! Pin
Sander Rossel11-Dec-19 3:03
professionalSander Rossel11-Dec-19 3:03 
GeneralRe: Ccc - you win! Pin
musefan9-Dec-19 3:55
Membermusefan9-Dec-19 3:55 
GeneralI never knew I'd miss an operator I hate so much Pin
honey the codewitch8-Dec-19 20:57
mvahoney the codewitch8-Dec-19 20:57 
GeneralRe: I never knew I'd miss an operator I hate so much Pin
OriginalGriff8-Dec-19 21:33
communityengineerOriginalGriff8-Dec-19 21:33 
GeneralRe: I never knew I'd miss an operator I hate so much Pin
Super Lloyd9-Dec-19 0:30
MemberSuper Lloyd9-Dec-19 0:30 
GeneralRe: I never knew I'd miss an operator I hate so much Pin
honey the codewitch9-Dec-19 0:32
mvahoney the codewitch9-Dec-19 0:32 
GeneralRe: I never knew I'd miss an operator I hate so much Pin
OriginalGriff9-Dec-19 0:56
communityengineerOriginalGriff9-Dec-19 0:56 
I'll admit, I don't like that - but I see what you are doing.
It kinda depends on what Count is: if it's a field-backed property then I'd probably just use the property directly:
for(i = 0; i < list.Count; i++)
because it's a load more readable, and thus more maintainable.
If it isn't, then I'd probably split it and to heck with the scope:
int itemsCount=list.Count;
for(i = 0; i < itemsCount; i++)
Or just use a foreach instead.

For me, readability is foremost: code that makes the reader reader stop and have to backtrack to work out what he just read is intrinsically "bad" - it makes for less maintainable (and thus reliable long term) code in my opinion. Performance is important, yes - but readability is way more so!

But I don't do code reviews on your stuff, so you can roll your way all you want! Laugh | :laugh:

And thanks for dumping the var from the loop! Thumbs Up | :thumbsup:
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
AntiTwitter: @DalekDave is now a follower!

GeneralRe: I never knew I'd miss an operator I hate so much Pin
harold aptroot9-Dec-19 1:42
Memberharold aptroot9-Dec-19 1:42 
GeneralRe: I never knew I'd miss an operator I hate so much Pin
honey the codewitch9-Dec-19 3:51
mvahoney the codewitch9-Dec-19 3:51 
GeneralRe: I never knew I'd miss an operator I hate so much Pin
PIEBALDconsult9-Dec-19 9:26
professionalPIEBALDconsult9-Dec-19 9:26 
GeneralRe: I never knew I'd miss an operator I hate so much Pin
OriginalGriff9-Dec-19 10:16
communityengineerOriginalGriff9-Dec-19 10:16 
GeneralRe: I never knew I'd miss an operator I hate so much Pin
PIEBALDconsult9-Dec-19 10:49
professionalPIEBALDconsult9-Dec-19 10:49 
GeneralRe: I never knew I'd miss an operator I hate so much Pin
OriginalGriff9-Dec-19 22:14
communityengineerOriginalGriff9-Dec-19 22:14 
GeneralRe: I never knew I'd miss an operator I hate so much Pin
PIEBALDconsult10-Dec-19 4:11
professionalPIEBALDconsult10-Dec-19 4:11 
GeneralRe: I never knew I'd miss an operator I hate so much Pin
Super Lloyd9-Dec-19 0:29
MemberSuper Lloyd9-Dec-19 0:29 
GeneralRe: I never knew I'd miss an operator I hate so much Pin
honey the codewitch9-Dec-19 0:30
mvahoney the codewitch9-Dec-19 0:30 
GeneralRe: I never knew I'd miss an operator I hate so much Pin
Greg Utas9-Dec-19 2:11
professionalGreg Utas9-Dec-19 2:11 
GeneralRe: I never knew I'd miss an operator I hate so much Pin
honey the codewitch9-Dec-19 3:54
mvahoney the codewitch9-Dec-19 3:54 
GeneralRe: I never knew I'd miss an operator I hate so much Pin
PIEBALDconsult9-Dec-19 9:10
professionalPIEBALDconsult9-Dec-19 9:10 
GeneralYAY! Slang parsed 8000+ lines of C# code. Pin
honey the codewitch8-Dec-19 17:29
mvahoney the codewitch8-Dec-19 17:29 
GeneralRe: YAY! Slang parsed 8000+ lines of C# code. Pin
Chris Maunder8-Dec-19 17:35
cofounderChris Maunder8-Dec-19 17:35 
GeneralRe: YAY! Slang parsed 8000+ lines of C# code. Pin
honey the codewitch8-Dec-19 18:08
mvahoney the codewitch8-Dec-19 18:08 
GeneralRe: YAY! Slang parsed 8000+ lines of C# code. Pin
PIEBALDconsult8-Dec-19 18:06
professionalPIEBALDconsult8-Dec-19 18:06 
GeneralRe: YAY! Slang parsed 8000+ lines of C# code. Pin
honey the codewitch8-Dec-19 18:07
mvahoney the codewitch8-Dec-19 18:07 

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.