Click here to Skip to main content
15,887,135 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: well... Pin
Pete O'Hanlon25-Sep-12 9:53
mvePete O'Hanlon25-Sep-12 9:53 
GeneralRe: well... Pin
shiprat29-Oct-12 12:56
shiprat29-Oct-12 12:56 
GeneralRe: Happy debugging! Pin
Member 822285825-Sep-12 10:03
Member 822285825-Sep-12 10:03 
GeneralRe: Happy debugging! Pin
Richard Deeming26-Sep-12 3:56
mveRichard Deeming26-Sep-12 3:56 
GeneralRe: Happy debugging! Pin
Amit Developer26-Sep-12 4:28
Amit Developer26-Sep-12 4:28 
GeneralRe: Happy debugging! Pin
Le centriste26-Sep-12 6:43
Le centriste26-Sep-12 6:43 
GeneralRe: Happy debugging! Pin
greldak27-Sep-12 21:51
greldak27-Sep-12 21:51 
GeneralRe: Happy debugging! Pin
dojohansen28-Sep-12 3:58
dojohansen28-Sep-12 3:58 
FAIL.

Sorry to be a party pooper, but your evil intentions would not be fulfilled by that. You haven't overridden the GetType method. You've hidden it. And that means the compiler will only bind to the implementation if invoked on a reference of type TheClass. And it's unlikely anyone would call GetType on the thing if it's already declared to be TheClass (although the run-time type of course could be a descendant).

So, since GetType isn't virtual it'd still return "TheClass" and your colleague would go to the code and see that you've attempted to fool him. (If you guys have decent source control anyway.)

I do sympathize with your sentiments though. But frankly it is often the project managers who are at fault, because rather than foster a culture where mistakes are openly discussed, not for the purpose of punishment but for education, they tend to reward people who "are positive". In my experience that's often people who aren't competent enough to see the myriad things that are usually F-ed up in... well, any codebase I've come across.
GeneralRe: Happy debugging! Pin
zenwalker19859-Oct-12 18:04
zenwalker19859-Oct-12 18:04 
GeneralRe: Happy debugging! Pin
Nitin S4-Dec-12 1:31
professionalNitin S4-Dec-12 1:31 
GeneralCut out for Greenpeace... PinPopular
Sander Rossel21-Sep-12 22:27
professionalSander Rossel21-Sep-12 22:27 
GeneralRe: Cut out for Greenpeace... Pin
AspDotNetDev24-Sep-12 6:09
protectorAspDotNetDev24-Sep-12 6:09 
GeneralRe: Cut out for Greenpeace... Pin
Sander Rossel24-Sep-12 8:06
professionalSander Rossel24-Sep-12 8:06 
GeneralRe: Cut out for Greenpeace... Pin
BillW3318-Oct-12 8:19
professionalBillW3318-Oct-12 8:19 
GeneralRefactor Pin
Clifford Nelson26-Sep-12 5:49
Clifford Nelson26-Sep-12 5:49 
GeneralRe: Cut out for Greenpeace... Pin
BillW3318-Oct-12 8:23
professionalBillW3318-Oct-12 8:23 
GeneralRe: Cut out for Greenpeace... Pin
Sander Rossel18-Oct-12 8:38
professionalSander Rossel18-Oct-12 8:38 
GeneralRe: Cut out for Greenpeace... Pin
BillW3322-Oct-12 3:11
professionalBillW3322-Oct-12 3:11 
GeneralThey grow up so fast.. PinPopular
jim lahey19-Sep-12 23:03
jim lahey19-Sep-12 23:03 
GeneralRe: They grow up so fast.. Pin
fjdiewornncalwe20-Sep-12 4:55
professionalfjdiewornncalwe20-Sep-12 4:55 
GeneralRe: They grow up so fast.. PinPopular
BobJanova20-Sep-12 5:24
BobJanova20-Sep-12 5:24 
GeneralRe: They grow up so fast.. PinPopular
AspDotNetDev21-Sep-12 6:37
protectorAspDotNetDev21-Sep-12 6:37 
GeneralRe: They grow up so fast.. Pin
jim lahey21-Sep-12 7:10
jim lahey21-Sep-12 7:10 
GeneralRe: They grow up so fast.. Pin
Sander Rossel21-Sep-12 22:04
professionalSander Rossel21-Sep-12 22:04 
GeneralRe: They grow up so fast.. Pin
zenwalker19859-Oct-12 18:07
zenwalker19859-Oct-12 18:07 

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.