Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Boy Scout! #7

Open
lorddev opened this issue Sep 7, 2012 · 1 comment
Open

Boy Scout! #7

lorddev opened this issue Sep 7, 2012 · 1 comment

Comments

@lorddev
Copy link
Owner

lorddev commented Sep 7, 2012

Be a boy scout coder. Always check in your code cleaner than it was when you checked it out.

Some companies will frown on this. That's how you know it's not a place where you want to work.

@lorddev
Copy link
Owner Author

lorddev commented Sep 7, 2012

Example: Perhaps the two most fundamental rules of programming are DRY and Curly's Law. If you are fixing a bug in a block of JavaScript, and you notice that within the same function, you have the same exact 6-line block of code appearing twice within the space of what's visible on your screen, you should make that a separate function and call it twice instead. The fact that it is called twice within the same function means it violates Curly's Law as well, but for the purpose of this illustration, the DRY fix is a quick one and doesn't take any longer to implement than it did to read the code and recognize it was doing the same exact thing twice.

(Curly's Law is off-topic for the Boy Scout example, as we're trying to emphasize the fact that we can improve things quickly.)

@lorddev lorddev added the to do label Jan 21, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant