logoalt Hacker News

berkestoday at 3:01 PM1 replyview on HN

> Almost all of them have one number that appears four times, and one or two that appear three times

To me that looked suspiciously like string-handling in a weakly typed language.

Like when you do `"100" + 1` in JavaScript, or `int("100" * 2)` in Python.

I've seen my share of such bugs in PHP, Python, Ruby, JavaScript. In production. Obviously not as simple as the examples, but subtle, like when a library update changed `someFancyLocalStorage.getOrDefault("lastOrder", 100)` by always casting the value to the type of the default (released as patch release). Or where typedEnvGet() should typecast "numbers", but keeps it a string when theres whitespace `AMOUNT_PER_CALL=100\n`. Or where a number passes through a deep stack of middleware and 99.9% of the times remains an int but in rare race conditions becomes a string. etc.

No evidence that's the case here. But from my experience, the repeating and strange formats of numbers hint strongly in that direction.


Replies

galonktoday at 3:56 PM

Pedantic as hell but `"100" * 2` in Python (= `"100100"` for those who don't know) isn't really typing, it's operator overloading. Any language with that could implement the same questionable design decision.

show 1 reply