Archive for July, 2007

10个我使用的社会化网络站点

看到了AW的文章, 仿照写一下, 10个我使用的社会化网络站点:

第一类, 不用就活不下去的四个:

Last.fm: 只要听歌, 一定开着 Last.fm. 既能让算法学习出我喜欢的音乐风格, 又能推荐一些好的音乐. 属于和计算机同开同关的类型.
Digg/Slashdot: 只要开着浏览器, 就可以在个性化主页上看到不断推送的新闻. 看了这些, 新闻基本上也就全了. 属于和浏览器同开同关的类型
Facebook: 每天检查三次, 看看朋友们在干啥. 还常常改改自己的状态(如Twitter). 每天饭前饭后六次, 属于和一日三餐同步的类型.
Wikipedia: 细心看了一下我的访问历史, 发现每天访问10次以上. 属于随工作节奏实时访问的类型.

第二类: 不用也行, 但是用了生活更美好的. [这三个我一般很少在浏览器里面输URL 直接访问]

del.icio.us: 别人都拿他做书签. 我反的, 我用它搜标签. 因为我有一个”流氓”的 emailtome 程序, 把网页抓回来用Gmail 全文搜索了. 所以很少用书签. del.icio.us 上东西都很全, 直接搜教程和技术文档比 Google 质量要好. 这个毕竟是人肉搜索. 一般通过浏览器的按钮和搜索框, 不直接上.
YouTube: 看到Last.fm 推荐的不熟悉的乐队或者新歌, 一般第一件事情就是上去看 MV. (上次Linkin Park 的 What I’ve Done 就是推荐给我的, 看了MV 以后超级喜欢.) 有时候点其他网站也能走到YouTube. 不过不会主动上 YouTube 首页看.
Craigslist: 找二手车, 电脑家具什么的. 一般通过 Yahoo! Pipe 去访问, 不怎么直接上首页.

第三类: 偶尔用用的, 按需使用的.

Linkedin: 每周上一次, 找找同学, 朋友. 看看猎头找啥人, 一些公司的用人需求是啥, 投资人在找什么项目等等 这些.
Amazon: 买书的时候上. 英文的技术书评比豆瓣要好一些, 个人觉得.
Flickr/Picasa Web: 没啥说的, 贴照片的.

和AW对比一下发现, 可能是因为在国外的原因, 国内的豆瓣, 抓虾使用得都不算太多, 至少不会想着天天上去看看. 若邻也曾用过, 不过圈子不在那里. 校内我没有南京大学的邮箱, 所以连帐号都没有. 南大的小百合倒是天天上, 不过只是潜水, 偶尔回答数学问题, 算不得使用了. 不太习惯使用 Twitter, 觉得很烦, 所以饭否这些从来没用过. 其他有名的BBS 论坛如猫扑天涯从来没有用过. 到现在都不会用 Cterm 上水木清华. MITBBS(海外华人最大集散地) 今天也才第二次上. V2EX 和豆瓣小组确实很2.0, 可惜没认识的人在上面灌水, 所以也几乎没怎么上过了. 全球火爆的 MySpaces 只有一个注册了从没用过的帐号, 因为身边没人用. 百度倒是有我的一个同名贴吧, 不过不会因此就泡在贴吧灌水, 因为周围没人陪着灌. 可见, 一个人的圈子决定了使用怎样的网站(反过来也决定了未来的圈子).

Comments (5)

我号召中国互联网全体抵制中国缘

中国缘是我见到的流氓的下确界--没比他更流氓的了. 这样的公司在中国互联网, 只能是让中国的互联网更加黑暗, 让中国的网民更加受害. 中国缘网站盗取 MSN 隐私, 建立互不信任的社区以及涉嫌欺骗倒卖虚假原始股的行为已经极大的伤害了整个互联网的运行环境.

