Smart Coding

Coding is not difficult to master if you are good at logic. However, how do you learn to code smarter than the rest of people? You can learn these tricks from my personal cookbook.

  1. The more you code, the shorter it gets.
  2. Simple logic works faster and more efficiently.
  3. Dare to rewrite and recode. Same rationale as point 1.
  4. If you find it hard to read, the computer will find it hard as well.
  5. Learn to understand the domain knowledge. This helps to select the right logic codes to fit task.
  6. If the decision making logic is more than 5 to 8. Consider to optimise it to reduce to 5.
  7. Speed is better than elegant codes. Users can feel the performance but cannot read how elegant is your coding.
  8. Know the cost of SQL. 1 long complex SQL is slower than few few simple ones.

It is good habit to know the timing of your codes. With practice, you will be smart to code for performance and maintainability.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s