Click here to Skip to main content
15,907,328 members
Home / Discussions / C#
   

C#

 
GeneralRe: help optimize functions Pin
V.16-Jun-11 3:55
professionalV.16-Jun-11 3:55 
GeneralRe: help optimize functions Pin
Paladin200016-Jun-11 4:12
Paladin200016-Jun-11 4:12 
GeneralRe: help optimize functions Pin
Abbath134916-Jun-11 4:48
Abbath134916-Jun-11 4:48 
AnswerRe: help optimize functions Pin
V.16-Jun-11 3:55
professionalV.16-Jun-11 3:55 
GeneralRe: help optimize functions Pin
BobJanova16-Jun-11 4:12
BobJanova16-Jun-11 4:12 
GeneralRe: help optimize functions Pin
V.16-Jun-11 5:43
professionalV.16-Jun-11 5:43 
GeneralRe: help optimize functions Pin
Not Active16-Jun-11 10:17
mentorNot Active16-Jun-11 10:17 
GeneralRe: help optimize functions Pin
BobJanova16-Jun-11 10:29
BobJanova16-Jun-11 10:29 
I'm not missing them, I just don't agree with them Wink | ;)

(Or, to be less glib, they come from good principles, but when applied as fixed rules, they make things less readable, generally by expanding the code so that you can't see the pattern of it any more. In the case of the example posted here, decrementing both the x and y variables in one line makes sense because it's one thought, for example.)

There is nothing wrong with multiple returns, though. Checking a condition within a foreach loop and returning when it's hit is quite common and perfectly readable (arguably more so than assigning to a variable and breaking since you can see that it's an exit point).
GeneralRe: help optimize functions Pin
Not Active16-Jun-11 11:56
mentorNot Active16-Jun-11 11:56 
GeneralRe: help optimize functions Pin
BobJanova16-Jun-11 22:55
BobJanova16-Jun-11 22:55 
GeneralRe: help optimize functions Pin
PIEBALDconsult16-Jun-11 15:52
mvePIEBALDconsult16-Jun-11 15:52 
AnswerRe: help optimize functions Pin
Pete O'Hanlon16-Jun-11 4:30
mvePete O'Hanlon16-Jun-11 4:30 
AnswerRe: help optimize functions Pin
David198716-Jun-11 4:40
David198716-Jun-11 4:40 
GeneralRe: help optimize functions Pin
Abbath134916-Jun-11 6:34
Abbath134916-Jun-11 6:34 
GeneralRe: help optimize functions Pin
David198716-Jun-11 7:11
David198716-Jun-11 7:11 
QuestionFusion Logs not working for WINWORD.exe Pin
ramzg15-Jun-11 23:09
ramzg15-Jun-11 23:09 
QuestionQuery XML with LINQ Pin
treuveni15-Jun-11 21:26
treuveni15-Jun-11 21:26 
AnswerRe: Query XML with LINQ Pin
Pete O'Hanlon15-Jun-11 21:31
mvePete O'Hanlon15-Jun-11 21:31 
GeneralRe: Query XML with LINQ Pin
treuveni15-Jun-11 21:37
treuveni15-Jun-11 21:37 
GeneralRe: Query XML with LINQ Pin
Pete O'Hanlon15-Jun-11 21:42
mvePete O'Hanlon15-Jun-11 21:42 
GeneralRe: Query XML with LINQ Pin
treuveni15-Jun-11 21:50
treuveni15-Jun-11 21:50 
GeneralRe: Query XML with LINQ Pin
Pete O'Hanlon15-Jun-11 22:21
mvePete O'Hanlon15-Jun-11 22:21 
QuestionSearching words on visual studio. Pin
Subin Mavunkal15-Jun-11 21:05
Subin Mavunkal15-Jun-11 21:05 
AnswerRe: Searching words on visual studio. Pin
Richard MacCutchan15-Jun-11 21:18
mveRichard MacCutchan15-Jun-11 21:18 
Answer[SOLVED] OleDb Exception Displays Only Table Name Pin
Matt U.15-Jun-11 12:01
Matt U.15-Jun-11 12:01 

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.