A. 中国缘网站盗取MSN 客户资料. 各位只要搜 中国缘 + 流氓, 就知道此恶劣行径已经人人喊打. 见过利用联系人传播的病毒, 见过赖着不走的流氓软件, 还真没见过盗取联系人拉用户的. 请问这样的SNS网站对整个SNS行业究竟该有有多大的破坏? 还有人敢用MSN么, 还有人敢注册SNS帐号么? 用户从一开始就是被硬生生的拉进一个貌似好多朋友都在其实每个人都是被骗的网站, 这样的SNS又何谈凝聚力? 中国缘这样的流氓拉客手段, 已经是近乎抢劫了. 抢劫还不够, 还要连着九族抢. 如此SNS, 值得国内所有做SNS的公司狠批.

B. 所谓的倒卖原始股到NASDAQ上市, 完全就是非法集资和坑蒙拐骗. 有点经济常识的人都知道, IPO前的原始股是不可能流通认购的. 如果这样搞, 投资人靠什么受益呢. 我可以 99% 确定, 中国缘钱要烧光了, 投资人(有没有投资人我都怀疑)也不投钱了, 就想出非法集资的主意了. 国家才抓了一个带头大哥,应该不缺下一个.至于NASDAQ,少吹牛了,中国要上NASDAQ的每年数来数去就几个, 轮到你中国缘的时候, Windows 都要变 3000了. 你们还是在家好好准备着流氓插件升级吧. 流氓恒久远,注意永流传!

C.中国缘网站号称由海归创业. 打着华人白领高端交友的旗号, 用做互联网2.0为名, 行极其下作流氓之能事. 如果不把这个网站揭出来狠批, 就会真的如王小峰DV中所说, 很多人就会相信搞互联网和 IT 的都是坑蒙拐骗. 这些坏的印象, 对于正在互联网进行创业的创业者, 对于整个中国互联网, 未来都是非常严重的摧残. 我们的互联网不需要这种流氓公司, 也应该主动踢出这种害群之马.

如果您是学生, 需要社区感, 可以去校内或者 Facebook, 如果您是白领, 可以使用Linkedin 或者若邻. 如果您需要交友, 特别是国际交友, 可以使用 AsianFriendFinder 和未名交友. 如果您需要一个新的IM, 可以使用 Google Talk. 如果您需要冒泡, 可以选择 Twitter 和饭否这些. 如果您想投资一夜暴富, 郑重的告诉你, 投中国缘的原始股没前途. (况且, 金融上说, 那个原始股本来就是违规操作, 所以, 连投资都算不上).

我相信, 流氓网站总会歇菜, 耍流氓坑蒙拐骗的某些傻叉海归总会被法律制裁. 但在此之前, 不妨号召广大网友, 一起抵制中国缘. 我们需要一个良性的互联网,我们创业者需要正面的形象.这种老鼠屎和落水狗,不踢出打死是不行的. 虽然我一己之力绵薄, 但为了若干年后我们这一般有理想的人从事的事业不被人认为是坑蒙拐骗, 只能大声疾呼. 我们信仰互联网, 就不能允许这些流氓强奸互联网.

附: 各位网友随意转载, 修改本文和张贴. 本篇连CC都不要了, 商业媒体自由免费转载. 本人从来不惧怕和流氓战斗.

Comments (10)

点名凑10条

Solrex 的点名.

1, 你的专业是什么,她是你最喜欢的么?如果不是,那么你最喜欢的专业是什么?

我原来的专业是信息与计算科学(计算数学). 现在的专业是 Computer Science, 具体说是 Artificial Intelligence and Nonlinear Programming. 可能最喜欢的就是计算机科学吧. 对于数学, 理论物理这些都有兴趣, 但是谈不上热爱, 只是作为一个基础罢了. 其他文学艺术谈不上喜欢的专业了. 只能算业余爱好.

2, 在你最喜欢的专业里请你列举出至少五位大牛, 其中一位是这个专业奠基者, 另外一位是你最最崇拜的.

CS 图灵奖每个都是大牛了.

计算机和人工智能最早的奠基者应该最早应该算莱布尼兹 (Leibniz), 他提出能否任意表达一个命题, 能否有一个过程任意证明一个命题. 这个问题包含了知识表示, 本体论和通用计算机器的思想.
现代计算机科学奠基人是图灵(Alan Turing) 和 Alonzo Church, 一个提出图灵机, 一个提出递归函数演算. 图灵还定义了什么是智能, 也就是著名的图灵测试.
D. E. Knuth 显然是算法分析的奠基人, 也是我最崇拜的.
John von Neumann 是第一台计算机 ENIAC 的制造者, 而且及其聪明. 很崇拜他, 属于可远观不可企及的.

