Header Ads

Do the best programmers use the fewest lines of code ?

Image result for programming

The best programmers do not typically use the fewest lines of code. Instead, they write the code in a fashion appropriate for its intended use.
  • High-speed of execution. In certain cases this will be the shortest source code, but it will be arrived at by carefully choosing which intrinsic functions to use, order of comparisons, and many other things you wish an optimizer could take care of correctly for you. The examples I've seen were painful to maintain and debug.
  • High speed of development.

    For example, prototype code to demonstrate a concept or refine an algorithm. This code tends to be concise, 'happy case' code. It's also usually modular in ways the developer expects to extend or experiment with.
  • Commercial production

    . If the programmer is producing code which is expected to be long-lived, and which must be robust to corner cases, it's typically written to be clear, maintainable, and bullet-proof. Code I wrote for research in five lines might require 200 lines to write in a manner appropriate to ship in Windows.

I taught myself to code in high school, and thought I was pretty good (really, I was). My programs were as short as I could make them, even if that meant five lines of code on the same line of text.

No comments:

Powered by Blogger.