Click here to Skip to main content
15,912,400 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: A class on UI design... Pin
daniilzol16-Oct-07 6:47
daniilzol16-Oct-07 6:47 
GeneralRe: A class on UI design... Pin
Dave Kreskowiak16-Oct-07 6:51
mveDave Kreskowiak16-Oct-07 6:51 
GeneralRe: A class on UI design... Pin
Patrick Etc.16-Oct-07 7:39
Patrick Etc.16-Oct-07 7:39 
GeneralRe: A class on UI design... Pin
W Balboos, GHB19-Oct-07 4:03
W Balboos, GHB19-Oct-07 4:03 
GeneralRe: A class on UI design... Pin
Pete O'Hanlon21-Oct-07 9:51
mvePete O'Hanlon21-Oct-07 9:51 
GeneralRe: A class on UI design... Pin
Anton Afanasyev21-Oct-07 18:47
Anton Afanasyev21-Oct-07 18:47 
GeneralRe: A class on UI design... Pin
mgoeppner18-Oct-07 4:39
mgoeppner18-Oct-07 4:39 
GeneralExcellent stored procedure Pin
eggsovereasy10-Oct-07 9:27
eggsovereasy10-Oct-07 9:27 
GeneralRe: Excellent stored procedure Pin
leppie10-Oct-07 22:15
leppie10-Oct-07 22:15 
GeneralRe: Excellent stored procedure Pin
Xiangyang Liu 刘向阳11-Oct-07 6:21
Xiangyang Liu 刘向阳11-Oct-07 6:21 
GeneralRe: Excellent stored procedure Pin
eggsovereasy11-Oct-07 8:53
eggsovereasy11-Oct-07 8:53 
GeneralRe: Excellent stored procedure Pin
Xiangyang Liu 刘向阳11-Oct-07 9:57
Xiangyang Liu 刘向阳11-Oct-07 9:57 
GeneralRe: Excellent stored procedure Pin
KarstenK23-Oct-07 0:39
mveKarstenK23-Oct-07 0:39 
GeneralSetFocus to a control that is probably disabled Pin
MarcR.10-Oct-07 7:09
professionalMarcR.10-Oct-07 7:09 
GeneralRe: SetFocus to a control that is probably disabled Pin
Dave Kreskowiak10-Oct-07 7:14
mveDave Kreskowiak10-Oct-07 7:14 
GeneralRe: SetFocus to a control that is probably disabled Pin
MarcR.10-Oct-07 7:51
professionalMarcR.10-Oct-07 7:51 
JokeRe: SetFocus to a control that is probably disabled Pin
Big Daddy Farang10-Oct-07 12:53
Big Daddy Farang10-Oct-07 12:53 
GeneralRe: SetFocus to a control that is probably disabled Pin
NormDroid11-Oct-07 4:13
professionalNormDroid11-Oct-07 4:13 
GeneralRe: SetFocus to a control that is probably disabled Pin
Ganesan Sankaran19-Oct-07 1:59
Ganesan Sankaran19-Oct-07 1:59 
GeneralRe: SetFocus to a control that is probably disabled Pin
BrowniePoints22-Oct-07 15:43
BrowniePoints22-Oct-07 15:43 
GeneralSo stingy! Pin
Muammar©7-Oct-07 0:48
Muammar©7-Oct-07 0:48 
GeneralWho needs event handlers... Pin
FyreWyrm5-Oct-07 16:31
FyreWyrm5-Oct-07 16:31 
...do it all in Page_Load!

My company recently purchased a smaller company and our development department took over developing their web applications. My first task was to put a new user control on a few pages in one of the apps. While working on the first page I noticed something a bit odd...

(Sorry for the VB. In my defense, I didn't write the app.)
Private Sub Page_Load(blah, blah) Handles Page.OnLoad

   ' create some objects, initialize some variables

   If Page.IsPostBack
      ' validate the user input
      ValidateInput()
      ' save the user input to the database
      SaveInput()
   End If

End Sub


Farther down in the code I find this...

Private Sub Submit_Click(obj, args) Handles btnSubmit.OnClick

   ' direct the user to the new page
   Response.Redirect(page.aspx)

End Sub


WTF | :WTF:


Smile and the world smiles with you. Laugh and the world thinks your insane.

GeneralRe: Who needs event handlers... Pin
Anton Afanasyev5-Oct-07 22:24
Anton Afanasyev5-Oct-07 22:24 
GeneralRe: Who needs event handlers... Pin
Mustafa Ismail Mustafa10-Oct-07 0:23
Mustafa Ismail Mustafa10-Oct-07 0:23 
GeneralNew basic syntax Pin
bigbrownbeaver5-Oct-07 1:56
bigbrownbeaver5-Oct-07 1:56 

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.