第六十七章 儉故能廣的真義

loa31廣:大、闊、普、遍、攝也。大以配天,廣以配地。                     廣字有十義:一廣絕義:非是心識思量所能知故。二廣超義:無有諸法能比類故。三廣攝義:通攝無邊異類法故。四廣知義:具足種智,破邪見故。五廣破義:破一切障,無有餘故。六廣治義:具攝無邊對治法故。七廣生義:能生無量廣大果故。八廣德義:具足二嚴諸功德故。九廣依義:言教繁廣,為生依故。十廣說義:宣說廣大甚深法故。

儉故能廣的真義:

1. 儉 (Simplicity) 是道的性德,它順乎自然法則。因此宇宙的基本定律之一是簡單、經濟。它不浪廢任何一個微粒子(夸克,quark) 。宇宙裡的每件事的存在、發生,都有它的用意,而且都配合得恰到好處,從來沒有一件無關緊要的事。自然定律是簡單 ;每一件事都有其意義與目的。

2. 生活簡單樸素,就能離苦得樂,自在解脫,心胸開闊。

3. 越簡單的定律越街接近真理,其應用越廣。譬如萬有引力定律 (Laws of Gravity) 及馬克斯威爾的電磁公式 (Maxwell’s Equations) 都相當簡樸,但都運用無邊。越複雜的理論,其應用範圍則相當狹窄,如流體理論。

4. KISS is an Information Technology (IT) design principle, “Keep It Simple,Stupid!”(KISS是資訊科技的主要設計原則: 凡事盡量簡單化。簡稱KISS。語意 “笨蛋,凡事要保持簡單”。) The KISS principle states that most systems work best if they are kept simple, therefore simplicity should be a key goal in design 。(越簡單的程式,它的應用越廣。)

5.越簡潔,越沒有對立的字句,其意義越深廣、普遍。譬如慈悲、博愛。特定、對立的字句或越長的解說,其含義越狹窄。

6.少私寡欲。如內而身心,外而事物,隨緣循理,歸於性命,克去己私,不生自有自利之意。 遇境忘境,不著戀慕沉溺之情,斂華就實。

7.人體的細胞,皆含藏組合整體構造的藍圖。一切生物皆由細胞組成。

8. 所有物質,都由基本粒子所組成。由原子而分子,由分子而細胞,由細胞而器官,由器官而身體。

9.儉則戒也。由戒生定,由定生慧。無所不知。

10.儉者損也。此經第48章:「為學日益,為道日損,損之又損,以至無為。」

「損」既是實踐減損對治各種欲望的工夫,則減損對治欲望的意念本身亦為一種欲望,也必須被「損」,因此第二個「損」字所損的對象則是「損」的意念本身,兩種損的對象所用的工夫不同。

損盡妄想、分別、無明,真性乃現。真空妙有,無所不知,無所不在,無所不能。

親近善師,必要有能力辨別真妄邪正、是非善惡,才能出離畢業,開始參訪遊學,增廣見聞,成就圓智。當然,比起華嚴經中善財童子,明心見性後,才離開老師的能力,是相差很遠。不過,能夠有一點辨認佛法正邪的能力,已經是相當難得。因爲有此學習基礎,才可以涉及各種經論,上求下化,自利利他, 根境相接,不致迷惑顛倒。如果沒有忍、定、慧的基礎,即從廣學多聞入,其結果正如清涼大師所說:‘增長邪見’。須知佛法的修學,不同世法,老子說:‘爲學日益,爲道日損’。求世間的學術是可以廣學多聞,增長知識;修行人則是求日日減少煩惱習氣,遠離妄想執著,培養清淨心。清淨心起用,即是四智菩提。否則, 像現前世間有些人,學佛就像學世法一樣,所求只是增長佛學常識,無益于三學。佛法修學的目的是三學:‘戒、定、慧’,但是真正的目標,是在‘智慧’,智慧 就要從甚深的禅定中求得,可是禅定又要從戒律上栽培。所以,戒是手段,定是樞紐,慧是目標。有了智慧,一切生死,六道輪回等問題,都能夠解決,可見修定的重要。修定就是老子說的‘爲道日損’,把我們的妄想、執著、知見舍棄掉。如同般若經說的‘般若無知’,心經所講的‘無智亦無得’,自心恢複本淨,真智自然 現前。我們今天‘有知’、‘有得’並不是究竟法,真正的究竟法是‘無知亦無得’。

儉樸原則

The KISS is an abbreviation of Keep It Stupid Simple or Keep It Simple, Stupid

This principle has been a key, and a huge success in my years of software engineering. Acommon problem among software engineers and developers today is that they tend to over complicate problems. Typically when a developer is faced with a problem, they break it down into smaller pieces that they think they understand and then try to implement the solution in code. I would say 8 or 9 out of 10 developers make the mistake that they don’t break down the problem into small enough or understandable enough pieces. This results in very complex implementations of even the most simple problems, another side effect is spagetthi code, something we thought only BASIC would do with its go-to statements, but in Java this results in classes with 500-1000 lines of code, methods that each have several hundreds of lines.
This code clutter is a result of the developer realizing exception cases to his original solution while he is typing in code. These exception cases would have solved if the developer had broken down the problem further.

How will I benefit from KISS

You will be able to solve more problems, faster.
You will be able to produce code to solve complex problems in fewer lines of code
You will be able to produce higher quality code
You will be able to build larger systems, easier to maintain
You’re code base will be more flexible, easier to extend, modify or refactor when new requirements arrive
You will be able to achieve more than you ever imagined
You will be able to work in large development groups and large projects since all the code is stupid simple
You will be able to verify the code or change the code easier.
How can I apply the KISS principle to my work?

There are several steps to take, very simple, but could be challenging for some. As easy as it sounds, keeping it simple, is a matter of patience, mostly with yourself。

Be Humble, don’t think of yourself as a super genius, this is your first mistake
By being humble, you will eventually achieve super genius status =), and even if you don’t, who cares! your code is stupid simple, so you don’t have to be a genius to work with it.
Break down your tasks into sub tasks that you think should take no longer than 4-12 hours to code
Break down your problems into many small problems. Each problem should be able to be solved within one or a very few classes
Keep your methods small, each method should never be more than 30-40 lines. Each method should only solve one little problem, not many uses cases
If you have a lot of conditions in your method, break these out into smaller methods.
Not only will this be easier to read and maintain, but you will find bugs a lot faster.
You will learn to love Right Click+Refactor in your editor.
Keep your classes small, same methodology applies here as we described for methods.
Solve the problem, then code it. Not the other way around
Many developers solve their problem while they are coding, and there is nothing wrong doing that. As a matter of fact, you can do that and still adhere to the above statement.
If you have the ability to mentally break down things into very small pieces, then by all means, do that while you are coding. But don’t be afraid of refactor your code over and over and over and over again. Its the end result that counts, and number of lines is not a measurement, unless you measure that fewer is better of course.
Don’t be afraid to throw away code. Refactoring and recoding are two very important areas. As you come across requirements that didn’t exist, or you weren’t aware of when you wrote the code to begin with you might be able to solve the old and the new problems with an even better solution.
If you had followed the advice above, the amount of code to rewrite would have been minimal, and if you hadn’t followed the advice above, then the code should probably be rewritten anyway.
And for all other scenarios, try to keep it as simple as possible, this is the hardest behavior pattern to apply to, but once you have it, you’ll look back and will say, I can’t imagine how I was doing work before.
Are there any examples of the KISS principle

There are many, and I will look for some really great one to post here. But I will leave you with the following thought:

Some of the world’s greatest algorithms are always the ones with the fewest lines of code. And when we go through the lines of code, we can easily understand them. The innovator of that algorithm, broke down the problem until it was so easy to understand that he/she could implement it.
Many great problem solvers were not great coders, but yet they produced great code!

Does KISS only apply to java coding

Absolutely not, it applies to many other programming languages and extends to many other areas in your life.
The areas that the principle doesn’t apply to are: emotions, love and most importantly, your marriage 🙂

This entry was posted in 道德經 by wtsai. Bookmark the permalink.

About wtsai

台南一中、台大物理、 哈佛博士。曾任教授、科學家、工程師。專長: 吹牛、高能物理、量子物理、太空物理,天文物理、地球物理,人造衛星設計、測試、發射、資料回收及科學應用。略涉: 武俠、太極、瑜珈、導引、氣功、經脈、論語、易經、老莊、一乘佛經、禪經、靈界實相、Hawkins、Seth。

Leave a Reply

Your email address will not be published. Required fields are marked *