Click here to Skip to main content
15,881,204 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: It's duplicated, too lazy to fix. Pin
Andrei Straut20-Jul-12 3:31
Andrei Straut20-Jul-12 3:31 
GeneralRe: It's duplicated, too lazy to fix. Pin
CDP180220-Jul-12 3:38
CDP180220-Jul-12 3:38 
GeneralEfficiency redux PinPopular
John Hunley18-Jul-12 5:51
John Hunley18-Jul-12 5:51 
JokeRe: Efficiency redux Pin
dan!sh 18-Jul-12 5:54
professional dan!sh 18-Jul-12 5:54 
GeneralRe: Efficiency redux Pin
John Hunley18-Jul-12 9:02
John Hunley18-Jul-12 9:02 
GeneralRe: Efficiency redux Pin
dan!sh 18-Jul-12 17:14
professional dan!sh 18-Jul-12 17:14 
GeneralRe: Efficiency redux Pin
BillW3318-Jul-12 6:40
professionalBillW3318-Jul-12 6:40 
GeneralRe: Efficiency redux Pin
Andrei Straut18-Jul-12 8:08
Andrei Straut18-Jul-12 8:08 
CIDev wrote:
Yeah, if a boss measures programmer’s value by the number of lines they produce then they will get a lot of verbose code


Oh, you mean, elegant, concise code, along the lines of (Java code):

breadcrumbs.setText((breadcrumbs.getText().equals("")) ? pressedItem : breadcrumbs.getText() + " -> " + pressedItem);

will actually get me less money?

Screw that, i'll just go with
StringBuilder builder = new StringBuilder();
if(breadcrumbs.getText().equals("")) {
	builder.append(pressedItem);
} else {
	builder.append(breadcrumbs.getText());
	builder.append("->");
	builder.append(pressedItem);
}
breadcrumbs.setText(builder.toString());


Screw simplicity, that should get me 9 times more money Thumbs Up | :thumbsup: Thumbs Up | :thumbsup:

And yes, I'm a fan of ternaries Smile | :)

And now, seriously, we should come up with a measurement tool for efficiency / readability, and not lines of code.
Full-fledged Java/.NET lover, full-fledged PHP hater.
Full-fledged Google/Microsoft lover, full-fledged Apple hater.
Full-fledged Skype lover, full-fledged YM hater.

GeneralRe: Efficiency redux PinPopular
Brady Kelly18-Jul-12 19:25
Brady Kelly18-Jul-12 19:25 
GeneralRe: Efficiency redux Pin
BillW3319-Jul-12 1:45
professionalBillW3319-Jul-12 1:45 
GeneralRe: Efficiency redux Pin
Andrei Straut19-Jul-12 3:26
Andrei Straut19-Jul-12 3:26 
GeneralRe: Efficiency redux Pin
BillW3319-Jul-12 7:16
professionalBillW3319-Jul-12 7:16 
GeneralRe: Efficiency redux Pin
Andrei Straut19-Jul-12 9:03
Andrei Straut19-Jul-12 9:03 
GeneralRe: Efficiency redux Pin
BillW3319-Jul-12 10:42
professionalBillW3319-Jul-12 10:42 
GeneralRe: Efficiency redux Pin
Andrei Straut19-Jul-12 10:43
Andrei Straut19-Jul-12 10:43 
GeneralRe: Efficiency redux Pin
BillW3319-Jul-12 10:45
professionalBillW3319-Jul-12 10:45 
GeneralRe: Efficiency redux Pin
Lutosław27-Jul-12 23:07
Lutosław27-Jul-12 23:07 
GeneralRe: Efficiency redux Pin
Fran Porretto19-Jul-12 0:46
Fran Porretto19-Jul-12 0:46 
GeneralRe: Efficiency redux Pin
BillW3319-Jul-12 1:48
professionalBillW3319-Jul-12 1:48 
GeneralRe: Efficiency redux Pin
BobJanova19-Jul-12 2:42
BobJanova19-Jul-12 2:42 
GeneralRe: Efficiency redux Pin
onemorechance19-Jul-12 2:11
onemorechance19-Jul-12 2:11 
GeneralRe: Efficiency redux Pin
Lutosław27-Jul-12 23:16
Lutosław27-Jul-12 23:16 
GeneralRe: Efficiency redux Pin
rtklueh19-Jul-12 5:19
rtklueh19-Jul-12 5:19 
General1,2,3,4...lots of...what exactly? PinPopular
Andrei Straut18-Jul-12 4:49
Andrei Straut18-Jul-12 4:49 
GeneralRe: 1,2,3,4...lots of...what exactly? Pin
BillW3318-Jul-12 6:37
professionalBillW3318-Jul-12 6:37 

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.