Click here to Skip to main content
15,891,033 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: Clever code Pin
QuiJohn31-Jul-07 5:32
QuiJohn31-Jul-07 5:32 
GeneralRe: Clever code Pin
Dario Solera31-Jul-07 7:26
Dario Solera31-Jul-07 7:26 
GeneralRe: Sorry, .. I forgot to comment ... Pin
Chris Meech31-Jul-07 6:10
Chris Meech31-Jul-07 6:10 
GeneralRe: Clever code Pin
m@u31-Jul-07 6:26
m@u31-Jul-07 6:26 
GeneralRe: Clever code - Here is why it may have been used... [modified] Pin
Pualee31-Jul-07 7:00
Pualee31-Jul-07 7:00 
GeneralRe: Clever code - Here is why it may have been used... Pin
Dario Solera31-Jul-07 7:28
Dario Solera31-Jul-07 7:28 
GeneralRe: Clever code - Here is why it may have been used... Pin
Pualee31-Jul-07 7:30
Pualee31-Jul-07 7:30 
GeneralRe: Clever code Pin
sngbrdb31-Jul-07 7:55
professionalsngbrdb31-Jul-07 7:55 
Agree with others, without knowing the types and context of this code, it's hard to say. Seems senseless at first, but in C that's a dangerous assumption.
: p

No other assembly programmers out there? The first thing I thought was the second assignment set the zero flag
: )

I'm inclined to think it's just a bit of bad coding... the giveaway is the fact that if there are no instances of 13-10-13-10 in the 1024 bytes the app will overflow on the 1021st iteration (unless the array allocated 1027 bytes, which would just be sloppy and still make me think it's crap code). I did think briefly about pointers, and pointers to pointers, but even that doesn't fit (no *s or &s).

It's just bad code, anyway you look at it.

What does PosBD stand for? Position of... Bad Data? BartDude? Maybe that would give some clue of what he was trying to do.




GeneralRe: Clever code Pin
StevenWalsh4-Aug-07 5:40
StevenWalsh4-Aug-07 5:40 
GeneralJust how many formats can we use to represent the same data? Pin
martin_hughes26-Jul-07 11:58
martin_hughes26-Jul-07 11:58 
GeneralRe: Just how many formats can we use to represent the same data? Pin
Patrick Etc.26-Jul-07 15:30
Patrick Etc.26-Jul-07 15:30 
GeneralRe: Just how many formats can we use to represent the same data? Pin
QuiJohn27-Jul-07 2:24
QuiJohn27-Jul-07 2:24 
GeneralRe: Just how many formats can we use to represent the same data? Pin
Chris Maunder27-Jul-07 3:40
cofounderChris Maunder27-Jul-07 3:40 
GeneralRe: Just how many formats can we use to represent the same data? Pin
codemunkeh27-Jul-07 6:38
codemunkeh27-Jul-07 6:38 
GeneralRe: Just how many formats can we use to represent the same data? Pin
martin_hughes27-Jul-07 7:21
martin_hughes27-Jul-07 7:21 
GeneralRe: Just how many formats can we use to represent the same data? Pin
Ian Shlasko27-Jul-07 11:10
Ian Shlasko27-Jul-07 11:10 
GeneralRe: Just how many formats can we use to represent the same data? Pin
ne0h27-Jul-07 7:31
ne0h27-Jul-07 7:31 
GeneralRe: Just how many formats can we use to represent the same data? Pin
Paul Conrad27-Jul-07 20:12
professionalPaul Conrad27-Jul-07 20:12 
GeneralRe: Just how many formats can we use to represent the same data? Pin
pbraun27-Jul-07 14:14
pbraun27-Jul-07 14:14 
GeneralRe: Just how many formats can we use to represent the same data? Pin
John R. Shaw27-Jul-07 23:30
John R. Shaw27-Jul-07 23:30 
GeneralWell is it SQL or isn't it? Pin
PIEBALDconsult26-Jul-07 10:38
mvePIEBALDconsult26-Jul-07 10:38 
GeneralRe: Well is it SQL or isn't it? Pin
Rob Graham26-Jul-07 11:14
Rob Graham26-Jul-07 11:14 
GeneralRe: Well is it SQL or isn't it? Pin
Dario Solera27-Jul-07 7:30
Dario Solera27-Jul-07 7:30 
GeneralRe: Well is it SQL or isn't it? Pin
Paul Conrad27-Jul-07 20:14
professionalPaul Conrad27-Jul-07 20:14 
GeneralRe: Well is it SQL or isn't it? Pin
Dave Kreskowiak27-Jul-07 11:39
mveDave Kreskowiak27-Jul-07 11:39 

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.