4 ms·
NULL Is the Worst Mistake in Computer Science
- jetti 10y agoI was listening to a podcast on Dot Net Rocks where they were talking about Haskell and how it doesn't have nulls and has option types (Some/None) instead. The thing is, that isn't much different from nulls, you have to check if there is a Some or a None just like you have to check for nulls. Now, the program may not blow up but it isn't like Some/None save you any time. How do Some/None fit into the scheme of declare objects, typically on the heap? Null means no value indicating that the object has not been initialized yet (I'm using C# as my basis for this) so what should it be, None(type)? I don't think NULLS are necessarily bad but just like the "evil" goto it has to be handled correctly in order to not be a problem