3, 你觉得在这个专业里你能做出让自己满意的贡献么?说说你如此回答的理由?

目前尚不清楚吧, 只有踏踏实实慢慢做了. 老板要求我能解决点大问题, 有用的问题, 而不是琐碎的问题. 所以, 路漫漫, 很难说. 我想只要努力了就不后悔,

4,你满意的贡献能够具体描述给我看看么?

希望某天, 有一个公共的网站, 大家可以上去, 提交自己的NLP 问题, 后台的超级计算机能够很好很快的解出来.
在 AI 那边, 希望能让传统的组合爆炸的算法快一点, 能在合理的时间中解出来吧.

5,就你的这个专业,全球那一所学校是最强的?

NLP 主要就集中在芝加哥地区, 西北大学, 普渡大学, 芝加哥大学, UIUC, 威斯康星和阿岗国家实验室都是顶极的.
英国的剑桥也很强. Top 1 我还的确不知道.
AI 我们这个分支, 这几年好像我们老板做得最好吧. 不过这个分支我读的论文太少了, 主要是一个师兄在做.

6,你认为从事此学科的研究需要哪些方面的能力?你自己具备几条?

数学第一条吧. 还行
计算机编程第二条, 尚可
独立的读Paper 想点子的能力: 比较差
灵感: 目前没有.
耐性: 还行, 能坐下来.

7,希望自己的老婆或者丈夫也是从事这方面研究的么?
我自己其实也不是以研究为终身事业的吧. 至于未来的另一半, 随便她做什么了, 没什么希望不希望的.

8,人类 历史 长河中哪位智者是你最最高山仰止的?
好难回答呀. 比较喜欢庄子.

9,你的人生哲学
大拙就是大巧, 所以用点笨方法, 往往就是意想不到的捷径.

10.每天你花多长时间在你的学科上,分别是做什么用的?我最最感兴趣的是你花在读论文上的时间
10个小时以上. 主要是编程, 得要4-5个小时, 因为目前系统比较大. 其次读论文看书吧, 每天2-3小时. 不过我这个人比较闲不住, 编程会间杂着会上上网看看Blog. 我读论文比较杂, 而且交叉阅读, 跳来跳去, 所以其实有效阅读时间也不算多. 还有2-3个小时我会学点计算机技术, 比如一门新语言, 一个新框架这些. 这些算是学科上的时间, 但实际上是和研究不怎么相关的了.

接着, 恩, 学术圈的, 就点 Logpie 和 Gookbaby.

Comments (2)

几条凌乱的思考

1. 下决心不关心国内的社会新闻, 理由有四.

  • 永远不知道真假, 不知道砖窑是不是官商勾结, 不知道猪肉是不是有纸馅, 也不知道国子监的这个女生和州长究竟干啥了.
  • 社会很和谐, 我党能妥善处理这些事件和媒体. 我很无趣的替胡主席着急, 久而久之说不定会让自己热于从政. 从小就知道, 编程我可以, 从政我不行.
  • 看中文新闻, 忍受极端低下的中文写作实在很痛苦. 青春有限, 人生苦短, 不能拿裹脚布折磨自己.
  • 订了不少Blog, 国外媒体天天上, 凡是重要的, 终归能看到, 不重要的, 看不到也没啥.

附, 为严格执行该精神, 本人已经将三大门户重定向到 wikipedia 首页. 几天下来, 觉得世界是多么的多姿多彩.

2. 在美国这个所谓英语环境下的一些基本事实:

  • 印度同学的发音惨不忍睹, 但是美国人都能听懂. 人家什么敢说.
  • 很多中国同学来美国很多年了, 说过的英文未必有一场脱口秀说得多, 因为在美国, 不说英语也能活得很好.
  • 中国同学喜欢自成圈子, 不太喜欢或者说性格上不习惯外向的和老美接触.

