Part 1
- It needs to work. And by work I mean execute without crashing.
- It needs to do what you expect it to do.
- It needs to have code you can actually read and debug.
Part 2
- No Syntax Errors
- No Warnings (from the compiler)
- It has tests (yes, even asserts)
- It passes test.
- It logs errors.
- It does not crash.
- Someone who doesn't know you won't kill you for writing completely illegible code.
- It has instructions. For the user.
I'm terrible at writing code. Always have been, and while for some time there I was improving, in recent years I've been getting worse, I think. I can usually write something that achieves what I need it to do, but when it comes time to polish, cleanup, formalize the tests, and expunge the warnings... heh. Yeah, THAT will happen. Sure.