Click here to Skip to main content
15,887,214 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: Dating Pin
Luc Pattyn15-Oct-10 2:06
sitebuilderLuc Pattyn15-Oct-10 2:06 
AnswerRe: Dating Pin
Prerak Patel18-Oct-10 20:26
professionalPrerak Patel18-Oct-10 20:26 
GeneralRe: Dating Pin
Marc Clifton7-Oct-10 12:53
mvaMarc Clifton7-Oct-10 12:53 
GeneralRe: Dating Pin
Jörgen Sigvardsson9-Oct-10 21:13
Jörgen Sigvardsson9-Oct-10 21:13 
GeneralRe: Dating Pin
Marc Clifton10-Oct-10 2:13
mvaMarc Clifton10-Oct-10 2:13 
GeneralRe: Dating Pin
Jörgen Sigvardsson10-Oct-10 3:17
Jörgen Sigvardsson10-Oct-10 3:17 
GeneralRe: Dating Pin
johannesnestler8-Oct-10 5:45
johannesnestler8-Oct-10 5:45 
GeneralObj-C string construction Pin
SirTimothy1-Oct-10 10:12
SirTimothy1-Oct-10 10:12 
So I was looking at some code I wrote a few years back, when I was first learning objective-C. I found many places where I did something like this:
char buffer[100];
sprintf(buffer, "the value: %d", someValue);
NSString* string = [NSString stringWithCString:buffer];

of course, with more useful text and values. I think there may have even been some times when I malloc'd buffer rather than having it on the stack... for those who aren't familiar with obj-C, this could be more sanely/appropriately written as:
NSString* string = [NSString stringWithFormat:"the value: %d", someValue"];

GeneralRe: Obj-C string construction Pin
Blake Miller4-Oct-10 6:23
Blake Miller4-Oct-10 6:23 
GeneralRe: Obj-C string construction Pin
BillW335-Oct-10 9:44
professionalBillW335-Oct-10 9:44 
GeneralRe: Obj-C string construction Pin
Le centriste14-Oct-10 2:44
Le centriste14-Oct-10 2:44 
GeneralModusOperandi PinPopular
Camilo Sanchez27-Sep-10 5:56
Camilo Sanchez27-Sep-10 5:56 
GeneralRe: ModusOperandi Pin
makumazan8428-Sep-10 0:45
makumazan8428-Sep-10 0:45 
GeneralRe: ModusOperandi Pin
Camilo Sanchez28-Sep-10 2:38
Camilo Sanchez28-Sep-10 2:38 
GeneralRe: ModusOperandi Pin
Rob Grainger28-Sep-10 4:17
Rob Grainger28-Sep-10 4:17 
GeneralRe: ModusOperandi Pin
Richard A. Dalton30-Sep-10 2:32
Richard A. Dalton30-Sep-10 2:32 
GeneralRe: ModusOperandi Pin
Gregory Gadow4-Oct-10 11:46
Gregory Gadow4-Oct-10 11:46 
GeneralBeware while using Japanese language PinPopular
MalikRizwan26-Sep-10 0:07
MalikRizwan26-Sep-10 0:07 
GeneralRe: Beware while using Japanese language Pin
MalikRizwan26-Sep-10 1:18
MalikRizwan26-Sep-10 1:18 
GeneralRe: Beware while using Japanese language PinPopular
Richard A. Dalton27-Sep-10 4:15
Richard A. Dalton27-Sep-10 4:15 
GeneralRe: Beware while using Japanese language Pin
Camilo Sanchez27-Sep-10 5:58
Camilo Sanchez27-Sep-10 5:58 
GeneralRe: Beware while using Japanese language Pin
MalikRizwan27-Sep-10 21:10
MalikRizwan27-Sep-10 21:10 
GeneralRe: Beware while using Japanese language Pin
dawmail33328-Sep-10 22:22
dawmail33328-Sep-10 22:22 
GeneralRe: Beware while using Japanese language Pin
ChrisNic29-Sep-10 0:01
ChrisNic29-Sep-10 0:01 
GeneralRe: Beware while using Japanese language Pin
dawmail33329-Sep-10 0:49
dawmail33329-Sep-10 0:49 

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.