Click here to Skip to main content
15,913,361 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 Code Repeater PinPopular
Jeroen De Dauw13-Mar-12 15:18
Jeroen De Dauw13-Mar-12 15:18 
GeneralRe: The Code Repeater Pin
Mohibur Rashid13-Mar-12 22:45
professionalMohibur Rashid13-Mar-12 22:45 
GeneralRe: The Code Repeater Pin
Al_Brown20-Mar-12 2:43
Al_Brown20-Mar-12 2:43 
GeneralRe: The Code Repeater Pin
hansoctantan14-Mar-12 6:12
professionalhansoctantan14-Mar-12 6:12 
GeneralRe: The Code Repeater Pin
krumia17-Mar-12 20:37
krumia17-Mar-12 20:37 
GeneralRe: The Code Repeater Pin
Stefan_Lang14-Mar-12 2:56
Stefan_Lang14-Mar-12 2:56 
GeneralRe: The Code Repeater PinPopular
Rahul Rajat Singh15-Mar-12 0:37
professionalRahul Rajat Singh15-Mar-12 0:37 
GeneralRe: The Code Repeater Pin
walterhevedeich15-Mar-12 19:59
professionalwalterhevedeich15-Mar-12 19:59 
GeneralRe: The Code Repeater Pin
SASS_Shooter1-May-12 6:07
SASS_Shooter1-May-12 6:07 
GeneralRe: The Code Repeater Pin
Sander Rossel19-Mar-12 11:21
professionalSander Rossel19-Mar-12 11:21 
GeneralRe: The Code Repeater Pin
JeremyBob26-Mar-12 22:26
JeremyBob26-Mar-12 22:26 
GeneralRe: The Code Repeater Pin
Stefan_Lang28-Mar-12 0:28
Stefan_Lang28-Mar-12 0:28 
GeneralN-Tier architecture PinPopular
virang_2112-Mar-12 18:08
virang_2112-Mar-12 18:08 
GeneralRe: N-Tier architecture Pin
RobCroll12-Mar-12 18:42
RobCroll12-Mar-12 18:42 
GeneralRe: N-Tier architecture Pin
virang_2112-Mar-12 19:06
virang_2112-Mar-12 19:06 
JokeRe: N-Tier architecture Pin
Shameel14-Mar-12 2:03
professionalShameel14-Mar-12 2:03 
GeneralRe: N-Tier architecture Pin
StM0n12-Mar-12 19:09
StM0n12-Mar-12 19:09 
GeneralRe: N-Tier architecture Pin
CDP180212-Mar-12 21:58
CDP180212-Mar-12 21:58 
GeneralRe: N-Tier architecture Pin
krumia17-Mar-12 20:44
krumia17-Mar-12 20:44 
GeneralRe: N-Tier architecture Pin
CDP180218-Mar-12 0:40
CDP180218-Mar-12 0:40 
A good candidate for that would be the data object itself. Just to take another example than simple validation: Let's say we have the common case that we need to store a password, which should be salted and hashed for security reasons. Why not put the method to do that into the data object? This way it can be ensured that the salting and hashing is done every time the password field of the data object is set. And this method can also be called to hash the string entered during login and then compare it to the value stored in the data object.

This may be contrary to the dogma that data objects are supposed to be simple containers for the data only, but in object oriented design it makes sense when an object has methods or properties to validate its state or make changes to its state.
I'm invincible, I can't be vinced



GeneralRe: N-Tier architecture Pin
Stefan_Lang14-Mar-12 2:58
Stefan_Lang14-Mar-12 2:58 
GeneralRe: N-Tier architecture Pin
Nitin20TechBLR15-Mar-12 18:26
Nitin20TechBLR15-Mar-12 18:26 
GeneralMicrosoft "help" PinPopular
Alan Balkany7-Mar-12 8:28
Alan Balkany7-Mar-12 8:28 
GeneralRe: Microsoft "help" PinPopular
Stefan_Lang8-Mar-12 3:41
Stefan_Lang8-Mar-12 3:41 
GeneralRe: Microsoft "help" Pin
cruest13-Mar-12 3:23
cruest13-Mar-12 3:23 

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.