Last post Apr 10, 2010 05:11 PM by hitchhiker999
Nov 07, 2009 08:17 PM|hitchhiker999|LINK
I run a handful of large websites using .net - I love .net, I love C#
In asp.net 4, please give us the name of the 'object reference' that's not set to an instance of an object :)
I beg you, my life would change, as so would many others. If you're worried about some reflection cost, or whatever, at least make detailed errors an option.
I appologise if this is already included, i couldn't search for it - the term is way too common!
Nov 08, 2009 02:53 AM|SGWellens|LINK
That's a great idea. However I'm guessing there are technical reasons it's not possible.
The line number of the exception is given and if you follow the practise of doing no more than one programming step per line of code, it's pretty obvious where the problem is.
Nov 08, 2009 09:55 AM|rtpHarry|LINK
Yeah that is a pretty good idea. When I saw the headline I thought it was going to be something like "make asp.net never get null references".
I wonder what the reason is that it hasn't been implemented....
Nov 08, 2009 12:21 PM|hitchhiker999|LINK
However I'm guessing there are technical reasons it's not possible.
Regarding line numbers, sometimes things fail within code you didn't write, code you dont even have access to.
I can think of a hundred reasons why I'd want it. I'm willing to bet many others have their own list.
Also, lurkers - you may want to digg this:
Nov 08, 2009 01:38 PM|SGWellens|LINK
Never assume something like that. This is computer software engineering - anything is (ofc) possible!
Sure anything is possible but at what cost? The extra baggage could slow the runtime down to a crawl.
If you write good code, it's not a problem.
One logical step per line of code. I would rather see the compiler modified to enforce this as a rule. Then, many programming 'problems' would be solved.
Nov 09, 2009 09:55 AM|hitchhiker999|LINK
The extra baggage could slow the runtime down to a crawl.
On one of my sites we're receiving 2,000,000 page requests a day. My site is complex, elegant and is written by myself and a team of newbies (though >3 years experience) who have found solutions to all the problems we've faced (one logical step at a time!)
I'm sure the amazingly intelligent and creative team at .NET can work out how to offset the minuscule cost involved, or even make it optional - as i suggested. I know I could.
Our company has fought away many coders who said 'well obviously it cant be done, as it's not there yet', or.. 'well, it's a nice idea but..' - if it's a nice idea we made it happen. We're careful, we're clean, and we're efficient and fast - so is our code.
I'm sure we could drag in another 200 people to say 'well, perhaps you should now place every line of code into a separate method, because you can see which method has failed' - no thanks. I'm sick of that, I don't use emacs, I've done this way too long
to ever again look at a blank screen that says 'Operation may destabilize the runtime' also. I hate bland error messages, and a lot of us do.
I use this stuff on the front line. My code is running on servers in clusters, far away from me, my debugger, my comfort zone, behind viciously hardened firewalls. It's precompiled, stripped of any debug conditions, it is running in production mode and I
haven't seen a line number in a stack trace in years. If i switched the production sites into debug mode I'd cause chaos. There are countless browsers, countless systems, countless combinations of external networks interacting in countless way:
And don't you think deploying .pdb files for line numbers has a performance hit in terms of storage space, lookups and deployment time for extensive networks!!!?
I don't want to see 'Object not set to instance of a reference' - I want to see
'xyz' not set to instance of a reference
I don't think it's too much to ask, and I know there are people inside .NET who could make it happen with their eyes closed and their hands tied behind their backs.
btw: this debate aside, great article of yours:
why sql updates fail - wish i'd read that a while back! :)
Nov 09, 2009 01:35 PM|SGWellens|LINK
Why do you think that feature isn't available now?
Nov 09, 2009 02:32 PM|hitchhiker999|LINK
Because it's not implemented yet.
The advantages far out weigh any perceived implementation issues. It's daft to assume something can't be done because it's not yet done. There'd be no computer science / arts / music / creation-in-general if that was the case?!
50$ says it's do-able. They're a hell of a team, and if it'll help the community it'll get done in one form or another.
Nov 09, 2009 02:43 PM|SGWellens|LINK
Because it's not implemented yet.
Nov 09, 2009 02:48 PM|hitchhiker999|LINK
Apr 01, 2010 11:56 PM|newbie2C#|LINK
This is an interesting post. SGWellens, why do you think this suggestion isn't implemented yet?
Apr 10, 2010 05:11 PM|hitchhiker999|LINK
(no answer I guess..)
I'm not a noob, been at this since the beginning. There's absolutely no reason this can't be implemented in debug mode, + it would save a lot of us a great deal of time during development.
OT: May I just add:
..to the list of interesting nonsense I've come across while optimising my .net 3.5 sites - This one happens when I merge large amounts of .dlls with the ILMERGE tool. Great.
Still a huge fan of 3.5 - mainly due to Generics & Linq.