r/badcode • • Jan 15 '22

python Found this gem

Post image
3.5k Upvotes

86 comments sorted by

View all comments

Show parent comment

2

u/kbruen Jan 16 '22

There are. I'm pretty sure if you purposefully implement an operator wrong in Haskell the compiler can't detect it (if it can, please tell me how to solve the halting problem too).

It's when people ignore the rules that shit goes bad.

1

u/[deleted] Jan 16 '22

You're right, it's not provable in the general case, but in most cases it is provable, and at the very least it's always testable, and libraries like QuickCheck can generate a few thousand test cases for you automatically.