Writing shorter code/algorithms, is more efficient (performance)?

后端 未结 11 1753
半阙折子戏
半阙折子戏 2021-02-19 15:19

After coming across the code golf trivia around the site it is obvious people try to find ways to write code and algorithms as short as the possibly can in terms of characters,

11条回答
  •  [愿得一人]
    2021-02-19 16:08

    This is from "10 Commandments for Java Developers"

    Keep in Mind - "Less is more" is not always better. - Code efficiency is a great thing, but > in many situations writing less lines of code does not improve the efficiency of that code.

    This is (probably) true for all programming languages (though in assembly it could be different).

提交回复
热议问题