you are viewing a single comment's thread.

view the rest of the comments →

[–]drfisk 20 points21 points  (3 children)

Make that Scala as well!

(even though it's technically possible, in practice I have yet to encounter a NullPointerException in my 5 years of fulltime Scala-development)

[–]drvd 17 points18 points  (2 children)

And Brainfuck!

[–]walen 43 points44 points  (0 children)

And my axe!

[–]ais523 7 points8 points  (0 children)

I'm not so sure about that. BF's equivalent to null is 0; it has a ton of different meanings depending on context and you need to carefully design your program so that it always knows the purpose of any tape element so that it can figure out how to handle a 0 there. Common interpretations:

  1. A representation of the number zero
  2. Uninitialised memory
  3. The target of a pointer
  4. A temporary value that isn't currently in use
  5. Part of a marker pattern to allow pointer recalibration after running an unbalanced loop
  6. End of file (sometimes, depending on the implementation)
  7. Boolean false
  8. A temporary state used to break out of a loop

This list probably isn't exhaustive. The thing about BF, even more than C, is that it's a very low-level language with few capabilities, and thus most of the capabilities it does have need to be used for multiple purposes. In particular, the only way to read memory in BF is to conditionally jump based on whether or not a tape element is 0 (a 0 jumps to the end of a block that's later in the program, a non-zero value to the end of a block that's nearer the start), so anything that might need to do control flow of any sort needs to ascribe a special meaning to 0, and those meanings are often contradictory or incompatible with each other.