3 ms·
Two problems here: One not only is the example backwards, but given the previous behavior, the correct thing would have occurred. This is a complete nitpick bu
by mhurron 13y ago
Two problems here:
One not only is the example backwards, but given the previous behavior, the correct thing would have occurred. This is a complete nitpick but whatever.
More importantly, this shows a lack of understanding about the framework being used, not an issue with the framework. The example has a programmer basically assuming the default is False when it was True, or more correctly that the default was not True. That is an issue with the programmer (and testing) not with the framework, unless it was undocumented. Django is documented quite well. The programmer here assumed something worked one way that was clearly documented to work the other.
Booleans defaulting to False is not unusual, but not universal either. Django has chosen to go the path of explicitness, which is a fine choice to make, as opposed to defaulting to False which is often considered to be a safe choice. I don't see a problem with not assigning a default, but I also don't see a problem with the default being False.
Defaulting to NULL could cause other problems, at least for the programmer above who didn't read documentation and worked on assumption.
- daGrevis 13y agoThings should make sense without reading documentation (I'm not saying that you don't need to read it) and boolean having a default doesn't make any sense. Argument about it having a default value in other frameworks isn't a real argument either.