3. 有涯和无涯:

  • “美女如韭菜, 一茬收割完, 还有下一茬” 因此, 泛指的美女是属于无涯之列.
  • 计算机书太多, 属于无涯之列. 但是目前要读的图书馆属于有涯之列.
  • 良辰美景, 佳肴珍馐转瞬即逝, 属于有涯之列.
  • 人生机会, 高朋知己少之又少, 属于有涯之列.
  • 亲情, 爱情, 都是有涯的.
  • 庄子说, 吾生也有涯, 而美女也无涯, 以无涯随有涯, 殆矣. 有涯的人生就是要做有涯的事情. 综上, 多看图书馆的书, 多饱口福, 享受生活, 广交好友. 至于泛美女, 今后少碰(也碰不到).

4. 大拙就是大巧, 可惜只有大巧之人才懂这句话.

  • 无冥冥之志者,无昭昭之明;无昏昏之志者,无赫赫之功
  • 只有偏执狂才能生存.
  • 有些傻子不知道有些事情是不能做成的, 所以他做成了.

5. 如果一个人能从自己这种仅仅因为气壮而显得理直的愤怒中榨取出大量的洋洋得意和道德优势, 或者从市恩情节出发期盼别人的涌泉相报, 那么, 他已经不知不觉中修炼成一个傻逼了.

6. 人是会思考的芦苇, 正是会思考, 才让这棵芦苇没有随风倒. 知识分子思想的独立性是知识分子的存在价值.

Comments (10)

I Am the Very Model of a Modern Major Googler (Song)

LOL. My second favourite song this month.

For lyrics

Comments (1)

Totally random

In a Linux shell with GNU make:

>make love
make: *** No rule to make target ‘love’. Stop

Do you really get tired of this line? Try this:

>vim makefile

love: @ echo “oh, yeah, oh oh oh yea, yes, yes, yes.”

> make love

oh, yeah, oh oh oh yea, yes, yes, yes.

Em, literally ’sounds’ better. BTW, if you are using a Mac. try to pipe this to “say”, which is the command line interface of the embedded Text-to-Speech engine. Well, awesome!

Another one from xkcd:

Any new idea to make fun with Linux?

Thanks to Tinyfool.

images.jpg

Comments (4)

一堵没技术的伪科学的墙

前几天就听说国内邮箱往国外发信出了点问题. 我今天也收到了第一封这样的邮件. 其实挺鄙视这些纸老虎的, 一点技术含量都没有.

上次看到一个”最牛B的共和国卫士“, 于是看到了所谓的HNC, (Hierarchical Network of Concepts), 懂自然语言处理的人一看就知道其实是POS+基于规则. 不知道新语丝有没有兴趣对大正公司的 这套工具打打假. 骗了国家多少血汗银子, 做出了一个极其 SB 的墙. (提示: Google 搜索该英文没有任何其他学术研究, 就是一圈人自娱自乐). 做墙就做墙, 得严肃点专业点, 得符合科学发展观. 搞个没技术含量的伪科学的墙, 简直破坏国家形象啊. 我都替胡主席着急, 毕竟也是关系国家安全, 十七大顺利召开和我党生死存亡的大事!

PS: 最近没什么时间捣鼓这些. 等有时间, 我得好好弄一篇充满对立立场但是就是不撞墙的文章, 来证明所谓的墙, 其实就是纸老虎.

Comments (7)

Fancy Geektool

Lifehacker 介绍了一个很好玩的 Mac 下的工具, 叫做 Geektool. 这工具可以直接把命令行结果放到桌面上. 我也做了一个好玩的截图:

1.jpg[点击可看大图]

我写了一个 AppleScript, 可以读 iTunes 正在播放歌曲的歌词.

set notify to "Not playing"
tell application "iTunes"
	if player state is playing then
		set who to artist of current track as string
		set what to name of current track as string
		set lyric to lyrics of current track as string
		set notify to who & " : " & what & (ASCII character of 10) & lyric
	end if
end tell
set notify to replace_chars(notify, ASCII character of 13, ASCII character of 10)
notify

on replace_chars(this_text, search_string, replacement_string)
	set AppleScript's text item delimiters to the search_string
	set the item_list to every text item of this_text
	set AppleScript's text item delimiters to the replacement_string
	set this_text to the item_list as string
	set AppleScript's text item delimiters to ""
	return this_text
