Click here to Skip to main content
16,008,490 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.

 
RantRe: Horrible enough for you? Pin
cpkilekofp2-Oct-08 10:01
cpkilekofp2-Oct-08 10:01 
GeneralRe: Horrible enough for you? Pin
BillW332-Oct-08 18:23
professionalBillW332-Oct-08 18:23 
GeneralRe: Horrible enough for you? Pin
cpkilekofp3-Oct-08 2:09
cpkilekofp3-Oct-08 2:09 
GeneralRe: Horrible enough for you? Pin
GibbleCH1-Oct-08 6:06
GibbleCH1-Oct-08 6:06 
GeneralRe: Horrible enough for you? Pin
Paul Conrad1-Oct-08 5:28
professionalPaul Conrad1-Oct-08 5:28 
GeneralRe: Horrible enough for you? Pin
CPallini1-Oct-08 5:34
mveCPallini1-Oct-08 5:34 
GeneralRe: Horrible enough for you? Pin
PIEBALDconsult1-Oct-08 8:51
mvePIEBALDconsult1-Oct-08 8:51 
GeneralRe: Horrible enough for you? Pin
dojohansen1-Oct-08 21:29
dojohansen1-Oct-08 21:29 
But here the semi-colon adds an empty statement!

This is a javascript function block with two statements:
function f() 
{
   a = 5;
   ++i;
}


The function itself is a declaration, not a statement, and adding a semicolon merely makes it a block with two statements followed by an empty statement.

Admittedly the difference between a declaration and a statement is a bit fuzzy in this case, since in js a function declaration is equivalent to an assignment statement, like this:

var f = function()
{
   a = 5;
   ++i;
};


In which case it's correct to include the semicolon (because it ends a statement in this case).

Anyway, my real problem is the insane amount of reduncancy in the code. I declare war on copy-paste "programmers" the world over!
JokeRe: Horrible enough for you? Pin
cpkilekofp2-Oct-08 10:04
cpkilekofp2-Oct-08 10:04 
GeneralRe: Horrible enough for you? Pin
VentsyV1-Oct-08 11:46
VentsyV1-Oct-08 11:46 
GeneralRe: Horrible enough for you? Pin
Lutosław1-Oct-08 12:04
Lutosław1-Oct-08 12:04 
GeneralRe: Horrible enough for you? Pin
Paul Conrad1-Oct-08 18:58
professionalPaul Conrad1-Oct-08 18:58 
GeneralRe: Horrible enough for you? Pin
dojohansen1-Oct-08 22:13
dojohansen1-Oct-08 22:13 
GeneralRe: Horrible enough for you? Pin
Dan Neely2-Oct-08 2:25
Dan Neely2-Oct-08 2:25 
GeneralRe: Horrible enough for you? Pin
rcollina2-Oct-08 1:09
rcollina2-Oct-08 1:09 
GeneralRe: Horrible enough for you? Pin
Tom12-Oct-08 8:27
Tom12-Oct-08 8:27 
GeneralAnd Another One PinPopular
Rick York29-Sep-08 12:22
mveRick York29-Sep-08 12:22 
QuestionRe: And Another One Pin
CPallini29-Sep-08 21:44
mveCPallini29-Sep-08 21:44 
GeneralRe: And Another One Pin
Graham Bradshaw30-Sep-08 2:06
Graham Bradshaw30-Sep-08 2:06 
GeneralRe: And Another One Pin
Mike Dimmick30-Sep-08 5:49
Mike Dimmick30-Sep-08 5:49 
GeneralRe: And Another One Pin
Rick York30-Sep-08 7:09
mveRick York30-Sep-08 7:09 
GeneralAnother Horror PinPopular
Narotham Babu Kalluri26-Sep-08 3:39
Narotham Babu Kalluri26-Sep-08 3:39 
GeneralRe: Another Horror Pin
adamsappel26-Sep-08 3:52
adamsappel26-Sep-08 3:52 
GeneralRe: Another Horror Pin
Paul Conrad26-Sep-08 6:05
professionalPaul Conrad26-Sep-08 6:05 
GeneralRe: Another Horror Pin
CARPETBURNER29-Sep-08 8:59
CARPETBURNER29-Sep-08 8:59 

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.