Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
willol13898yIt's not hard, it's impossible! If it's null, it means that there is no object. There is no such thing as "an object that is null"
-
cjbatz14718y@willol I beg to differ :)
If my code says use the object 'ObjSomething' and ObjSomething is null, the compiler should know that I'm asking for ObjSomething and then tell me that ObjSomething is Null. I don't need it to tell me what type of object ObjSomething is, only which object it was trying to use when the null error occurred. -
willol13898y@cjbatz "ObjSomething" is just a name for humans, it doesn't exist once the code is compiled in machine code! You just have chunks of memory
Implementing a system to keep track of each variable in the original source code would very hard, and costly at runtime :) -
Grumpy28878yWhen asked if there was something that C# could do, but F# could not, one of the F# heavy weights (I think it was Petricek) answered "Null pointer exceptions!".
(Of course, you can force F# to have null pointers because of C# and C++ interoperability, but in idiomatic F# or Haskell, there are no such things as null values.) -
Grumpy28878y@mocrosoft I hope you meant unit testing? Debugging doesn't save time, it's time you have to spend because of the mistakes that unit tests could have saved you from.
-
Its hard and damn you should appreciate people who build Compilers.They are the guys who have to deal with shitty code.
-
Yep it's fucking hard, even the compiler doesn't know what object it is dealing with. It just knows you asked for something at some part of the memory that was not there.
-
Grumpy28878y@aswinmohanme ...because the compiler runs at compile time (duh...) when there are no instantiated objects at all, whereas the problem the OP has is a runtime problem
Runtime != compile time. -
cjbatz14717yUpdate : Big up respect to the Visual Studio 2017 team for Exception Helper that tells you which object is null!
Related Rants
To the people that create compilers.
Is it so goddam hard to tell me which fucking object is Null?
undefined
development
errors