4 ms·
> For those of you unwise in the ways of programming, the problem is that “null” is one of those famously “reserved” text strings in many programming languages.
by BinaryIdiot 10y ago
> For those of you unwise in the ways of programming, the problem is that “null” is one of those famously “reserved” text strings in many programming languages.
It's not a text string but there are some systems that present it as such and those are the issue. Lazy programming. I remember back working for a financial institution and was told to add some validation to a service that handled adding investment plans to someone's account. The third party service we had to use was using SOAP and NULL values were represented by, you guessed it, simply putting the NULL value in the XML instead of simply omitting the item itself.
No amount of protest would make the third party service change the way it worked. "It's always worked like that and we haven't had an issue" and the "if we changed it thousands of our customers would be negatively affected! We can't do that!" were the primary excuses.
- colejohnson66 10y agoPretty much any language that evaluates this as true: "null" == null
- deleted 10y ago[deleted]
- eeZi 10y agoPython doesn't, and any language that evaluates this as true is crazy. Not even JavaScript does this.
- eyelidlessness 10y agoNot even PHP (it took me about 10 minutes to remember how to PHP before I could test it to be sure).
- ht85 10y agoWhat's the difference between yourself and a Wordpress plugin? None, doing things in PHP makes you really insecure.
- deathanatos 10y agoIt is — sort of — in both. It happens by programmers who are getting superstitious about what the actual type of a variable they have is, and `str()` it. Then they "know" what they're working with. (Alas, the string "None" or "null".)
- city41 10y agoThe only time I can think of that happening is poorly written SQL queries built out of concatenating strings. And if a system is doing that it has far bigger problems than the last name "Null"
- deleted 10y ago[deleted]
- WalterBright 10y agoNot C, C++, or D.
- ec109685 10y agoThis is silly. Not even this is true in many languages null == null
- BillinghamJ 10y agoBased on the replies you've received, I'd say that actually there is a very small minority list of languages which do this.