This translation may be out of date. To help with the translations please access the FreeBSD translations instance .
好了我們開始吧!我想你的 FreeBSD 已經安裝好了,而且已經準備好要用它寫點程式了吧? 但是要從哪裡開始呢? 有提供寫程式的程式或環境嗎? 身為 programer 的我可以做什麼呢?
本章試著回答你一些問題,當然,單就 programming 程度來說可分很多種層次, 有的人只是單純當興趣,有的則是他的專業, 本章主要內容是針對程式初學者, 當然,對於那些不熟 的程式開發者而言,本文件內容也是十分實用的。
為了讓你寫出來的程式在 like系統上具有良好的使用性、效能和穩定性, 我們必須跟你介紹一些程式概念(original software tools ideology)。
我們想介紹的概念如下
在整個程式還沒寫完前,不要增加新的功能。
另外一個重點就是,讓你自己選擇你的程式將會具有何種功能, 而不是讓別人決定,不想要去滿足全世界的需求,除非你想讓你的程式具有擴充性或相容性。
千萬記住:在沒有相關經驗時,參考範例程式碼所寫出來的程式, 會比自己憑空寫出來的好。
當你寫的程式沒辦法完全解決問題時,最好的方法就是不要試著要去解決它。
若用 10% 的心力就能輕鬆完成 90% 的工作份量,就用這個簡單法子吧。
盡可能地簡化問題的複雜。
提供機制(mechanism),而非原則(policy)。 比方說,把使用者介面選擇權交由使用者來決定。
以上摘自 Scheifler Gettys 的 "X Window System" 論文
完整的 FreeBSD 原始碼都在公開的 CVS repository 中。 通常 FreeBSD 原始碼都會裝在 /usr/src , 而且包含下列子目錄:
| Directory | Description |
|---|---|
|
bin/ |
Source for files in /bin |
|
contrib/ |
Source for files from contributed software. |
|
crypto/ |
Cryptographical sources |
|
etc/ |
Source for files in /etc |
|
games/ |
Source for files in /usr/games |
|
gnu/ |
Utilities covered by the GNU Public License |
|
include/ |
Source for files in /usr/include |
|
kerberos5/ |
Source for Kerberos version 5 |
|
lib/ |
Source for files in /usr/lib |
|
libexec/ |
Source for files in /usr/libexec |
|
release/ |
Files required to produce a FreeBSD release |
|
rescue/ |
Build system for the /rescue utilities |
|
sbin/ |
Source for files in /sbin |
|
secure/ |
FreeSec sources |
|
share/ |
Source for files in /usr/share |
|
sys/ |
Kernel source files |
|
tools/ |
Tools used for maintenance and testing of FreeBSD |
|
usr.bin/ |
Source for files in /usr/bin |
|
usr.sbin/ |
Source for files in /usr/sbin |
最後修改於 : February 18, 2025 由 Fernando Apesteguía