- The most important language you will ever code in: English (or the common spoken language used in your company). -- So that everyone understands what you wrote and why.
- Never use a regular expression without saying in plain English what it is doing. Regex is so hard to understand!!! Example: what the heck is this doing. Found in the gruntfile.js of bootstrap at https://github.com/twbs/bootstrap/blob/master/Gruntfile.js return string.replace(/[-\\^$*+?.()|[\]{}]/g, '\\$&');
- If you are going to modify something extensively, you are better off writing a new one and swapping it in when it is ready to go live. For example, if you are extensivley modifying an email template that is currently being used in production, just make a new template with a creative name and use that, so you don't possibly mess up code that is still using the old template. --This way you can also keep a clean backup of the old template and be able to rollback quickly.
- No one cares. No matter how much you think a given coding principle is important, there is nothing worse than alienating your fellow co-workers by sticking to a principle. It may still be important, but no one cares in the end. Try living without it for a day and you'll find you are still alive.
- Don't bother committing code if you haven't tested it. There are runtime errors and compile time errors. So even if your code builds, it doesn't mean it's even going to work. This will save you time in the end, believe me. You will end up having to change your code that doesn't work, or rollback a feature that you comitted and later find out will never work (e.g. I added logic to update the CreatedDate of some table in the database, and come to find out you can't update a database autopopulated field. So I get to rollback the "addition" I made across 5 files).
Popular Posts
-
Tonight I attended a conference hosted by The Church of Jesus Christ of Latter-day Saints. It's topic was the protection of the institu...
-
Adam, Adam, thou art perfect before me. Thou shalt not lose thy children nor shalt thou see the bars of prison, jail, or cell ever again. ...
-
You can use an XML string to pass any number of options to a SQL stored procedure like so Use a scalar valued function to get one value a...
-
Here is how to parse a date that is in the format of mm/dd/yyyy: // Parse string with date but no time component. string dateStr...
-
Last night I thought about how stable God is. He plants his promises in our hearts and watches them grow. As men, we foolishly think that ...
-
Agency is the most beautiful part of the gospel of Jesus Christ. Because of it, as Joseph Smith said we are free. Parents of children want...
-
View the complete solution at https://github.com/adamvaul/React-Server-Side-Web-Forms . I love ReactJS.Net. It is a framework for manag...
Friday, June 12, 2015
Rules of Coding
Rules of Coding
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment