Click here to Skip to main content
11,568,157 members (38,497 online)

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: IIF to the rescue... Pin
PaulLinton2-Jul-14 15:14
memberPaulLinton2-Jul-14 15:14 
GeneralRe: IIF to the rescue... Pin
Sander Rossel2-Jul-14 19:31
professionalSander Rossel2-Jul-14 19:31 
GeneralRe: IIF to the rescue... Pin
Jörgen Andersson5-Jul-14 20:02
professionalJörgen Andersson5-Jul-14 20:02 
GeneralStarting to page OS to disk! Pin
David O'Neil27-Jun-14 10:22
memberDavid O'Neil27-Jun-14 10:22 
GeneralChecking for empty guid Pin
Stepan Kobzey26-Jun-14 10:04
memberStepan Kobzey26-Jun-14 10:04 
GeneralRe: Checking for empty guid Pin
PIEBALDconsult26-Jun-14 10:13
memberPIEBALDconsult26-Jun-14 10:13 
GeneralRe: Checking for empty guid Pin
Stepan Kobzey26-Jun-14 10:16
memberStepan Kobzey26-Jun-14 10:16 
GeneralRe: Checking for empty guid Pin
PIEBALDconsult26-Jun-14 10:37
memberPIEBALDconsult26-Jun-14 10:37 
Stepan Kobzey wrote:
if something went wrong


I don't think that's the responsibilty of this method. That should have been performed before calling the method.


Stepan Kobzey wrote:
is empty guid


If the method is asked to perform the action, it should perform it.


Stepan Kobzey wrote:
bites in memory


So what?


Basically, what goes wrong if you remove the check entirely?
It sounds like a case of premature optimization -- if the guid is never empty, then you are actually decreasing performance because you perform the check every time.
You'll never get very far if all you do is follow instructions.

GeneralRe: Checking for empty guid Pin
Sander Rossel26-Jun-14 10:51
professionalSander Rossel26-Jun-14 10:51 
GeneralRe: Checking for empty guid Pin
PIEBALDconsult26-Jun-14 11:05
memberPIEBALDconsult26-Jun-14 11:05 
GeneralRe: Checking for empty guid Pin
Sander Rossel26-Jun-14 12:32
professionalSander Rossel26-Jun-14 12:32 
GeneralRe: Checking for empty guid Pin
OriginalGriff26-Jun-14 11:11
protectorOriginalGriff26-Jun-14 11:11 
GeneralRe: Checking for empty guid Pin
Sander Rossel26-Jun-14 12:32
professionalSander Rossel26-Jun-14 12:32 
GeneralRe: Checking for empty guid Pin
PIEBALDconsult27-Jun-14 4:37
memberPIEBALDconsult27-Jun-14 4:37 
GeneralRe: Checking for empty guid Pin
HomerTheGreat26-Jun-14 11:19
memberHomerTheGreat26-Jun-14 11:19 
GeneralRe: Checking for empty guid Pin
Bernhard Hiller27-Jun-14 0:11
professionalBernhard Hiller27-Jun-14 0:11 
GeneralRe: Checking for empty guid Pin
PIEBALDconsult27-Jun-14 4:37
memberPIEBALDconsult27-Jun-14 4:37 
GeneralRe: Checking for empty guid Pin
Bernhard Hiller27-Jun-14 0:06
professionalBernhard Hiller27-Jun-14 0:06 
GeneralRe: Checking for empty guid Pin
PIEBALDconsult27-Jun-14 4:38
memberPIEBALDconsult27-Jun-14 4:38 
GeneralRe: Checking for empty guid Pin
Nagy Vilmos27-Jun-14 1:59
professionalNagy Vilmos27-Jun-14 1:59 
GeneralRe: Checking for empty guid Pin
Richard Deeming27-Jun-14 2:36
professionalRichard Deeming27-Jun-14 2:36 
GeneralRe: Checking for empty guid Pin
PIEBALDconsult27-Jun-14 3:11
memberPIEBALDconsult27-Jun-14 3:11 
GeneralRe: Checking for empty guid Pin
Richard Deeming27-Jun-14 3:21
professionalRichard Deeming27-Jun-14 3:21 
GeneralRe: Checking for empty guid Pin
PIEBALDconsult27-Jun-14 4:26
memberPIEBALDconsult27-Jun-14 4:26 
GeneralInteresting... Pin
Dave Kreskowiak23-Jun-14 2:53
mvpDave Kreskowiak23-Jun-14 2:53 

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
Web04 | 2.8.150624.2 | Last Updated 30 Jun 2015
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid