in reply to Re: IYHO, what do you consider good code?
in thread IYHO, what do you consider good code?
I agree with most of this, and do my best to follow it in my own code. Lately, though, I have been softening up on the use strict dogma. It's a great idea for you and me, but it might make some more unusual constructions more difficult. Good testing support provides a lot of the same usefulness as strict, but without the compiler errors :-). If your code changes an assumption, then the tests that rely on that assumption will scream bloody murder.
So here is my slightly modified version of the first point:
- Always use strict and use warnings unless you know exactly why you aren't using them, and comment on exactly why you don't.
Update: theorbtwo's qualifier made perfect sense to me. Can't imagine why I forgot it. Whatever, the qualifier is now applied :-)