What is the difference between good and bad code?

by oda.tromp , in category: Technology , 3 years ago

What is the difference between good and bad code?

Facebook Twitter LinkedIn Telegram Whatsapp

1 answer


by mitchell , 3 years ago

There are two major aspects in the difference between good code and bad code. The two differences are style and intent. Style in fashion is one thing but in reference to code it is all about programming. Now in regards to intent, it is so linked to style until it seems one can't be good without the other because it all boils down to good or bad readability. One can always recognize good code because there is very little effort for a reader to understand the intent of the author. Also, considering it from the machine aspect, good code uses less resources and less time for a task to process. Good code's individual parts are of high quality and fits together well and runs smoothly; whereas, bad code has shoddy individual parts that are jammed together. Listed below are additional differences between good code and bad code.

Good Code

  • Considers security, number of calls, compile time, and other by products
  • Run Time is reasonable
  • Naming conventions used are meaningful

Bad Code

  • The look gives no semblance of thought and locks hurried
  • Has loops and jumps statements that are not necessary
  • Uses a lot of time and resources for execution

You can find many examples of bad codes here: crapcodes.com