Click here to Skip to main content
15,887,746 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: That may have been a mistake... Pin
Daniel Grunwald23-Aug-10 11:11
Daniel Grunwald23-Aug-10 11:11 
GeneralRe: That may have been a mistake... Pin
Peter_in_278025-Aug-10 13:24
professionalPeter_in_278025-Aug-10 13:24 
GeneralRe: That may have been a mistake... Pin
OriginalGriff26-Aug-10 0:36
mveOriginalGriff26-Aug-10 0:36 
GeneralString "bitmaps" Pin
Gordon Kushner20-Aug-10 2:32
Gordon Kushner20-Aug-10 2:32 
GeneralRe: String "bitmaps" Pin
PIEBALDconsult20-Aug-10 3:13
mvePIEBALDconsult20-Aug-10 3:13 
GeneralRe: String "bitmaps" Pin
CDP180220-Aug-10 4:32
CDP180220-Aug-10 4:32 
GeneralRe: String "bitmaps" Pin
Gordon Kushner20-Aug-10 5:22
Gordon Kushner20-Aug-10 5:22 
GeneralRe: String "bitmaps" Pin
Richard A. Dalton20-Aug-10 4:39
Richard A. Dalton20-Aug-10 4:39 
I must admit in the dim and distant past I did something not terribly dissimilar to that. Indeed if you search MSDN you can still find the evidence.

http://msdn.microsoft.com/en-us/library/aa239702(VS.60).aspx[^]

Now, It's too long ago for me to try justify exactly what I was doing, but here is what I remember of it:

1. The "bits" in this case represented meta-data which were stored in an XML document.

2. I wasn't going to be AND'ing or OR'ing the fields as a whole.

3. Any performance or space savings from using actual bits would have been outweighed by the benefit of being able to see the string of 1s and 0s in XML, rather than a cryptic Numerical value

4. Keeping the string of 1s and 0s in XML but actual bit logic in code would have meant translating back and forth needlessly.

So there it is.

I'm a huge fan of bitmap fields and use them all the time, but in that instance and at that time I felt comfortable with a string.

But yes, my default attitude is that a string is rarely the right way to go. 99% of the time I'd expect it to be a bad idea, and the remaining 1% of times I'd expect it to be seriously debatable.
GeneralRe: String "bitmaps" Pin
Gordon Kushner20-Aug-10 5:20
Gordon Kushner20-Aug-10 5:20 
GeneralRe: String "bitmaps" Pin
Richard A. Dalton20-Aug-10 5:53
Richard A. Dalton20-Aug-10 5:53 
GeneralRe: String "bitmaps" Pin
Gordon Kushner20-Aug-10 6:13
Gordon Kushner20-Aug-10 6:13 
GeneralRe: String "bitmaps" Pin
Rob Grainger20-Aug-10 5:56
Rob Grainger20-Aug-10 5:56 
GeneralRe: String "bitmaps" Pin
Richard A. Dalton20-Aug-10 6:58
Richard A. Dalton20-Aug-10 6:58 
GeneralRe: String "bitmaps" Pin
Keith Barrow21-Aug-10 23:45
professionalKeith Barrow21-Aug-10 23:45 
GeneralRe: String "bitmaps" Pin
Richard A. Dalton22-Aug-10 12:21
Richard A. Dalton22-Aug-10 12:21 
GeneralRe: String "bitmaps" Pin
Keith Barrow22-Aug-10 12:49
professionalKeith Barrow22-Aug-10 12:49 
GeneralRe: String "bitmaps" Pin
Richard A. Dalton22-Aug-10 23:32
Richard A. Dalton22-Aug-10 23:32 
GeneralRe: String "bitmaps" Pin
T M Gray20-Aug-10 6:15
T M Gray20-Aug-10 6:15 
GeneralRe: String "bitmaps" Pin
Dr.Walt Fair, PE20-Aug-10 7:56
professionalDr.Walt Fair, PE20-Aug-10 7:56 
GeneralRe: String "bitmaps" Pin
Nagy Vilmos22-Aug-10 0:34
professionalNagy Vilmos22-Aug-10 0:34 
GeneralRe: String "bitmaps" Pin
Blake Miller21-Sep-10 12:30
Blake Miller21-Sep-10 12:30 
GeneralOne of those bad days and now i find stuff like this... Pin
Bigdeak18-Aug-10 1:29
Bigdeak18-Aug-10 1:29 
GeneralRe: One of those bad days and now i find stuff like this... Pin
hammerstein0518-Aug-10 6:22
hammerstein0518-Aug-10 6:22 
JokeRe: One of those bad days and now i find stuff like this... Pin
akyriako7820-Aug-10 2:56
akyriako7820-Aug-10 2:56 
GeneralRe: One of those bad days and now i find stuff like this... Pin
Jeroen De Dauw18-Aug-10 7:22
Jeroen De Dauw18-Aug-10 7:22 

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.