Click here to Skip to main content
15,881,424 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 While If Pin
Nagy Vilmos19-May-09 22:11
professionalNagy Vilmos19-May-09 22:11 
GeneralRe: The While If Pin
PIEBALDconsult20-May-09 3:08
mvePIEBALDconsult20-May-09 3:08 
GeneralRe: The While If Pin
bolivar12322-May-09 9:05
bolivar12322-May-09 9:05 
GeneralConversion logic Pin
Jeroen De Dauw15-May-09 11:03
Jeroen De Dauw15-May-09 11:03 
RantRe: Conversion logic Pin
Samer Aburabie16-May-09 22:05
Samer Aburabie16-May-09 22:05 
GeneralRe: Conversion logic PinPopular
PIEBALDconsult17-May-09 3:20
mvePIEBALDconsult17-May-09 3:20 
GeneralRe: Conversion logic Pin
Samer Aburabie17-May-09 4:14
Samer Aburabie17-May-09 4:14 
GeneralJust a MessageBox :S [modified] Pin
Samer Aburabie15-May-09 5:12
Samer Aburabie15-May-09 5:12 
The other day I saw a code where the developer intended to check his code by displaying a message box in ASP.NET applicatoin if a condition is true, in order to accomplish this he refrenced the System.Windows.Forms assembly and called the MessageBox to display his message.

When running the code, it actually worked !! and displayed the message successfully !!!

I freezed when I saw this ! How come a windows form control message box is displayed on the browser ?!

Actually it makes all the sense to be displayed from a technical point of view ... but it will create a disaster when its really used !!! what actually happens is that when the MessageBox is displayed the thread of the process is freezed until the User clicks ok !!!! and what user is that ... figured out the trick ?!!?

Let me give an example : the application on server ABC and some user on machine xyz is browsing the application, now when he faces the condition and the message should be displayed it will not be displayed to XYZ User !!! it will be displayed on ABC server since its a server side call !!!!

Now he had no clue about that because he was in development time on his machine, and his machine in debugging is the server as well, so he was able to see the message box with no problem Smile | :)

It's a codding horror no doubt ... but it makes an asp.net developer thinks more realistic and deeper on the behaviour of his own applications !!!


Sincerely Samer Abu Rabie

Imagination is more important than knowledge !

modified on Sunday, May 17, 2009 3:59 AM

GeneralRe: Just a MessageBox :S Pin
PIEBALDconsult15-May-09 10:33
mvePIEBALDconsult15-May-09 10:33 
GeneralRe: Just a MessageBox :S Pin
Jeroen De Dauw15-May-09 10:54
Jeroen De Dauw15-May-09 10:54 
GeneralRe: Just a MessageBox :S PinPopular
J4amieC21-May-09 1:19
J4amieC21-May-09 1:19 
GeneralRe: Just a MessageBox :S Pin
BillW3311-Aug-09 8:11
professionalBillW3311-Aug-09 8:11 
JokeFalls under worse practices..maybe? I don't know. Pin
puromtec114-May-09 6:59
puromtec114-May-09 6:59 
GeneralRe: Falls under worse practices..maybe? I don't know. Pin
Chris Meech14-May-09 8:15
Chris Meech14-May-09 8:15 
GeneralRe: Falls under worse practices..maybe? I don't know. Pin
PIEBALDconsult14-May-09 12:52
mvePIEBALDconsult14-May-09 12:52 
GeneralWho is teaching these people? PinPopular
OriginalGriff12-May-09 22:50
mveOriginalGriff12-May-09 22:50 
GeneralRe: Who is teaching these people? Pin
zlezj12-May-09 23:14
zlezj12-May-09 23:14 
GeneralRe: Who is teaching these people? Pin
Michael Bookatz12-May-09 23:20
Michael Bookatz12-May-09 23:20 
GeneralRe: Who is teaching these people? Pin
0x3c013-May-09 0:10
0x3c013-May-09 0:10 
GeneralRe: Who is teaching these people? Pin
Mycroft Holmes13-May-09 0:57
professionalMycroft Holmes13-May-09 0:57 
GeneralRe: Who is teaching these people? Pin
0x3c013-May-09 1:17
0x3c013-May-09 1:17 
GeneralRe: Who is teaching these people? Pin
OriginalGriff13-May-09 8:59
mveOriginalGriff13-May-09 8:59 
GeneralRe: Who is teaching these people? Pin
PIEBALDconsult13-May-09 3:31
mvePIEBALDconsult13-May-09 3:31 
GeneralRe: Who is teaching these people? Pin
VentsyV13-May-09 8:03
VentsyV13-May-09 8:03 
GeneralRe: Who is teaching these people? Pin
I am BATMAN13-May-09 8:22
I am BATMAN13-May-09 8:22 

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.