Click here to Skip to main content

The Weird and The Wonderful

   

The Weird and The Wonderful forum is a place to post Coding Horrors, Worst Practices, and the occasional flash of brilliance.

We all come across code that simply boggles the mind. Lazy kludges, embarrasing mistakes, horrid workarounds and developers just not quite getting it. And then somedays we come across - or write - the truly sublime.

Post your Best, your worst, and your most interesting. But please - no programming questions . This forum is purely for amusement and discussions on code snippets. All actual programming questions will be removed.

 
GeneralRe: Which code you suggest? PinmemberReelix25-Jul-13 21:36 
GeneralRe: Which code you suggest? PinmemberKP Lee26-Jul-13 17:21 
AnswerRe: Which code you suggest? Pinprofessional_Damian S_24-Jul-13 21:02 
AnswerRe: Which code you suggest? Pinmemberihoecken25-Jul-13 3:42 
AnswerRe: Which code you suggest? Pinmemberryanb3125-Jul-13 4:48 
GeneralRe: Which code you suggest? PinprotectorOriginalGriff25-Jul-13 5:04 
GeneralRe: Which code you suggest? Pinmemberryanb3125-Jul-13 5:11 
GeneralRe: Which code you suggest? PinmemberSentenryu25-Jul-13 7:15 
ryanb31 wrote:
Generally speaking the amount of time saved by returning in various places is negligible.

 
Generalization is Bad. what would you say if there was a database access on that loop? or a file read/write? a service call? are those so rare that they can't be considered "general"?
 
I'm ok with having one single return point, provided that the method doesn't do any significant work. the general rule should be to exit as soon as you finish the work or realize there's nothing more to be done.
I'm brazilian and english (well, human languages in general) aren't my best skill, so, sorry by my english. (if you want we can speak in C# or VB.Net =p)
 
"Given the chance I'd rather work smart than work hard." - PHS241
 
"'Sophisticated platform' typically means 'I have no idea how it works.'"

GeneralRe: Which code you suggest? Pinmemberryanb3125-Jul-13 7:32 
GeneralRe: Which code you suggest? PinprotectorOriginalGriff25-Jul-13 8:26 
GeneralRe: Which code you suggest? Pinmemberryanb3125-Jul-13 8:28 
GeneralRe: Which code you suggest? PinprotectorOriginalGriff25-Jul-13 8:31 
GeneralRe: Which code you suggest? Pinmemberryanb3125-Jul-13 8:35 
GeneralRe: Which code you suggest? PinmemberAndrew Leeder25-Jul-13 22:34 
GeneralRe: Which code you suggest? PinprotectorOriginalGriff25-Jul-13 22:50 
GeneralRe: Which code you suggest? PinmemberSortaCore25-Jul-13 23:15 
GeneralRe: Which code you suggest? PinprotectorOriginalGriff25-Jul-13 23:22 
GeneralRe: Which code you suggest? PinmemberSortaCore25-Jul-13 23:39 
GeneralRe: Which code you suggest? PinmemberStefan_Lang26-Jul-13 0:19 
GeneralRe: Which code you suggest? PinprotectorOriginalGriff26-Jul-13 0:26 
GeneralRe: Which code you suggest? PinmemberStefan_Lang26-Jul-13 1:27 
GeneralRe: Which code you suggest? Pinmembersvella26-Jul-13 4:42 
QuestionRe: Which code you suggest? PinprofessionalAmir Mohammad Nasrollahi28-Jul-13 1:55 
GeneralRe: Which code you suggest? PinmemberStefan_Lang28-Jul-13 22:21 
GeneralRe: Which code you suggest? Pinmembersvella29-Jul-13 4:02 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.


Advertise | Privacy | Mobile
Web02 | 2.8.140415.2 | Last Updated 17 Apr 2014
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Use
Layout: fixed | fluid