Click here to Skip to main content
15,897,273 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: Constants definitions Pin
Dr. Emmett Brown10-Dec-07 14:46
Dr. Emmett Brown10-Dec-07 14:46 
GeneralRe: Constants definitions Pin
PIEBALDconsult10-Dec-07 15:39
mvePIEBALDconsult10-Dec-07 15:39 
GeneralRe: Constants definitions Pin
KarstenK12-Dec-07 22:42
mveKarstenK12-Dec-07 22:42 
GeneralRe: Constants definitions Pin
supercat911-Dec-07 9:07
supercat911-Dec-07 9:07 
GeneralRe: Constants definitions Pin
Frank Dawson10-Dec-07 15:25
Frank Dawson10-Dec-07 15:25 
GeneralRe: Constants definitions Pin
KarstenK12-Dec-07 22:47
mveKarstenK12-Dec-07 22:47 
GeneralRe: Constants definitions Pin
CurtD13-Dec-07 13:05
CurtD13-Dec-07 13:05 
GeneralThis one made me sigh Pin
CARPETBURNER6-Dec-07 0:40
CARPETBURNER6-Dec-07 0:40 
Just compiled a project from our Outsourcing Contrators... Now this apparently works according to them and they feel its ready to be deployed.. Got 10 Fatal Errors and 200 Warnings Frown | :-(

Its not that thats got me though, the code snippet below kinda flies in the face of logic and good practice.. Couple of questions here then... Firstly Why is it a function? And secondly why doesnt it return a value.. Bear in mind this code snippet is run on every page on page_load and has been copied and pasted across the site.

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs)<br />
Validsession()<br />
End Sub<br />
<br />
Public Function validSEssion()<br />
<br />
if session("username")="" then response.redirect("\Logout.aspx")<br />
<br />
End Function


On going through the code a bit more I noticed that 90% of it is Function's that dont return any values.. There are no Subs!!
GeneralRe: This one made me sigh Pin
Sathesh Sakthivel6-Dec-07 1:49
Sathesh Sakthivel6-Dec-07 1:49 
GeneralRe: This one made me sigh Pin
Russell Jones6-Dec-07 2:51
Russell Jones6-Dec-07 2:51 
GeneralRe: This one made me sigh Pin
Mike Dimmick6-Dec-07 22:59
Mike Dimmick6-Dec-07 22:59 
GeneralRe: This one made me sigh Pin
Ri Qen-Sin7-Dec-07 5:10
Ri Qen-Sin7-Dec-07 5:10 
GeneralRe: This one made me sigh Pin
Jeffrey Walton7-Dec-07 22:03
Jeffrey Walton7-Dec-07 22:03 
GeneralRe: This one made me sigh Pin
Paul Conrad8-Dec-07 5:05
professionalPaul Conrad8-Dec-07 5:05 
GeneralThe holy comma operator [modified] Pin
Doc Lobster26-Nov-07 2:47
Doc Lobster26-Nov-07 2:47 
GeneralRe: The holy comma operator Pin
Steve Hansen26-Nov-07 4:36
Steve Hansen26-Nov-07 4:36 
GeneralRe: The holy comma operator Pin
jhwurmbach26-Nov-07 5:20
jhwurmbach26-Nov-07 5:20 
GeneralRe: The holy comma operator Pin
Kastellanos Nikos27-Nov-07 22:40
Kastellanos Nikos27-Nov-07 22:40 
GeneralRe: The holy comma operator Pin
Tony Wesley26-Nov-07 5:26
Tony Wesley26-Nov-07 5:26 
GeneralRe: The holy comma operator Pin
Doc Lobster26-Nov-07 6:35
Doc Lobster26-Nov-07 6:35 
GeneralRe: The holy comma operator Pin
Nemanja Trifunovic26-Nov-07 6:53
Nemanja Trifunovic26-Nov-07 6:53 
GeneralRe: The holy comma operator Pin
Chris Losinger26-Nov-07 7:15
professionalChris Losinger26-Nov-07 7:15 
GeneralRe: The holy comma operator Pin
Michael Dunn27-Nov-07 16:47
sitebuilderMichael Dunn27-Nov-07 16:47 
GeneralRe: The holy comma operator Pin
Anthony Mushrow27-Nov-07 2:38
professionalAnthony Mushrow27-Nov-07 2:38 
GeneralRe: The holy comma operator Pin
Michael Davey 127-Nov-07 12:08
Michael Davey 127-Nov-07 12:08 

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.