if I have to worry about how to indent things properly I'd end up getting more confused.
Not trying to sound belittling or anything, but that's like saying "If I have to worry about using the steering wheel, I'd end up getting more confused". The good monks here know what they are talking about. The indention helps you organize your logic flow. It doesn't matter so much in how you do it, just keep it consistent. Proper indentation steers the eye through the logic flow, making it easier for everyone (including yourself) to follow the logic. Use the force, Luke. :) | [reply] |
Yup, indentation is important. There was a poll about it indentation in April, and the commentary is worth reading.
I have found that good indentation is hugely valuable, not just when checking someone else's code, but also when revisiting your own code. It really cuts down on the "What the hell was I thinking?" factor. If you're using vim as a text editor, the perl syntax module will make this much easier, just add "use syntax" to your .exrc file. If there are more than two words you didn't understand in that last sentence, don't worry. It's a unix thing.
On another topic, what are you doing with this code? If you're generating passwords, the code seems to imply that you have a list of passwords in an unencrypted plaintext file. I cannot begin to explain how dangerous that is. Please tell me that this is a class project that will never be used in the real world.
-Logan
"What do I want? I'm an American. I want more." | [reply] |