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.

 
GeneralYes I know it was me who wrote that... PinprofessionalGuyThiebaut10-Dec-13 5:51 
GeneralRe: Yes I know it was me who wrote that... PinprofessionalRichard Deeming10-Dec-13 5:58 
GeneralRe: Yes I know it was me who wrote that... PinprofessionalGuyThiebaut10-Dec-13 6:00 
GeneralRe: Yes I know it was me who wrote that... PinmemberBobJanova10-Dec-13 6:40 
GeneralRe: Yes I know it was me who wrote that... PinprofessionalRichard Deeming10-Dec-13 6:50 
GeneralRe: Yes I know it was me who wrote that... PinmemberBobJanova10-Dec-13 6:59 
GeneralRe: Yes I know it was me who wrote that... PinprofessionalRichard Deeming10-Dec-13 7:01 
GeneralRe: Yes I know it was me who wrote that... PinprotectorOriginalGriff10-Dec-13 8:34 
Nasty! Unsafe code...
Please, try to avoid it, especially when it can be done without it so much more clearly:
if (((BitConverter.ToInt32(Encoding.ASCII.GetBytes(item), 0) & 6250335) ^ 6243920) == 0)

GeneralRe: Yes I know it was me who wrote that... PinmemberCDP180210-Dec-13 17:09 
GeneralRe: Yes I know it was me who wrote that... PinprotectorOriginalGriff10-Dec-13 21:20 
GeneralRe: Yes I know it was me who wrote that... PinmemberArgonia10-Dec-13 20:36 
GeneralRe: Yes I know it was me who wrote that... PinprofessionalRichard Deeming11-Dec-13 2:27 
GeneralRe: Yes I know it was me who wrote that... PinprotectorOriginalGriff11-Dec-13 3:00 
GeneralRe: Yes I know it was me who wrote that... PinprofessionalRichard Deeming11-Dec-13 3:27 
GeneralRe: Yes I know it was me who wrote that... PinprotectorOriginalGriff11-Dec-13 3:46 
GeneralRe: Yes I know it was me who wrote that... PinmemberArgonia11-Dec-13 3:57 
GeneralRe: Yes I know it was me who wrote that... PinprotectorOriginalGriff11-Dec-13 4:57 
GeneralRe: Yes I know it was me who wrote that... [modified] PinmemberArgonia11-Dec-13 5:04 
GeneralRe: Yes I know it was me who wrote that... PinprofessionalRichard Deeming11-Dec-13 5:13 
GeneralRe: Yes I know it was me who wrote that... PinmemberArgonia11-Dec-13 5:16 
GeneralRe: Yes I know it was me who wrote that... PinmemberRob Grainger17-Dec-13 1:30 
GeneralRe: Yes I know it was me who wrote that... PinprofessionalRichard Deeming11-Dec-13 4:09 
GeneralRe: Yes I know it was me who wrote that... PinmemberJörgen Andersson11-Dec-13 20:16 
GeneralRe: Yes I know it was me who wrote that... Pinmemberledtech320-Dec-13 15:13 
GeneralRe: Yes I know it was me who wrote that... PinmemberVUnreal15-Jan-14 10:37 

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
Web01 | 2.8.140827.1 | Last Updated 29 Aug 2014
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid