238 points · by BerislavLopac · 10y ago · 208 comments
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...
There were also rumours of an internal scripting metalanguage for RS, that had no local variables and all the other hallmarks of something put together in a hurry that ends up being a success and then a burden.
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.
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.
The whole ethos of the company, driven by Andrew, was "minimal software for maximum output". I learned a lot about how much you can benefit from concentrating on efficiency up front compared to how much that ends up creating problems down the road.
I can remember pretty peculiar stuff from the game, now from my perspective as a programmer.
I remember that the anti-swearing algorithms detected bad words in a lot of ways, but those ways were so much that you would get your normal conversations sensored (oh man, I hated those asterisks so much). You would always find a way to say the bad word anyway... I guess that with today's advances in machine learning those ambiguities could be removed in a better way.
Love the 'null' story by the way.
Let's be honest, this is not important. Even if 12 year olds didn't constantly see/hear/use "bad words", there are really no ill effects of lack of censorship in that way.
Why did this happen though? I mean, why was it casted to begin with and why was there a null value?
Nulls are fairly normal in Java, and modern Java systems often have ways to define if something can return nulls or not. In the old days you just had to know.
Why would half of the players have a playername of null?
What does this mean?
"" + null should be null (or throw an exception). Null is null and nothing else.
“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_retra...
https://www.infoq.com/presentations/Null-References-The-Bill...
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.
Considering Rob Pike is a huge fan of Tony Hoare, and the inevitable mountain of pain caused by null references, that's kinda surprising.
But I guess "Worse is Better" in the sense of "simplicity of implementation is valued over all else" is still the guiding principle of Go. As Tony Hoare himself said: "But I couldn't resist the temptation to put in a null reference, simply because it was so easy to implement". It seems like we're doomed to repeating this mistake again and again.
The way it works in Rust is that you can't have a reference without the thing you're referring to. There isn't a default value and because of that it's an error to try to have a reference without something to refer to.
The way Rust works with this is to have a type called Option (I think this is a monad in haskell?) that lets you say this can be None or Some, so you have to explicitly handle the None case whenever you use it (either by panicing, or matching or some other method).
IIRC this was pre-1.0 Rust, so there's probably a better way to do it now.
1) assign default value to variable
2) check if pointer parameter is nil
3) if pointer is not nil assign pointer value to variable
4) do work with variable
Am I overlooking a simpler way to do this? I feel like lib.LibraryFuncion(nil, nil) is nicer then lib.LibraryFunction(lib.LibraryDefaultOne, lib.LibraryDefaultTwo), though admittedly the explicitness of the second option is appealing.
While you can do pointer arithmatic there will be null pointers and while memory is addressible there will be pointer arithmatic.
And while I'm a programmer, I want access to all the functionality the CPU offers.
There is no reason why the concept of a null pointer has to exist. If there were no special null pointers it would be perfectly okay for the operating system to actually allocate memory at 0x00000000. With unrestricted pointer arithmetic you can of course make invalid pointers, but a reasonable restriction is to only allow `pointer+integer -> pointer` and `pointer-pointer -> integer`. You can't make a null pointer with just those.
Good code is generally agreed upon to always check whether function inputs or the results of function calls are null (if they are nullable). Why not make it a compile-time error if you don't check rather than hoping that the fallible programmer is vigilant about checking and delaying potential crashes until runtime?
Go is extremely pedantic about a number of things like unused library imports, trailing commas, etc. which have absolutely no bearing on the actual compiled code, but it intentionally leaves things like this up to programmers who have shown that they can't be trusted to deal with it properly.
Having to manually deal with null is much more complicated than having an Option/Optional type in my opinion. We've also seen that it's far less safe.
http://stackoverflow.com/questions/4456438/how-to-pass-null-...
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;
}Edit: IIRC there was a directive that would prevent the behavior though?
Side note: please refrain from "sounds like someone doesn't understand". It is extremely condescending, dissuades discussion by most people whether they actually know the topic or not, and can be especially deflating to people who are less educated but currently learning.
If there is something that you feel I misunderstood about the way popular languages treat the string `"null"`, feel free to explain it (there are many other response comments I've gotten that are good examples). But if the purpose of your comment is to make me or anyone else feel ignorant, please just keep it to yourself.
Edit: whoops, forgot the one time I wrote a one-off Mac app in Swift.
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.
(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.)
Note that you need to submit proof. For an artist's name it needs to overshadow your common name in at least some parts of life and entry is at the discretion of the officer. Famously, a sex worker was not allowed to add her artist's name into her ID card.
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.
"null" == null1: http://infiniteundo.com/post/25326999628/falsehoods-programm...
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.
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?
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.
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.
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.
This guy is basically a walking fuzzer on forms and input systems. He could find vulnerabilities without actually doing anything illegal ;)
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
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.
An employee, whose last name is Null, kills our employee lookup: 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
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.
Edit: or the other way around if you read the dates...
He had to lie about his last name to progress the form.
Other problematic names: "O'Neill" (apostrophes), "Gómez" (accents), "Rees-Mogg" (hyphens).
[1] https://www.kalzumeus.com/2010/06/17/falsehoods-programmers-...
How can it become the data type Null without a literal casting?
Is this just affecting scripting languages?
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.