Posted by Kai on 27th April 2008
We want to see pride of ownership.”I wrote this, and I stand behind my work.” Your signature should come to be recognized as an indicator of quality. People should see your name on a piece of code and expect it to be solid, well written, tested, and documented. A really professional job. Written by a real professinal.
A pragmatic Programmer.
It took me a month to finish this book. I gotta say, this one deserves your time.
This book is the reason why I started learning Perl, Learn a text manipulation language, so said the pragmatic programmer.
Compared with lot technology books i’ve read, this one is just like talking about philosophy. Well, it’s right. We programmers consider too much about detailed techonlogy, other than how to be a reliable engineer.

Posted in books, tech | No Comments »
Posted by Kai on 25th April 2008
这几天学了Perl,然后看懂了The Pragmatic Programer上从元数据生成结构代码那个题目的答案。有一些感慨。
我的程序使用C++,一共380行。见一个生成代码的小练习
书上的Perl答案,一共52行。短到以至于我可以把代码贴在这里。
论通用性,well,我有的通用性他的代码也有。OO不是复用的唯一手段。它甚至不是最容易最方便的手段。
我的解法是设计模式的初学者常犯的错误,把一个不需要使用设计模式的问题做的太复杂。
Perl程序使用模块来实现换语言,产生一种新语言的工作量和我的答案差不多。
PS:Learning Perl(中文名:Perl语言入门)是很好的适合Perl入门的一本书,又称小骆驼书(因为比大骆驼书薄)。如果你是Perl初学者,选这本没错。但是如果你想精通Perl,去看大骆驼书。
Perl语法里面我最喜欢的是倒装语法。
open INFILE,”< filename.txt” or die “can not open file.”;(live or die语句)
print “I do” if &you_would_like_to;(条件倒装语句)
print “I have to do” unless &you_have_to.
这些句子在Perl里是合法的语句。酷吧!
Perl是至今为止我见过的最酷的语言。
Posted in books, tech | No Comments »
Posted by Kai on 3rd April 2008
昨天看完了《重构》,来发点读后感。
我觉得《重构》一书写的最好的是第一章,所以如果有谁感兴趣又没有那么多时间,花上1个小时琢磨一下第一章也能有很大收获的。
后面的章节我觉得作者更多的是从理论上讲重构过程中的步骤,过于细节,没有必要。须知,现在如果工程里面做重构,大都会借助自动重构工具。而大部分读者是不会去做一个自动重构工具的,所以中间章节实用价值不大。最后几章对于看过《设计模式》的人来说,也无多大作用。如果没看过《设计模式》,我想可能会有点帮助。
正如作者说所,GoF的《设计模式》指出了编码的方向,而重构告诉程序员具体的实现方法。所以,如果不看《设计模式》相关的书,光看《重构》效用也很局限。
今天在网上找到了《重构》作者的网站,还有一个叫做重构的网站。
本想找个免费好用的C++自动重构工具,但是木有发现。有个叫做Refactor!Pro的Visual Studio插件挺不错,但是不免费,而且很贵,要99美刀。Refactor!Pro有体验版,可以免费用大概1个月左右。最新的版本是3.0,已经支持VS2008了,所以我今天试用了一下,感觉很不错,界面漂亮的像Visual Studio一样。
相比较C++程序员的苦恼,Java程序员就舒服的多了。免费IDE Eclipse里面就有现成的Refacting工具,而且功能很多很强大。据说是因为C++的语法太复杂了,不能想Java那么容易的解释,所以没有重构方面没有Java发展的快。
Posted in books, tech | No Comments »
Posted by Kai on 31st March 2008
Before graduation, I just need to complete the degree paper, and that’s my only mission in the next three months. So, I am free to do everything I want only if i can afford.
I seldom go to the library when busy, so now is a good time to do some reading. In the last three weeks, I have completed three books. There are “Thinking in flexible engineering“, “Design Pattern“, and “The trip through games, my experience of programming“. Not until I read Design Pattern did I realized how terriable my code was, but I don’t know how to improve them. I have tried to seperate a class in to more classes with respect of some Named Pattern, but I haven’t get a satisfying solution.

Posted in books, tech | No Comments »
Posted by Kai on 31st March 2008
I read the book last week. 
For me, Design Pattern Explained is more useful then Design Pattern by Gof. There are details of the author’s consideration of why certain pattern was choosed. Though not so complete as Design Pattern by Gof, Design Pattern Explained shows an easy acceptable and replicable approach to the concept Pattern. Thus if someone need an recommendation, I will suggest Design Pattern Explained.
Posted in books, tech | No Comments »