end replace_chars

然后写一个 Shell 脚本, 去调用这个 AppleScript:

#!/bin/bashif [[ -n `ps x | grep "iTunes -psn" | grep -v grep` ]]; then
  osascript ~/bin/itunes-playing.scpt
else
  echo "iTunes off"
fi

最后, 在 Geektool 中设置运行这个脚本就行了.

本文主要参考这篇文章, 脚本除了歌词部分, 其他都是一样的. 就是歌词折腾了我好久, 原来 Mac 底下换行是 \r, 这样输出到 Shell 就不正确了. (可以尝试一下 printf(”abc\rdef”) 就知道为什么了). 最后把输出重定向到文件再用 VIM 才发现全是 ^M. 其实我也考虑到了这个问题, 在程序中替换 “\r”, 只是苹果的 Script Editor 很变态, 每次我敲 “\r” 都自动换成一个换行, 因此费了好大力气, 找到了一个 ASCII character of 10. 说实话, 从来没见过这么平铺直叙的脚本语言…

大家用苹果吧 ;)

Comments (5)

Some useful tools for you to write English articles on Linux

As an ESL (English as Second language) student, I usually have a fear of writing articles. Nevertheless, I have to write about one article per week, either for learning English or for recoding my idea. For many people in China, their killer application is Word and Kingsoft Ciba. They simply type a Chinese phrase into the electronic dictionary, copy and paste the English word, do some grammar check in Word. After doing all of this and Word stops reporting any spelling and grammar error, they feel a grant sense of achievement. I was one of them before.

In the meanwhile, as a Linux deadhead, I dislike M$ products emotionally. It seems to me that the only way out is AbiWord or Openoffice. I’ve used both for a while. Yet, I have to say that they are helpful but not perfect. To use them, I have to prepare a text file, which is inconvenient when you are working on a Tex file. For MacOSX, the other thing is I have to install X11. Don’t get me wrong, *nix is industrial-strength and designed to do everything solely with the shell. (Well, WoW is the last thing in my mind.)

After a painful Googling, now I have at least four tools helping ESL writing.

1. GNU Aspell.

GNU Aspell is a Free and Open Source spell checker. It supports the spell checking for source codes, script comments, TeX files as well as HTML web page and email. Aspell provides the user both interactive and batch mode. It contains several advanced features that are missing in both M$ Office and OO such as text-file-based user-defined dictionary and “sound like” (e.g., know and no). GNU Aspell is definitely for literate programmers or PhD. students who want to write elegant code comments and academic articles.

2. GNU diction

GNU diction is originated from the diction on the AT&T UNIX. It is actually a rule-based style checker. I’ve read the code thoroughly and found that almost every piece of the rule came from a book titled “The Elements of Style” authored by William Strunk. That is to say, you have an “Elements of Style” in your pocket now. Please note that the simple grammar checker in Word has nothing to do with style checking. GNU diction is a charming complement to Word/Openoffice if you insist using them.

As it is rule based. It sometimes provides redundant information even your usage is indeed correct. As D.E. Knuth has mentioned in the “Mathematical Writing”, the analysis of diction is quite superficial. “However, said Don, these programs are kind of fun. And they do provide an excuse to read the document from another point of view. Even if the analysis is wrong it does prompt you to re-read your prose, and this has to be a good thing”.

3. GNU Style

GNU style is contained in GNU diction package. It will report the readability of your article in several well-known indexes. For the native speaker, these are used for improving the readability of the article. Nevertheless, for ESL students, these indexes would be viewed as the writing level in terms of “grade/school year to understand your article for average American”. In my opinion, we ESL students should prevent using too naive words and too simple sentences in technical writing. Definitely don’t use a million dollar word where a one-dollar word will do. Yet for ESL students, trying to use some new and sophisticated words would eventually boost the ability in writing.

4. LanguageTool (GPLed)

It is an open source language checker for English and other languages based on Java. I began to use it recently. It’s better than the embedded grammar checker in Openoffice. Moreover, it does support CLI mode and web mode. This is the missing tool on the Linux platform for grammar checking.

