Click here to Skip to main content
16,008,299 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: The Classic Pin
Pete O'Hanlon5-May-08 11:06
mvePete O'Hanlon5-May-08 11:06 
GeneralRe: The Classic Pin
CDP18025-May-08 21:43
CDP18025-May-08 21:43 
GeneralRe: The Classic Pin
Pete O'Hanlon6-May-08 0:37
mvePete O'Hanlon6-May-08 0:37 
GeneralRe: The Classic Pin
CDP18026-May-08 1:22
CDP18026-May-08 1:22 
GeneralRe: The Classic Pin
BadKarma6-May-08 1:38
BadKarma6-May-08 1:38 
GeneralRe: The Classic Pin
hlmechanic7-May-08 6:13
hlmechanic7-May-08 6:13 
GeneralRe: The Classic Pin
MarkB7776-May-08 21:41
MarkB7776-May-08 21:41 
GeneralRe: The Classic Pin
supercat912-May-08 16:57
supercat912-May-08 16:57 
//At college a professor tried to tell me that I can't possibly write better code than a compiler. I proved him wrong, but it's not really hard do better than a compiler in most cases.//

I have found that, in general, the smaller a routine, the more likely it can receive a big speedup from hand assembly (at least if it doesn't match a particular 'pattern' the compiler can recognize and optimize). Some years back I wrote a game for an XT which had about 20 lines of assembly code in a 1400-line game. The assembly code ran about ten times as fast as what the compiler could generate, and yet still represented about 80% of the main loop's worst-case execution time.

Nowadays a lot of my hobby programming is in assembly language, though. On a game machine with 128 bytes of RAM (code runs from ROM) when there are 76 clock cycles per scan line to handle display drawing, assembly code is pretty much a must. A BASIC compiler exists using some pre-defined display kernels, and people have done some cool things with it, but for real power programming hand-written assembly is the only way to go.
GeneralRe: The Classic Pin
Gary R. Wheeler10-May-08 1:51
Gary R. Wheeler10-May-08 1:51 
JokeRe: The Classic Pin
Ed.Poore5-May-08 12:03
Ed.Poore5-May-08 12:03 
GeneralRe: The Classic Pin
CDP18025-May-08 21:46
CDP18025-May-08 21:46 
GeneralRe: The Classic Pin
MidwestLimey6-May-08 12:00
professionalMidwestLimey6-May-08 12:00 
GeneralRe: The Classic Pin
CDP18026-May-08 22:51
CDP18026-May-08 22:51 
GeneralRe: The Classic Pin
Gary R. Wheeler10-May-08 1:54
Gary R. Wheeler10-May-08 1:54 
GeneralRe: The Classic Pin
cp98766-May-08 19:57
cp98766-May-08 19:57 
GeneralRe: The Classic Pin
CDP18026-May-08 22:36
CDP18026-May-08 22:36 
GeneralRe: The Classic Pin
cp98766-May-08 22:55
cp98766-May-08 22:55 
GeneralRe: The Classic Pin
CDP18026-May-08 23:05
CDP18026-May-08 23:05 
GeneralRe: The Classic Pin
Gary R. Wheeler10-May-08 2:01
Gary R. Wheeler10-May-08 2:01 
GeneralRe: The Classic Pin
darkelv6-May-08 20:07
darkelv6-May-08 20:07 
GeneralRe: The Classic Pin
Nemanja Trifunovic8-May-08 4:27
Nemanja Trifunovic8-May-08 4:27 
GeneralRe: The Classic Pin
CDP18028-May-08 4:44
CDP18028-May-08 4:44 
GeneralRe: The Classic Pin
The Cake of Deceit8-May-08 23:59
The Cake of Deceit8-May-08 23:59 
GeneralRe: The Classic Pin
CDP18029-May-08 0:26
CDP18029-May-08 0:26 
GeneralReplace what? [modified] Pin
Brady Kelly25-Apr-08 0:12
Brady Kelly25-Apr-08 0:12 

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.