Click here to Skip to main content
15,885,546 members

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, embarrassing 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: When Gobbledygook, Do Nada (Except Break the Build) Pin
lewax0026-Jun-13 13:39
lewax0026-Jun-13 13:39 
GeneralRe: When Gobbledygook, Do Nada (Except Break the Build) Pin
Argonia26-Jun-13 22:03
professionalArgonia26-Jun-13 22:03 
GeneralRe: When Gobbledygook, Do Nada (Except Break the Build) Pin
Richard Deeming26-Jun-13 23:57
mveRichard Deeming26-Jun-13 23:57 
GeneralRe: When Gobbledygook, Do Nada (Except Break the Build) Pin
Argonia27-Jun-13 0:03
professionalArgonia27-Jun-13 0:03 
GeneralRe: When Gobbledygook, Do Nada (Except Break the Build) Pin
OriginalGriff27-Jun-13 0:12
mveOriginalGriff27-Jun-13 0:12 
GeneralRe: When Gobbledygook, Do Nada (Except Break the Build) Pin
Freak3027-Jun-13 0:57
Freak3027-Jun-13 0:57 
GeneralRe: When Gobbledygook, Do Nada (Except Break the Build) Pin
OriginalGriff27-Jun-13 1:07
mveOriginalGriff27-Jun-13 1:07 
GeneralRe: When Gobbledygook, Do Nada (Except Break the Build) Pin
Richard Deeming27-Jun-13 1:56
mveRichard Deeming27-Jun-13 1:56 
Not to mention converting the string manually instead of using Convert.ToString(TestInteger, 2)[^].
Or concatenating up to 31 strings during the conversion.
Or extracting a single character as a string instead of a character.
Or using CInt when you know it will be either "0" or "1".

Or even the fact that the whole method could be replaced with:
VB
Return If(TestInteger And (2 ^ (Nr - 1)) = 0, 0, 1)


And as for the fact that the function was only ever called with a single value of Nr, so that all the calls could be replaced with:
VB
'If GetBitNr(someValue, 7) = 1 Then
If (someValue And 64) <> 0 Then

Dead | X|



"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer


GeneralRe: When Gobbledygook, Do Nada (Except Break the Build) Pin
Lutosław28-Jun-13 9:44
Lutosław28-Jun-13 9:44 
GeneralAhh, the joys of Visual Basic Pin
Argonia26-Jun-13 1:42
professionalArgonia26-Jun-13 1:42 
GeneralRe: Ahh, the joys of Visual Basic Pin
Mohammed Hameed26-Jun-13 2:10
professionalMohammed Hameed26-Jun-13 2:10 
GeneralRe: Ahh, the joys of Visual Basic Pin
dusty_dex26-Jun-13 2:29
dusty_dex26-Jun-13 2:29 
GeneralRe: Ahh, the joys of Visual Basic Pin
Herbie Mountjoy26-Jun-13 21:09
professionalHerbie Mountjoy26-Jun-13 21:09 
GeneralRe: Ahh, the joys of Visual Basic Pin
dusty_dex27-Jun-13 1:28
dusty_dex27-Jun-13 1:28 
GeneralRe: Ahh, the joys of Visual Basic Pin
Westm27-Jun-13 6:22
Westm27-Jun-13 6:22 
GeneralRe: Ahh, the joys of Visual Basic Pin
GuyThiebaut26-Jun-13 2:37
professionalGuyThiebaut26-Jun-13 2:37 
GeneralRe: Ahh, the joys of Visual Basic Pin
Argonia26-Jun-13 3:04
professionalArgonia26-Jun-13 3:04 
GeneralRe: Ahh, the joys of Visual Basic Pin
GuyThiebaut26-Jun-13 3:40
professionalGuyThiebaut26-Jun-13 3:40 
GeneralRe: Ahh, the joys of Visual Basic Pin
lewax0026-Jun-13 3:43
lewax0026-Jun-13 3:43 
GeneralRe: Ahh, the joys of Visual Basic Pin
gervacleto28-Jun-13 1:45
professionalgervacleto28-Jun-13 1:45 
GeneralRe: Ahh, the joys of Visual Basic Pin
Freak3027-Jun-13 1:02
Freak3027-Jun-13 1:02 
GeneralRe: Ahh, the joys of Visual Basic Pin
csugden27-Jun-13 4:03
professionalcsugden27-Jun-13 4:03 
GeneralWhy some of them (developers) dont confuse using Global variables heavily or they aren't aware of reality. Pin
Mohammed Hameed21-Jun-13 2:53
professionalMohammed Hameed21-Jun-13 2:53 
GeneralRe: Why some of them (developers) dont confuse using Global variables heavily or they aren't aware of reality. Pin
OriginalGriff21-Jun-13 3:46
mveOriginalGriff21-Jun-13 3:46 
GeneralRe: Why some of them (developers) dont confuse using Global variables heavily or they aren't aware of reality. Pin
Mohammed Hameed21-Jun-13 3:50
professionalMohammed Hameed21-Jun-13 3:50 

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.