DEV Community

Discussion on: What's the Worst Code You've Ever Seen or Written?

Collapse
 
laurieontech profile image
Laurie

I don't like the idea of categorizing "worst" code based on arbitrary metrics like lines of code, O(n) efficiency, etc.

However, I'd say bad code is difficult to understand and read. Code will always be interpreted by machines, but it should be comprehensible to humans.

But if I'm being honest the "worst" code I see is code with horrible security. I.e. plain text passwords, or hardcoded credentials.

Collapse
 
renegadecoder94 profile image
Jeremy Grifski

I agree with all this! I do quite a bit of teaching, and I stress readability, correctness, and testing over metrics like efficiency and whatnot.

Collapse
 
laurieontech profile image
Laurie

Inefficient code is more often than not hard to read! There is a reason people try to get rid of "pyramid code".

Thread Thread
 
renegadecoder94 profile image
Jeremy Grifski

For sure! I was just referencing your mention of big O as a criteria for bad code.

Thread Thread
 
laurieontech profile image
Laurie

Oh absolutely. We're in total agreement!