Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I think it would be nice if `NOT NULL` was set by default on columns. However there are a lot of legitimate use cases that can't be (practically) solved by restructuring.

Data can be incomplete. Maybe only because it is not (yet) known. If NULL values were impossible it would create the need for one additional table with a foreign key relationship for every attribute that can be independently NULL. Sometimes this pattern is a good idea, but I don't think I can be convinced it should be the only possible solution.




>I think it would be nice if `NOT NULL` was set by default on columns

Then make sure to have explicit defaults?


"Explicit" defaults are still quite implicit. Usually what I want is an error if I fail to provide a required value, not any kind of silent default, null or otherwise.




Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: