-
做简单重复的事是在浪费注意力
(FromTheProductive Programmer)
计算机之所以存在就是为了执行简单重复的任务的,你应该让它们去工作!找出那些每天、每周都在做的重复工作,问问你自己:我能把这件事自动化吗?把重复的工作自动化,就能给你更多的时间来做有用的事,而不是一遍又一遍地解决没有营养的问题。亲手做那些简单重复的事会浪费你的注意力,将这些烦人的杂事自动化,你就可以把宝贵的精力用来做其他更有价值的事。
-
You Break It, You Fix It
(FromTheBuildMaster)
This leads to one of the most important rules in the build lab:The build team never fixes build breaks, regardless of how trivial the break is.That’s the developer’s responsibility. We took this a step further: The developer whobreaksthebuild has to go to his development machine, check out the file, fix it, and then go through all thecheck-inprocess steps again.
Build Breaks Always Have the Highest Priority for Everyone
This rule means that if you are a developer and you can fix the build break, and the developer whobrokethebuild cannot be found, you should fix it immediately. Afterward, send an e-mail to the developer andthebuildteam explaining what you did to fix the build, and remind your co-worker that he owes you a favor.
-
装象你好歹也插根葱
这个数学公式所表达的意思就是Google的总价值等于它抓取的网页蕴含的总价值减去它的运营成本,VG可以看作Google占有的互联网信息剩余价值。
张五常看见这玩意能被气死。佛里曼半辈子讲交易成本,这帮伪经济学家们还是无视之。价值是会因为交易成本而消散的呀,同志。
葱都懒得插一根,翘着个猪拱嘴就愣充象,这玩意他不光是能力问题,他还是个态度问题。
-
Microsoft's Build Lab
(FromTheBuildMaster)
Because a build lab tends to have some downtime while the build team waits for compiles, links, andteststofinish, it should take advantage of these slow times to work on improvements to the build process.Afterthe labtests the improvements and confirms they are ready for primetime, it rolls out the changes. One waytodeploy anew build process after a shipping cycle is to send a memo to the whole team pointing to an internalWebsitethat has directions on the new process that the Central Build Team will be using in future productbuilds.
Today, the Windows build lab has its own development team working on writing and maintaining new andoldprojecttools. The development team also works on deploying new build processes. Conversely, of the morethan200customers I’ve spoken to, only one or two of them have developers working in a build team.
In 1991, Windows NT had only a few hundred thousand lines of code, unlike the more than 40 millionlinesof codethat Windows XP has today. Even in the early stages of developing Windows NT, Microsoft recognizedtheimportance of a good build process.
-
一本好书
-
Hyperproductivity, and Skip To My Lou
David Bock在给Neal Ford的The Productive Programmer的序里提到这个词:
We spent some time discussing thathyperproductivityand how to bottle it.
另一处提到这个词的是Paul Virilio的blog
A worker in the textile industry in western France says, “I make the same movement sixhundredtimes an hour. With the old machines, you could have a bit of a break. Now, it’s the computerthatcontrols the assembly line and sets the pace.”
With this level ofhyperproductivity, in which a person can no longer keep up with theracing of hisdigital command tools, we are seeing a new epidemic, following the outbreak of stress.RepetitiveStrain Injury,orRSI─ acute inflammation of the bones and joints ─ is a new professional disease. It can lead tolong-term paralysisof the employee’s hands.
但这不是──不仅仅是──身体和压力的问题。这是劳动的异化。这是现代化对人性的侵蚀。
再看一遍Skip 2 My Lou的老视频。再看一场Rockets的比赛。
正确的方式,高效的方式,全无浪费的方式,未必等价于有想象力的方式,美的方式,自己喜爱的方式。这才是资本主义的病根所在。
-
MySQL掉线咯
一个后台操作算得太久,然后再想跟MySQL说说话的时候,就发现那个server已经偷偷的跑掉了。
MySQL的超时可以用SQL查到:
mysql show variables;
看interactive_timeout和wait_timeout这两项。缺省是28800(秒),我们的服务器上设成了600。所以,一个长循环跑了11分钟之后,数据库连接已经被关掉了,因为中间没有和数据库打交道。
(多长的循环可以跑10分钟?我看到的大概是8000多和20000多的两个数组做了一下select…)
这些变量可以在/etc/my.cnf里面设置的。
Rails应用可以把ActiveRecord::Base.verification_timeout设为一个小于数据库连接超时的值(比如500)这样Rails就会帮你每过500秒PING一下数据库这样连接就不会断掉了。
(唔…10分钟会让很多东西超时,比如Apache…)
然则我们的操作是Rails之外的一个stand-alone进程,Rails也不管帮忙它,所以要在循环的过程中时不时的PING一下数据库:
ActiveRecord::Base.connection.verify!(0)
于是就可以了。
-
坦尼斯·塔西斯之旅
坦尼斯突然转过身,看着南方。为什么是我?他不停地问着自己。我对自己的未来毫无概念,大家却都希望我领导他们。我没有像史东一样有驱逐恶龙,成为修玛第二的理想。我也没有像伊力斯坦有着把真神的知识散布给每个人的神圣使命。我甚至不像雷斯林热衷于追逐强大的力量。
史东推推他,示意他往前看。一线低矮的山脉出现在地平线上。如果坎德人的地图是正确的,塔西斯城就在这些丘陵的后面。
塔西斯,有翼的白色天鹅船,白色闪耀的高塔。美丽之城塔西斯。
-
好的设计从哪里来
河里的青蛙从哪里来,是从那水田向河里游来。
这样的设计调整遇到过多少次?
基本上,每个项目都有,一年两三次吧。
下次做复杂的功能之前多做点设计吧,免得还有类似这样的调整。
好的设计真的不是做出来的。它是长出来的。
测试驱动出来的高质量的代码基础就像土壤,平时的持续集成和重构就像精耕细作。播下问题的种子,你就看着它长出来。有时候自然长出来的设计不对,于是你调整它。好的设计就在不断不断的调整当中浮现出来了。
(所以,一开始的设计是好的固然好,但更重要的是调整的能力。有些项目,好的设计会慢慢浮现出来。有些项目,好的设计也会慢慢腐化。)
可是,什么时候该忍着,什么时候才该动手调整?
不知道。不过,程序员的鼻子(和胃)知道。所以,别烦他们,别拿进度之类的玩意吓唬他们。给他们轻松,他们就会做出正确的事。
不然,反正你也没办法知道什么是正确的事。
-
工业界是时候严肃认真了
偶像切尔斯基:敏捷质疑:TDD
我认为工业界是时候严肃认真的考虑测试环境了, 最好在语言中内建对测试的支持, 一些为产品环境设计的语言特性, 应该在测试环境中关闭, 而在产品环境中生效. 其实之前很多编译器都支持Release 和Debug 两种环境, 也是从代码质量的方面考虑的. 现在毫无疑问证实单元测试比 Debug 更有效, 是时候与时俱进增加对 Test 的支持而逐渐罢黜对 Debug 的支持.
不过我认为工业界是时候严肃认真的考虑的不是内建对测试的支持而是对类型推导的重视。要让程序不出错,一大堆和更大的一堆错误侦测机制都解决不了这个问题,你应该写不会出错的程序。当然debugger本身就是一个鸡肋,在exceptionstack trace帮不了你的情况下,debugger也帮不了你。
(写出像Erlang那样不会出错的程序吧。写出像Haskell那样不会出错的程序吧。)
尤其是在并行计算的时代。当然就算不考虑并行计算,类型体系是能让程序不出错的严肃认真的办法。写得快并且具有类型推导的语言是应该被严肃认真的考虑的。