18 ms·
Hello, I’m Mr. Null. My Name Makes Me Invisible to Computers
- wglb 10y agoOne more item for the list: https://www.kalzumeus.com/2010/06/17/falsehoods-programmers-believe-about-names/ https://www.kalzumeus.com/2010/06/17/falsehoods-programmers-...
- ryandrake 10y agoI love the "Falsehoods programmers believe about X" articles. They are basically ready-made failure test cases. Whenever a junior co-worker would say something like "I know! I'll just write our own date and time handling code." I'd point him at [1], let him stew on that for an hour or so, and then, sure enough, go back and lo and behold he's convinced to just use a ready-made third party library instead. 1: http://infiniteundo.com/post/25326999628/falsehoods-programmers-believe-about-time http://infiniteundo.com/post/25326999628/falsehoods-programm...
- ryankupyn 10y agoPoor time-handling also have big consequences as well. In Nevada, for example, overtime calculations use a rolling 24-hour period, and as a result many workers are incorrectly paid each year because their employer's system doesn't account for DST changes.
- Meekro 10y agoI'm all for good testing, and for encouraging programmers to think more carefully, but most of these items strike me as needlessly pedantic. My goal is to build software that works in practice. If I have the time to build in edge cases that accommodate super-minorities, I'll probably start by fixing my app in IE6 to pick up that extra 2%. My guess is that'll be a bigger uptick in signups than I'll get for somehow handling names that can't be represented by "all Unicode code points." If you live in the U.S. and your name can't be represented by 7-bit ASCII (forget Unicode!), you've probably had to adopt an alternate name that can, or else you've spent a good chunk of your life banging your head against every private and public company that needs you to fill out a form. When you sign up for my app, you'll probably use that alternate name out of habit.
- syntheticnature 10y agoYour points best apply to situations where the end user is the same as the person named. While this may seem to be the case for most web applications, let's note the interesting results on, say, Facebook when trying to even search for already-made friends whose '7-bit use names' might not be the ones you expect. (In fact, I recall odd results from Facebook when searching without accents, which are generally require special attention to enter on a US keyboard.) Further, if you live in the US doesn't mean you've lived there long. Are you ready to cope when the user hasn't settled on, or perhaps even understands, the need for said use name? Heck, US population is 4.4% -- who's focused on super-minorities, now?
- martinko 10y agoMeh, in what language does ('Null'==Null) evaluate to true?
- dagw 10y agoIt doesn't have to be at the language level. It's not unreasonable to assume that someone, somewhere in the mists of time decided that the string "NULL" was a reasonable choice for representing missing data in some input data and things kind of snowballed from there.
- gtf21 10y agoI've seen this in code I've reviewed before, where people will check for `== "empty"` instead of just using types like `null` which were designed for this (in javascript).
- kqr 10y agoA practise that may come from some shell scripting languages where `[ $x == "" ]` is an invalid command because empty strings aren't strings.
- _kst_ 10y agoThat may be true in older shells, but in modern shells [ $x == "" ] is valid, and "" is a single token whose value is the empty string. But I've seen old code that does things like if [ x$x == "x" ] ; then ... apparently because it was necessary at one time.
- kqr 10y agoIt depends on what you mean by "older" shells. More modern shells tend to support this properly, but the baseline for most shell scripts is /bin/sh which is not guaranteed to be modern – it is often a new release of Sh.
- astrodust 10y ago
- Normal_gaussian 10y agoType coercion and a misguided approach to removing character counts is a pain. It is embarrassing how little of the code I have seen uses type unions either explicitly or implicitly. How often crucial checks and balances are removed for example or test code. How often copy and paste is used over abstract. This is an embarrassment to all of us, and I am not sure that it is absent from my work.
- eyelidlessness 10y agoWhatever you may think of `null` (ahem https://en.wikipedia.org/wiki/Tony_Hoare#Apologies_and_retractions https://en.wikipedia.org/wiki/Tony_Hoare#Apologies_and_retra...), it is not a string type. It is horrifying to me that all of the problems described in the article are cases of allowing a user to execute arbitrary code by string input, and the article fails to point this out.
- martinko 10y agoType coercion does not necessarily imply the contents were execute as code.
- eyelidlessness 10y agoI'm not aware of any language that coerces the string `'null'` to the value `null`. Are you aware of any?
- DougBTX 10y agoA badly coded website could go in the other direction, eg in JS, someone writes a poor string equality check: function normalise(s) { return (s + "").toLowerCase(); } function isEqual(a, b) { return normalise(a) == normalise(b); } And then someone else uses it in some form validation logic: if (isEqual(surname, null)) { return error; }
- jerf 10y agoThen as the next step, some programmer somewhere notices that all the NULLs in the database have been converted into strings somewhere, and puts UPDATE table SET column = NULL WHERE column = "NULL" somewhere, maybe even in a trigger, and that's that. The problem with data destruction is that only one thing in the entire data pipeline has to spuriously map two distinct values to the same output value, and the data is destroyed and can not be recovered. Very few programmers think carefully about whether a serialization or data transfer format maps every single possible input to a different output. It may only take one oversight to ruin your year.
- guessmyname 10y agoIsn't a name in a database and/or variable just a string? How can it become the data type Null without a literal casting? Is this just affecting scripting languages?
- brian-armstrong 10y agoScripting languages shouldn't be confused by this either
- eddieh 10y agoI think you underestimate how much stuff relies on string concatenation or string interpolation to build SQL statements that are also case-insensitive by nature. Yes, people should probably use an ORM and yes they should properly quote input, but so much code exists that doesn't. Even a strongly typed host language doesn't preclude stringly typed SQL.
- elygre 10y agoNo, people shouldn't quote input. They should bind input.
- eddieh 10y agoPlease explain! I assume you mean bind to a type, but how does that help when you build a SQL statement? Surely whatever type you use has a 'toString' (or language equivalent) that is explicitly or implicitly used with string concatenation or string interpolation.
- DougWebb 10y agoYou build your SQL statement using named parameters for the values you're going to pass in, and you use your database's client API to create a command and bind parameter values to it. Then you ask the API to execute the command. The binding step accepts values in your language's native data types, and handles conversions to the database's data types for you in a safe manner.
- brian-armstrong 10y agoThe comments on wired shed some light on what might be happening, that legacy systems used the string 'NULL' to represent null and now the legacy data has intermingled and can't be cleaned up. Gross! This guy is basically a walking fuzzer on forms and input systems. He could find vulnerabilities without actually doing anything illegal ;)
- deleted 10y ago[deleted]
- mikeash 10y agoLots of Irish people are walking SQL injection testers, and don't even know it.
- darkhorn 10y agoAnd people from The Hague.
- mrsuprawsm 10y agoas in "'s Gravenhage"?
- darkhorn 10y agoYes. https://en.m.wiktionary.org/wiki/%27s-Gravenhage https://en.m.wiktionary.org/wiki/%27s-Gravenhage
- woliveirajr 10y agoThat made my day.
- plasticchris 10y agoWired must listen to NPR http://www.npr.org/2016/04/02/472716929/bluff-the-listener http://www.npr.org/2016/04/02/472716929/bluff-the-listener Edit: or the other way around if you read the dates...
- chmaynard 10y agoThis is the funniest article I have ever read on HN. Christopher Null, you are a wonderful humorist and you may be destined for immortality (at least in some circles).
- deleted 10y ago[deleted]
- 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.
- coding123 10y agoFor those thinking that only a complete idiot would consume the string null vs the value null when processing form input, you're pretty much correct. Most languages, even scripting ones, don't rely on the value of the string, but of the value of the reference. And while there are probably many web-front ends that happily work with "null" as a field, that's likely not the issue here. The issue that will most likely strike are all of the assumptions that your front-end team don't care about- downstream systems. This typically comes from software that is packaged for explicit purposes. In Healthcare we have things called MPIs (master patient index) and as a rule we typically have data scrubbers because in the MPI world we HAVE to work with bad data, self-entered data. We don't have the luxury of relying on primary keys for everything. Names like "Baby Smith" often comes in as the yet-to-be-named baby of the Smith family. I won't go into HealthIT 101 here, but suffice to say, we must do a lot of data scrubbing and/or annotation. What compounds the issue even more is that most of these software components, be it healthcare or other industries, are typically resold and therefore have customers that keep piling on more and more use-cases. There are solutions to the problems, but many of them involve breaking human-end workflows (how do you tell a customer that you'll now require every patient to remember their patient ID, for example, before you admit them?). Those workflow changes tend to be non-starters and from there, the chain of never-ending bad coding compromises enter the scene. Now I'm not defending the practice of treating "baby" or "null" or any other string as a special case, but being part of some of these workflow issues for years has led me to believe that not only are coders around the world going to continue these practices, there's not much they can do about them until more and more of our software gets more built-in intelligence. Maybe in the future we can actually detect it better when the name "baby" actually is their first name! (And actually with all of the deep learning going on lately, I'd imagine someone is building something like this now!) All I'm saying is that it takes a broader understanding of the issue here to fully get why it's not just a front-end coder's error, but rather a deeper, as-of-now hard to solve problem. Think about when you start integrating with outside systems that don't follow your organization's understanding of a name. What about when you get into analytics? When you connect to external systems that performs mailings? Do YOU know the assumptions and use-cases that went into the platforms you're about to hop on board with? Probably not all of them.
- DanBC 10y agoThe other version of this is the stack exchange question. An employee, whose last name is Null, kills our employee lookup: https://news.ycombinator.com/item?id=3900224 https://news.ycombinator.com/item?id=3900224 We have an employee whose last name is Null. He kills our employee lookup (2012): https://news.ycombinator.com/item?id=6140631 https://news.ycombinator.com/item?id=6140631
- aerovistae 10y agoAny site that registers his last name as a problem is vulnerable to SQL injection, no? Doesn't make sense to me that he says most big companies have a problem with his last name; they generally do not have this vulnerability.
- Hondor 10y agoBig companies probably have more pieces of software that increase the chance of one of them having trouble with null, or they're overly cautious because they know they have that risk.
- beached_whale 10y agoWhen it comes to email validate, wow why. But if you have to validate whether the recipient gets the email. You will have to do this either way. If you still want to do more, validate the hostname against dns as that can be quick and compared to a typist is not a performance issue(don't forget idn). If you still want to do more, you are only really left with size checks and a few control characters. https://github.com/beached/validate_email https://github.com/beached/validate_email is about what I think is the most one should validate without sending an email you have to send anyways
- modernerd 10y agoTony Hoare, null's creator, regrets its invention: “I call it my billion-dollar mistake. It was the invention of the null reference in 1965. At that time, I was designing the first comprehensive type system for references in an object oriented language (ALGOL W). My goal was to ensure that all use of references should be absolutely safe, with checking performed automatically by the compiler. But I couldn't resist the temptation to put in a null reference, simply because it was so easy to implement. This has led to innumerable errors, vulnerabilities, and system crashes, which have probably caused a billion dollars of pain and damage in the last forty years.” https://en.wikipedia.org/wiki/Tony_Hoare#Apologies_and_retractions https://en.wikipedia.org/wiki/Tony_Hoare#Apologies_and_retra... https://www.infoq.com/presentations/Null-References-The-Billion-Dollar-Mistake-Tony-Hoare https://www.infoq.com/presentations/Null-References-The-Bill...
- brobinson 10y agoIncluding "null" is one of the most unfortunate things about Go. I'm glad to see that other modern languages (Swift, Rust, and so on) are avoiding it.
- biztos 10y agoI too find it annoying in Go, though I'm not sure what the default value of a reference in a struct would be otherwise. However, I do see the value of NULL in a database context even though it makes database interfaces harder -- especially in Go, where the standard marshaling paradigm means anything NULLable has to be a reference and thus have a nil-check every time it's used. The conceptual match is so awkward that when I write anything database-related for Go, if I have the option then at the same time I make everything in the database NOT NULL; even though that screws with the database. Ah, NULL. When I think about the pain it causes, balanced against its utility, I sometimes wish I'd never heard of it. And I'm sure learned people said the same thing about Zero, once upon a time.
- TylerE 10y agoWhat's wrong with using an Option/Maybe type? Can't Go do that?
- aurelian15 10y agoTwo weeks ago, when I applied for a new passport (in Germany), I was asked to make sure that my personal information on a printed out form was correct. Immediately the line saying "Artist's/Religious name: null" caught my eyes. I told the officer: "Well, the info about my artist's name is wrong. I don't have one." As I was expecting beforehand, I was told: "That's exactly what 'null' means here." To which I replied: "And what if my artist's name was 'null'?". To which I got no satisfactory response. I guess these problems are only apparent to programmers... So, if anyone wants to cause confusion, now you know how.
- biztos 10y agoBased on my own interactions with the Bürgeramt I think it would be most fun to have a Religious Name of "null null" -- at which point it's win-win, since you can confuse the bureaucrats and/or demand that your full Religious Name be recognized since, well, religion. (Or, to up the ante, one might consider "Keine Angabe" as a Religious Name. It would stand out amongst the nulls, while also being the actual null they are trying to point to.)
- city41 10y agoReminds me of a tweet I saw a while back where someone was told their four digit pin couldn't be a year. To which they replied "aren't they all years?"
- jaytaylor 10y agohttps://twitter.com/mralancooper/status/652532677979959296 https://twitter.com/mralancooper/status/652532677979959296 and my "solution": https://twitter.com/jtaylor/status/772607233829969920 https://twitter.com/jtaylor/status/772607233829969920
- BerislavLopac 10y agoWell, technically, any PIN starting with one or more zeroes is not a year.
- 10y ago
- carlio 10y ago10 years ago I worked for Jagex on RuneScape, an RPG. There are rules for that game about conduct and so on - no swearing, no scamming, blah blah. If you see someone doing something "bad" you can report them and the customer support team reviews the event and can allocate "black marks" on players who infringe. One particular user accumulated thousands of black marks. We thought they were doing something incredibly bad. A black mark gets you banned for a short period of time, this player was banned for a millennium. But they kept sending messages saying that it was unjust, they did nothing wrong. Turns out their playername was 'null' and half of other players' offences were attributed to them due to null in Java being cast to 'null' curing concatenation...
- Ar-Curunir 10y agoWow. How was working for JaGeX? As a kid I was wayyy too obsessed with that game, even staying up past curfew times to play RS.
- oxide 10y agomy busted computer barely ran Runescape when I was growing up, I played The Realm Online instead since it ran on basically anything at the time. I'd save Christmas and birthday cash to pay for my subscription annually. Then World of Warcraft came around...looking back, that was the end of the Realm. It's still around, believe it or not. The player count is usually ~20 people. Sometimes I get nostalgic and install it just to hear the music when it launches. Ahh, memories. Damn shame the game is owned by a private family now instead of actual developers, the game would be a massive hit on mobile with a f2p model.
- Ntrails 10y ago> It's still around, believe it or not. The player count is usually ~20 people. Sometimes I get nostalgic and install it just to hear the music when it launches. At least you can still log in and meander around. I'd love to be able to do that with MxO, hyperjump around the city a bit and just enjoy the sounds and settings. Alas, the servers get shut down by SOE and that's the end of that. A shame when I reckon you could run it off a sodding azure box for sod all cost these days.
- rcthompson 10y agoI feel like this is the real life incarnation of the classic sci-fi trope "does not compute".
- helthanatos 10y agoI had a math teacher named Mr. Null.
- woliveirajr 10y agoThis is kind of finding that "little Bobby tables" exists in real life :-) [1] https://xkcd.com/327/ https://xkcd.com/327/
- ams6110 10y agoMr. Null's second cousin.
- deleted 10y ago[deleted]
- chiph 10y agoWe had a customer named Echo. He couldn't make a payment because our credit card processor looked for common Unix shell commands and filtered them out. I think we ended up creating a discount code just for him so that he'd get the item for free to make up for the annoyance (zero amount due meant no call to the card company).
- david-given 10y ago...filtering out... common Unix commands? By the credit card processor? I would ask 'why', but every time my brain goes there it comes up with terrible, terrible scenarios that I just don't want to think about.
- masklinn 10y agoDo you mean you're not supposed to have a system(3) call with a command built by concatenating user-provided strings as part of your validation process?
- david-given 10y agoDON'T WANT TO THINK ABOUT.
- chiph 10y agoTheir explanation was that someone could send them a command line and it might could get executed (like a SQL injection), so they disallowed them pretty early in their processing to prevent it from happening. Is this likely? I'm sure someone has tried it at some point. And an excess of caution is something that I sort of want in a card processor.
- dalke 10y agoBut why only the common unix commands? I can't think of a level of caution where filtering 'echo' is appropriate but, filtering a more obscure command, perhaps 'dc', is not. An excess of caution would be to put the process in its own chroot'ed jail, with only the bare minimum of tools for needed functionality. And '/bin/echo' is not one of those tools.
- harry8 10y agowired, don't ever change. I'm not running ad blockers but wired blocked me claiming I am. Made me remember nothing in wired is worth reading and I should do something more useful or enjoyable.
- mnw21cam 10y agoAgreed. No ad blockers here, but the web site claims there are.
- laurent123456 10y agoIronically, I have an adblocker but Wired doesn't complain about it, and let me view the content just fine.
- NamTaf 10y agoMy friend posted a screenshot a couple of days ago of a system rejecting name input values that were considered rude or offensive. His last name? 'Wang'. He had to lie about his last name to progress the form.
- manarth 10y agoSounds like another addition for the "Falsehoods Programmers Believe About Names" article [1]. Other problematic names: "O'Neill" (apostrophes), "Gómez" (accents), "Rees-Mogg" (hyphens). [1] https://www.kalzumeus.com/2010/06/17/falsehoods-programmers-believe-about-names/ https://www.kalzumeus.com/2010/06/17/falsehoods-programmers-...
- krylon 10y agoIsn't Wang kind of a common name in... somewhere? China, I guess? (The founder of Wang computers was of Chinese descent, IIRC...)
- NamTaf 10y agoWang is an extremely common Chinese surname, yes. It's a romanisation of a couple of names which also sometimes become Wong and Ong. https://en.wikipedia.org/wiki/Wang_(surname) https://en.wikipedia.org/wiki/Wang_(surname)
- m0nty 10y agoI once had to (try to) explain to a colleague why he couldn't have a Windows username corresponding to his preferred initials - "PRN" (he settled for "PN"). I imagine someone with the initials "CON" would have a similar problem.
- koytch 10y agoJudging from the comments so far, the best name for a privacy conscious person seems to be Null O'Bash.
- pcmoore 10y agoFor those blocked by ad blockers: take the title of the article, paste it into to google and then view the cached page.
- deleted 10y ago[deleted]