天天看點

Keep the spirit of C

The First ANSI/ISO C Standard As C evolved and became more widely used on a greater variety of systems, the C community realized it needed a more comprehensive, up-to-date, and rigorous standard. To meet this need, the American National Standards Institute (ANSI) established a committee (X3J11) in 1983 to develop a new standard, which was adopted formally in 1989. This new standard (ANSI C) defines both the language and a standard C library. The International  Organization for Standardization adopted a C standard (ISO C) in 1990. ISO C and ANSI C are essentially the same standard. The final version of the ANSI/ISO standard is often referred to as C89 (because that's when ANSI approval came) or C90 (because that's when ISO approval came). Also, because the ANSI version came out first, people often used the term ANSI C.

The committee had several guiding principles. Perhaps the most interesting was this: Keep the spirit of C. The committee listed the following idea as expressing part of that spirit:

  • Trust the programmer.
  • Don't prevent the programmer from doing what needs to be done.
  • Keep the language small and simple.
  • Provide only one way to do an operation.
  • Make it fast, even if it is not guaranteed to be portable.

By the last point, the committee meant that an implementation should define a particular operation in terms of what works best for the target computer instead of trying to impose an abstract, uniform definition.

以上是最近讀c primer plus fifth edition裡面第一章寫C起源的一部分摘錄,很有意思,特别是裡面的關于标準化委員會制定标準的指導原則——“保持C的精神”,突然給人以一種看到高山的理想。

以下是精神幾點清單: 相信程式員 不要阻止程式員做應該做的 保持語言的小巧和簡單 一個操作隻提供一個方法(真心說,這點我還不是很喜歡) 即使損失可移植性,也要讓他更快些

也許有些和人一樣,語言也要有理想,不存在十全十美的語言,如同不存在徹頭徹尾的絕望,就以此文獻給自己這個部落格的開始。