I can remember when I was a collage student, I struggled to write English articles with M$ word or Openoffice. My personal experience with English writing and M$ Word grammar checker brought me the truth that we should never ever rely the quality on the f**king damn grammar checker. As a rule of thumb, the best way to improve ESL writing skill is to write and to practice.

BTW: In preparing this article, I’ve employed vim, aspell, diction, style, languagetool and other tools on the Linux and Mac platform.

Comments (3)

10 reasons why we shouldn’t have the holy war towards others on coding/design style

I came across a story from the Solidot (A Chinese version of Slashdot) this morning that one of the developers in Fcitx project finally decided to terminate it, one of the top open source (GPLed) Chinese input method project on *nix platform. For English-speaking users, the importance of the IME might not be fully realized. For Linux users living in East Asia, IME is somehow equivalent to keyboard. IME is so critical to the software platform such that Google also has developed a Chinese IME recently. So, why did this developer make this decision to terminate such a significant (and also a well-known) project? According to the main page of the project, the core developer got pissed off by an other developer who criticizes this project as a “poor and ugly” coding style. So my question arises: can we developers in the open source community criticize others’ projects on the basis of “coding style”?

Further reading prompts me that criticizing others’ coding style is very common in the open source community. I am not an expert in coding per se, however, I have at least 10 reasons why we shouldn’t have the holy war on the coding or design style towards other developers.

1) In open source community, coding is for run or for fun, not (merely) for read.

Traditionally, most people would thought that the skills that required to write one’s own software are so advanced that one could never hope to write his/her own code one day. However, lots of advanced programming tool such as IDE and some high-level script language have inherently remodeled the schema. Now, lots of beginners are willing to write some code to get things done; and they are as passionate as the gurus to put their code in the public domain. Consequently, their ugly coding/design style has been criticized by others in the community for “not readable” or “not beautiful”. However, what is the purpose of the open source movement? I would like to say that open source movement is about sharing and freedom—you can learn from others and do whatever you want. However, no one in the open source community aims to write the “textbook” source code. We basically write the code for a special purpose. Therefore, people should not criticize form an aesthetic perspective. After all, the coding is for run or for personal fun. Coding for reading is not the purpose per se–at least it is not the original purpose. So, we have to bear with the truth that every developer has his own coding/design style; even sometimes the style is goofy.

2) Style is highly restricted by the language feature, or, the ‘native’ programming language this developer uses.

It has been quite a long time since PERL was first time called pathologically eclectic rubbish lister. However, as I know, lots of researchers around the world use PERL on a daily base. In our department, many colleagues use PERL as their ‘native’ language despite that PERL is somehow write only. Provided this, it is unfair to judge others’ coding style as it differ from language to language. For example, my ‘native’ programming language is Java. When first time I read the book “Text Processing in Python”, I found that “map” operation is amazing when I need apply some homogenous operation on every element in a container with iterator. However, in practice, I still cannot help using “for loop” instead of “map”. As syntactical sugar differs from language to language, it usually requires quite amount of experience before one actually realize the right coding style in some programming languages other than the native one. Therefore, the holy war on the coding style here is similar to the holy war on English and Spanish, which is vulgar and intolerant.

3) Design pattern and coding style reflect the underlying thinking, or different design purpose, which might be difference from person to person.

If you Google “code style”, you will find tons of guidelines ranging from kernel programming to CSS coding style. This is because for a robust and collaborated open source project, a nice coding style will significantly reduce the communication overhead as well as the time wasted on the maintenance. However, what if some one is going to write a system or framework from scratch?

Basically, a coding/design style will somehow reflect the underlying idea. For example, I guess I am not the only one who dislikes the wrapping design in the Java.io package. In order to use a single Unicode string reader from file, you have to warp the FileInputStream with several objects; while in C++ or python, a single statement settles all the chaos. However, the idea of Java IO is putting least assumption upon the IO stream and providing the programmer with the most flexibility. Therefore, merely criticize the coding style to use Java IO or the design of java IO is gratuitous. Frankly speaking, I do not feel like the design style of Apache Struts as it is very complicated for me to deploy a small system (That’s why we have RoR); however, Struts strictly implements the MVC model 2 pattern and hereby makes itself powerful for large systems. Everyone can make up his/her own style at this point. Therefore, the holy war on the coding/design style is similar to choose between apples and pears—it’s not necessary to gauge which one is better, as they are just different fruits from different genesis.

