Skip to content

[JustBlogIt] about learning good C programming style

一月 24, 2005

Diary for titus

titus 提到了幾點關於如何學習好的 C Programming style,下列是他個人的經驗與建議:

# Read other people”””””””””””””””””””””””””””””””’’s code, a lot. Back in the early ‘””””””””””””””””””””””””””””””’’’90s when I first dove into C, I spent some time getting GNU utilities to compile on both an SGI and a weird BSD/SYSV crossover machine we had. I learned a helluva lot about C programming from that, especially with respect to portability.

# Fix other people”””””””””””””””””””””””””””””””’’s code, a lot. Ditto above.

# Work on small parts of some open source project or another. I worked on a conquer-like game called dominion, with a group of pretty good hackers. In the end I think the overall design was lacking, but the nitty gritty of each individual code file was crafted by very experienced C hackers.

# Read a lot. For large-scale program design, Lakos”””””””””””””””””””””””””””””””’’s C++ book is fantastic; Stevens”””””””””””””””””””””””””””””””’’ book on UNIX Network Programming was a prime source of material for me before that. Books like Pragmatic Programmer and so on offer a lot of advice that seems too obvious to be useful, but is in fact quite useful.

No comments yet


在下方填入你的資料或按右方圖示以社群網站登入: 標誌

您的留言將使用 帳號。 登出 /  變更 )

Google+ photo

您的留言將使用 Google+ 帳號。 登出 /  變更 )

Twitter picture

您的留言將使用 Twitter 帳號。 登出 /  變更 )


您的留言將使用 Facebook 帳號。 登出 /  變更 )


連結到 %s

%d 位部落客按了讚: