You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.)
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.
The text was updated successfully, but these errors were encountered: