4 comments

  • tromp 12 hours ago ago

    Haskell is relatively WTF free as a language, behaving pretty much like the lambda calculus, but the standard libraries have their share of WTFs, such as the Enum instance for Double:

    ghci> [0, 0.3 .. 2.0] [0.0,0.3,0.6,0.8999999999999999,1.2,1.5,1.7999999999999998,2.1]

    I'd rather not see 2.1 in a range up to 2.0

    • jose_zap 11 hours ago ago

      That’s floating point, though. Not Double. Floating point has the same gotchas in all languages because it is a defined standard.

  • PaulHoule 12 hours ago ago

    Only highly abstract languages like Brainfuck

    https://esolangs.org/wiki/Brainfuck

    which are too simple to have WTFs, although you might say the whole thing is a WTF. I think AVR-8 assembler is WTF free, but I'd like a more powerful macro assembler which would probably introduce a WTF.

    Common Lisp is full of WTFs, I went through many stages of grief reading Graham's On Lisp but most notable was "if he was using Clojure he wouldn't be fighting with nconc". People have problems with Clojure too

    https://www.more-magic.net/posts/thoughts-on-clojure.html

  • Gibbon1 12 hours ago ago

    For #3 on that list C has that too. And I often use it.

       printf( "thing1=%u\n"
               "thing2=%u\n"
               "thing3=%u\n"
               "thing4=%u\n"
               "thing5=%u\n",
           thing1,
           thing2,
           thing3,
           thing4,
           thing5);