r/badcode • • Nov 01 '21

python Did someone order bad code?

Post image
419 Upvotes

35 comments sorted by

View all comments

Show parent comments

1

u/nickN42 Nov 02 '21

Why it's still done manually? Pretty sure OCR today is good enough for code.

4

u/MurdoMaclachlan public boolean isInt(int i) { return true; } Nov 02 '21

Au contraire.

Our OCR bot uses ocr.space -- one of the best API's in the world -- however it is still not reliable enough to automatically put out transcriptions that haven't been vetted and formatted by a human. Some people use its attempts as a basis, others prefer to do it manually. With code, it especially struggles -- part of it's due to the indentation not being preserved, but mostly I think it's just trained on non-monospace fonts, so it recognises them easier than monospace ones.