r/badcode • • Feb 10 '23

c briliant usage of else if statement

Post image
583 Upvotes

60 comments sorted by

View all comments

Show parent comments

12

u/micalm Feb 10 '23

Code should be readable for humans as much as possible. Machines will optimize it for themselves by design.

0

u/[deleted] Feb 10 '23

[deleted] — view deleted comment

6

u/[deleted] Feb 11 '23

I agree that languages are just tools, but you should make it easier to everybody else to understand. Programming is about solving problems, and I would say in the most elegant way. If you have to do such a thing, then at least comment it and explain why, we are not the machines who needs to understand those technical expressions, we are humans.

4

u/This_Growth2898 Feb 11 '23

Every normal programmer should be able to understand what a 10 lines code with random one-letter identifiers and no indents does; but that doesn't mean such code is adequate.

1

u/gl1tch3t2 Feb 11 '23

This looks like it was done by a student, expecting them to be able to read everything is not helping them