Click here to Skip to main content
15,881,709 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: How to zero-pad a number? Pin
Richard Deeming2-Oct-13 1:44
mveRichard Deeming2-Oct-13 1:44 
GeneralRe: How to zero-pad a number? Pin
SortaCore2-Oct-13 2:07
SortaCore2-Oct-13 2:07 
GeneralRe: How to zero-pad a number? Pin
PIEBALDconsult2-Oct-13 3:12
mvePIEBALDconsult2-Oct-13 3:12 
GeneralRe: How to zero-pad a number? Pin
Richard Deeming2-Oct-13 3:19
mveRichard Deeming2-Oct-13 3:19 
GeneralRe: How to zero-pad a number? Pin
PIEBALDconsult2-Oct-13 3:28
mvePIEBALDconsult2-Oct-13 3:28 
GeneralRe: How to zero-pad a number? Pin
SortaCore2-Oct-13 9:21
SortaCore2-Oct-13 9:21 
GeneralRe: How to zero-pad a number? Pin
SortaCore1-Oct-13 10:48
SortaCore1-Oct-13 10:48 
GeneralRe: How to zero-pad a number? Pin
Dennis_E2-Oct-13 23:19
professionalDennis_E2-Oct-13 23:19 
Wonderful code!
When I was new to programming I used to do something like this too.
Then I figured out a trick: just add 1.000.000.000 to the number and take the last 4 characters.
Now I just use PadLeft, PadRight or Format
GeneralThat really makes a difference Pin
mav.northwind26-Sep-13 20:51
mav.northwind26-Sep-13 20:51 
GeneralRe: That really makes a difference Pin
GuyThiebaut2-Oct-13 5:31
professionalGuyThiebaut2-Oct-13 5:31 
GeneralRe: That really makes a difference Pin
Athari7-Oct-13 6:50
Athari7-Oct-13 6:50 
GeneralCan I copy that? Pin
BotCar25-Sep-13 2:32
BotCar25-Sep-13 2:32 
GeneralRe: Can I copy that? Pin
Pete O'Hanlon25-Sep-13 2:46
mvePete O'Hanlon25-Sep-13 2:46 
GeneralRe: Can I copy that? Pin
Nicholas Marty25-Sep-13 4:12
professionalNicholas Marty25-Sep-13 4:12 
GeneralWhy is my code so slow?? Pin
vonb24-Sep-13 1:39
vonb24-Sep-13 1:39 
GeneralRe: Why is my code so slow?? Pin
Jörgen Andersson24-Sep-13 4:30
professionalJörgen Andersson24-Sep-13 4:30 
GeneralRe: Why is my code so slow?? Pin
vonb24-Sep-13 4:37
vonb24-Sep-13 4:37 
GeneralRe: Why is my code so slow?? Pin
Jörgen Andersson24-Sep-13 8:32
professionalJörgen Andersson24-Sep-13 8:32 
GeneralRe: Why is my code so slow?? Pin
Rage24-Sep-13 5:15
professionalRage24-Sep-13 5:15 
GeneralRe: Why is my code so slow?? Pin
Jörgen Andersson24-Sep-13 8:34
professionalJörgen Andersson24-Sep-13 8:34 
GeneralRe: Why is my code so slow?? PinPopular
BillW3324-Sep-13 5:01
professionalBillW3324-Sep-13 5:01 
GeneralRe: Why is my code so slow?? Pin
OriginalGriff24-Sep-13 8:58
mveOriginalGriff24-Sep-13 8:58 
GeneralRe: Why is my code so slow?? Pin
AmitGajjar25-Sep-13 1:57
professionalAmitGajjar25-Sep-13 1:57 
GeneralRe: Why is my code so slow?? Pin
PIEBALDconsult24-Sep-13 15:38
mvePIEBALDconsult24-Sep-13 15:38 
GeneralRe: Why is my code so slow?? Pin
vonb24-Sep-13 19:20
vonb24-Sep-13 19:20 

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.