3 ms·
You're gonna need nulls until databases stop supporting nulls. And everyone would need to use 6th normal form for that to happen, and nobody wants that
by elchief 10y ago
You're gonna need nulls until databases stop supporting nulls. And everyone would need to use 6th normal form for that to happen, and nobody wants that
- danielnixon 10y agoNot true. Nullable values in a database can be dealt with (and I would argue _should_ be dealt with) using a maybe/option[1] type. This is exactly what Slick[2] does, for example. [1] https://en.wikipedia.org/wiki/Option_type https://en.wikipedia.org/wiki/Option_type [2] http://slick.lightbend.com/ http://slick.lightbend.com/
- bubaflub 10y agoCould you explain why you believe the presence of a NULL in the database necessitates a NULL pointer somewhere in the code?
- andrewguenther 10y agoI believe the author's intent is if you read a null value out of a database, how would you represent it in code?
- deleted 10y ago[deleted]
- bubaflub 10y agoI think it depends on where the NULL is and what it represents. If NULL value is in a field that is used for JOIN-ing, I don't think you would "represent" the NULL value as much as you would simply have a lack of data. For example, if you had some set of results from a query that contained a JOIN on a field and some values were NULL, those records with the NULL value would not be in the result set. If we do receive results with possibly NULL values I believe they could be either be represented with an appropriate zero value -- e.g. "" or 0 -- or with an optional type like another commenter suggested.
- IncRnd 10y agoNull references to memory are what is being discussed, which is completely different from variant/option types. Changing databases has nothing to do with NULL references to memory.
- bbcbasic 10y ago.NET uses DBNull.Value, which is not null. Also 6th normal form?? What is that?
- lgas 10y agoYou store each letter in the names of the columns of your tables in a different data center.
- icebraining 10y agohttps://en.wikipedia.org/wiki/Sixth_normal_form https://en.wikipedia.org/wiki/Sixth_normal_form Not something I'd like to use.
- achr2 10y agoI work with an engineering application that uses a 5th/6th normal form database that is implemented in standard SQL server/Oracle DBs. It is awful and painful. A simple query with maybe five properties and 2 relationships takes upwards of 20 joins. Yet the database only has 4 tables...