Click here to Skip to main content
15,884,751 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.

 
GeneralConstructor reading Session Variables Pin
Richard A. Dalton8-Sep-10 0:48
Richard A. Dalton8-Sep-10 0:48 
GeneralRe: Constructor reading Session Variables Pin
GibbleCH8-Sep-10 3:52
GibbleCH8-Sep-10 3:52 
GeneralRe: Constructor reading Session Variables Pin
Richard A. Dalton8-Sep-10 4:08
Richard A. Dalton8-Sep-10 4:08 
GeneralRe: Constructor reading Session Variables Pin
hammerstein058-Sep-10 6:39
hammerstein058-Sep-10 6:39 
GeneralRe: Constructor reading Session Variables Pin
Kunal Chowdhury «IN»11-Sep-10 22:03
professionalKunal Chowdhury «IN»11-Sep-10 22:03 
GeneralRe: Constructor reading Session Variables Pin
PIEBALDconsult8-Sep-10 4:05
mvePIEBALDconsult8-Sep-10 4:05 
GeneralRe: Constructor reading Session Variables Pin
Ian Shlasko8-Sep-10 4:51
Ian Shlasko8-Sep-10 4:51 
GeneralRe: Constructor reading Session Variables Pin
Richard A. Dalton8-Sep-10 5:23
Richard A. Dalton8-Sep-10 5:23 
Both would be improvements.

I think the real horror and a very very common horror is the overuse and misuse of Session Variables.

These classes creating themselves from session variables are a symptom of that.

In reality if you have all these session variables, the class might as well not have any properties, since it then just turns around and writes it's properties to the DB.

Why not just write the Session variables to the DB?
Or why even bother with a class? If you're nailing your colors to the mast of Session variables then a Sub in a Module would do the same job.

Time for someone to write "Session Variables Considered Harmful"

Session variables are actually worse than traditional Global Variables, yet I rarely hear that much fuss about them.

In this day and age shouldn't we be required to declare Session Variables explicitly and also make them typesafe?

The more of other people's ASP.Net code that I have to maintain, the more I despise these little devils.

-Rd
GeneralRe: Constructor reading Session Variables Pin
CDP18029-Sep-10 0:55
CDP18029-Sep-10 0:55 
GeneralRe: Constructor reading Session Variables Pin
Andrew Rissing9-Sep-10 4:21
Andrew Rissing9-Sep-10 4:21 
GeneralRe: Constructor reading Session Variables Pin
Kunal Chowdhury «IN»11-Sep-10 22:02
professionalKunal Chowdhury «IN»11-Sep-10 22:02 
GeneralWhere is the exit? Pin
red_moon6-Sep-10 2:46
red_moon6-Sep-10 2:46 
GeneralRe: Where is the exit? Pin
DaveAuld6-Sep-10 3:16
professionalDaveAuld6-Sep-10 3:16 
GeneralRe: Where is the exit? Pin
red_moon6-Sep-10 6:42
red_moon6-Sep-10 6:42 
AnswerRe: Where is the exit? Pin
Kunal Chowdhury «IN»6-Sep-10 18:46
professionalKunal Chowdhury «IN»6-Sep-10 18:46 
GeneralRe: Where is the exit? Pin
DaveAuld7-Sep-10 23:47
professionalDaveAuld7-Sep-10 23:47 
GeneralRe: Where is the exit? Pin
Kunal Chowdhury «IN»7-Sep-10 23:50
professionalKunal Chowdhury «IN»7-Sep-10 23:50 
GeneralRe: Where is the exit? Pin
phil.o7-Sep-10 0:20
professionalphil.o7-Sep-10 0:20 
GeneralRe: Where is the exit? PinPopular
PIEBALDconsult6-Sep-10 5:23
mvePIEBALDconsult6-Sep-10 5:23 
GeneralRe: Where is the exit? Pin
OriginalGriff6-Sep-10 8:14
mveOriginalGriff6-Sep-10 8:14 
AnswerRe: Where is the exit? Pin
Luc Pattyn6-Sep-10 8:25
sitebuilderLuc Pattyn6-Sep-10 8:25 
GeneralRe: Where is the exit? Pin
OriginalGriff6-Sep-10 8:35
mveOriginalGriff6-Sep-10 8:35 
GeneralRe: Where is the exit? Pin
RugbyLeague7-Sep-10 3:57
RugbyLeague7-Sep-10 3:57 
JokeRe: Where is the exit? Pin
AspDotNetDev7-Sep-10 12:42
protectorAspDotNetDev7-Sep-10 12:42 
General65K Lines of Code Pin
ch3ckmat32-Sep-10 1:33
ch3ckmat32-Sep-10 1:33 

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.