It should be a coder’s goal to make sure that every character in every line of code serves some purpose.
The quality of code is not dependent on good form, prettiness, or theoretical benefits. Code should solve problems.
HTML5 lets you omit closing paragraph tags and closing tags for list items. Some cringe at the thought of this, but it’s perfectly valid code. So if omitting extra tags helps your code become leaner and faster, then you’re solving a problem and that makes it good code.
CSS classes are customarily written in all lowercase and with hyphens. Yes, this looks pretty, but does it solve a problem? Maybe it’s more readable. That would be fine. But what if a combination of camel casing, hyphens, and underscores can help the readability and future maintenance of the code? Then it’s good code, because it solves a problem.
For years many developers have preached about “clean HTML” and avoiding “classitis”, promoting this as a means to make documents more semantic. But in many cases, these semantics arguments have been theoretical at best. Yes, littering your HTML with extra classes might make your HTML a little bigger and slightly slower. But the miniscule loss in page speed and “good form” is gained tenfold in CSS maintenance and modularity.
Theory and future-proofing has its benefits. Good code, however, is code that has a purpose.
Good code doesn’t just look pretty. Good code solves problems.