4) Although there might be some rule of thumb to write beautiful code, there is not a unique standard.

As I’ve mentioned before, there is no unique standard in coding/design style as you can always attack the same problem in different approaches. This statement not only holds for the coding style, but also for the XML configuration file style and other design-related stuff. For example, when I was learning the Apache Ant, I would like to call the build.xml as makefile.xml or to have separated XML files for each target, etc. However, it is hard to tell which design is better. In the IME case, the programmer simply uses Chinese as the tag name in the XML file. As you might know, as long as the XML is encoded in UTF-8, it is an issue in neither understanding nor program migration. However, this design was criticized for “not very i18n”. I would say that this judgment is goofy and absurd.

5) Stay foolish

As it is usually hard to define which style is better, the developers in the open source community should indeed stay foolish. I do agree that arguments and the discussions towards a particular project are quite helpful. However, keep this discussion in a polite and elegant way would be more productive.

6) Never judging people by their code style.

Because this doesn’t make any sense. In the book “12 habits that hold good people back”, the author mentioned a kind of people who “see the world in black and white”. One who simply judging person by the coding style falls to this category. Coding style is not the whole part in programming. Moreover, a poor coding style/design does not necessary means the lacking of ability in developing the system.

7) Refactory is a procedure, not a purpose.

Just like Feynman’s famous quote that “physics is like sex”, refactory of the code is just like sex too. Although it may give some practical results, but that’s not why we do it.

In short, refactory is a procedure that makes the code more readable or easier to maintain. However, there is not reason why we should refact the code solely for the aesthetic purpose. I can image that the GoF’s book will boost a passion from the bottom of the hearts of the readers to refact every piece of code written by others. I was one of them. The GoF’s book will definitely help build a “sensitive nose” that can sniff the smell of the code. Probably applying a nice coding style or design pattern is a good practice. I still insist that a nice coding style or sophisticate design pattern is not the reason why we write code.

8) Efficiency or beauty is an issue, but making it workable is the first priority.

When I was interviewed with Google, one of the interviewers gave me a very good suggestion when I got stuck in a problem. He told me that the philosophy at Google is “first make it work, then improve it”. In the open source community, usually the software is for solving a real world problem. Therefore, making it work is much more important than making it beautiful. I have to concede that there are some developers who can achieve both goals in the same time. Nevertheless, for most developers, usually the code is ugly and awkward at the very beginning. If I have to choose in between a piece of workable but ugly code and a piece of beautiful but malfunctioned code, I prefer the previous one. I guess except the coding-style paranoia, everyone will choose the first one. The truth is (or 80-20 principle tells us that): an ugly but workable prototype will cost 20% of the total time; a pretty and not necessarily workable prototype will cost about 80% of the total developing time. As software is changing all the time, on cannot expect to have a “final” version that is both beautiful and workable. Therefore, to choose workable instead of pretty code is wise.

9) Peer review is about finding the (potential) bug, not about the coding style.

I’ve heard that in many big name companies such as Google, the code peer review plays a quite important role. I’ve also once been an intern at Siemens. There, before checking the code into the code repository, usually a colleague will go though your code to see it there’s something wrong. (Of course you have to pass the unit test before you checking in). According to my experience, peer review is more about the nice practice of extreme programming than the code style exam.

In the open source community, the scenario changes: everyone can read your code and figure out what happens in the code. While the developer should expect the feedback from the community, it should be in the form of suggestion or patches instead of fierce criticizing, especially on the coding/design style. Again I would emphasize that open source community should always be polite to the contributors while cruel to the malicious saboteurs.

10) Instead of to say something, why not to do something.

The best way to contribute the open source community is not to say something, but to do something. For instance, if you feel uncomfortable about one project, then instead of writing a letter to the author complaining about their poor coding style, why not just refacting the code and republishing the code? In my humble opinion, barking dogs seldom bite.

Comments (7)

« Previous entries