Beauty Is in Simplicity

Beauty Is in Simplicity

THERE iS ONE qUOTE, from Plato, that I think is particularly good for all software developers to know and keep close to their hearts:

Beauty of style and harmony and grace and good rhythm depends on simplicity.

In one sentence, this sums up the values that we as software developers should

aspire to.

There are a number of things we strive for in our code:

? Readability

? Maintainability

? Speed of development

? The elusive quality of beauty

Plato is telling us that the enabling factor for all of these qualities is simplicity.

What is beautiful code? This is potentially a very subjective question. Per- ception of beauty depends heavily on individual background, just as much of our perception of anything depends on our background. People educated in the arts have a different perception of (or at least approach to) beauty than people educated in the sciences. Arts majors tend to approach beauty in software by comparing software to works of art, while science majors tend to talk about symmetry and the golden ratio, trying to reduce things to formulae. In my experience, simplicity is the foundation of most of the arguments from both sides.

??10 97 Things Every Programmer Should Know

?

???????????????Think about source code that you have studied. If you haven’t spent time studying other people’s code, stop reading this right now and find some open source code to study. Seriously! I mean it! Go search the Web for some code in your language of choice, written by some well-known, acknowledged expert.

You’re back? Good. Where were we? Ah, yes…I have found that code that resonates with me, and that I consider beautiful, has a number of properties in common. Chief among these is simplicity. I find that no matter how complex the total application or system is, the individual parts have to be kept simple: simple objects with a single responsibility containing similarly simple, focused methods with descriptive names. Some people think the idea of having short methods of 5–10 lines of code is extreme, and some languages make it very hard to do, but I think that such brevity is a desirable goal nonetheless.

The bottom line is that beautiful code is simple code. Each individual part is kept simple with simple responsibilities and simple relationships with the other parts of the system. This is the way we can keep our systems maintain- able over time, with clean, simple, testable code, ensuring a high speed of development throughout the lifetime of the system.

Beauty is born of and found in simplicity.

时间: 2024-08-03 10:57:58

Beauty Is in Simplicity的相关文章

Ionic + AngularJS

Ionic Framework Ionic framework is the youngest in our top 5 stack, as the alpha was released in late November 2013. Built on top of the popular AngularJS framework from Google, Ionic utilizes AngularJS to provide the application structure, while Ion

ARTS Week 7

Dec 9, 2019 ~ Dec 15, 2019 Algorithm Problem 38.Count And Say 外观数列 题目链接 题目描述: 外观数列 是一个整数序列,从数字 1 开始,序列中的每一项都是对前一项的描述.前六项及其说明如下: 1 // base 11 // 描述[1]:1个1 -> 11 21 // 描述[2]:2个1 -> 21 1211 // 描述[3]:1个2,1个1 -> 1211 111221 // 描述[4]:1个1,1个2,2个1 ->

CF1187F Expected Square Beauty

Expected Square Beauty 有一个长度为 n 的数列,第 i 个数的取值范围为 \([l_i,r_i]\) ,定义一个数列的价值为这个数列极长连续相同段的个数,求一个数列价值的平方期望,对 \(10^9+7\) 取模 . n≤200000 . 题解 https://codeforces.com/blog/entry/68111 As usual with tasks on an expected value, let's denote \(I_i(x)\) as indicat

ZOJ 3872 Beauty of Array(数学啊)

题目链接:http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=5520 Edward has an array A with N integers. He defines the beauty of an array as the summation of all distinct integers in the array. Now Edward wants to know the summation of the beauty

【The beauty of math】无限循环小数转分数

0.333333... = 1/3 推导过程: 设x=0.333333 10x=3.333333(循环体的数字个数为1) 10x-x=3 x=1/3 所以计算的核心在于确定无限循环的循环体的数字个数. [The beauty of math]无限循环小数转分数,布布扣,bubuko.com

Beauty of Array

Description Edward has an array A with N integers. He defines the beauty of an array as the summation of all distinct integers in the array. Now Edward wants to know the summation of the beauty of all contiguous subarray of the array A. Input There a

ZOJ 3872 Beauty of Array 连续子序列求和

Edward has an array A with N integers. He defines the beauty of an array as the summation of all distinct integers in the array. Now Edward wants to know the summation of the beauty of all contiguous subarray of the array A. Input There are multiple

HDU 5496 Beauty of Sequence

题目链接: http://acm.hdu.edu.cn/showproblem.php?pid=5496 Beauty of Sequence Problem Description Sequence is beautiful and the beauty of an integer sequence is defined as follows: removes all but the first element from every consecutive group of equivalen

Beauty World OpenCart 主题模板 ABC-0046

Beauty World OpenCart 主题模板 ABC-0046 BEAUTY WORLD OPENCART 主题模板 ABC-0046 模板特性 OpenCart版本 1.5.6, 1.5.6.1, 1.5.6.2, 1.5.6.3, 1.5.6.4, 2.0.1.1 包含文件 PHP Files, CSS Files, JS Files Introduction------------------Beauty World is a very advanced OpenCart them