Posts Tagged ‘ coding

Software Engineering Proverbs [zz]

原文

collected by Tom Van Vleck


A clever person solves a problem.
A wise person avoids it.

– Einstein


André Bensoussan once explained to me the difference between a programmer and a designer:

“If you make a general statement, a programmer says, ‘Yes, but…’
while a designer says, ‘Yes, and…’”


No matter what the problem is,
it’s always a people problem.

Jerry Weinberg


Wexelblat’s Scheduling Algorithm:

Choose two:

  • Good
  • Fast
  • Cheap

Craziness is doing the same thing and expecting a different result.

Tom DeMarco, rephrasing Einstein, who said

Insanity: doing the same thing over and over again and expecting different results.


“There’s no time to stop for gas, we’re already late”

– Karin Donker


Deming’s 14 points
  1. Create constancy of purpose.
  2. Adopt the new philosophy.
  3. Cease dependence on mass inspection to achieve quality.
  4. Minimize total cost, not initial price of supplies.
  5. Improve constantly the system of production and service.
  6. Institute training on the job.
  7. Institute leadership.
  8. Drive out fear.
  9. Break down barriers between departments.
  10. Eliminate slogans, exhortations, and numerical targets.
  11. Eliminate work standards (quotas) and management by objective.
  12. Remove barriers that rob workers, engineers, and managers of their right to pride of workmanship.
  13. Institute a vigorous program of education and self-improvement.
  14. Put everyone in the company to work to accomplish the transformation.

We know about as much about software quality problems as they knew about the Black Plague in the 1600s. We’ve seen the victims’ agonies and helped burn the corpses. We don’t know what causes it; we don’t really know if there is only one disease. We just suffer — and keep pouring our sewage into our water supply.

– Tom Van Vleck


The Troops Know
  • The schedule doesn’t have enough time for maintenance in it.
  • A lot of bugs get past the tests.
  • Most old code can’t be maintained.

To go faster, slow down. Everybody who knows about orbital mechanics understands that.

– Scott Cherf


Everybody Knows:
  • Discipline is the best tool.
  • Design first, then code.
  • Don’t patch bugs out, rewrite them out.
  • Don’t test bugs out, design them out.

Everybody Knows:
  • If you don’t understand it, you can’t program it.
  • If you didn’t measure it, you didn’t do it.

Everybody Knows:

If something is worth doing once, it’s worth building a tool to do it.


Your problem is another’s solution;
Your solution will be his problem.


Everybody Knows:
  • If you’ve found 3 bugs in a program, best estimate is that there are 3 more.
  • 60% of product cost comes after initial shipment.

The significant problems we face cannot be solved by the same level of thinking that created them.

– Albert Einstein


On the radio the other night, Jimmy Connors said the best advice he ever got was from Bobby Riggs:

  • do it
  • do it right
  • do it right now

It is not enough to do your best: you must know what to do, and THEN do your best.

– W. Edwards Deming


A leader is best when people barely know that he exists.
Less good when they obey and acclaim him.
Worse when they fear and despise him.
Fail to honor people, and they fail to honor you.
But of a good leader, when his work is done, his aim fulfilled,
they will say, “We did this ourselves.”

– Lao-Tzu


You must be the change
You wish to see in the world

– Gandhi


Experiment escorts us last,
His pungent company
Will not allow an axiom
An opportunity.

– Emily Dickinson


when the cart stops
do you whip the cart
or whip the ox?


Q: How many QA testers does it take to change a lightbulb?
A: QA testers don’t change anything. They just report that it’s dark.

Kerry Zallar


Q: How many software engineers does it take to change a lightbulb?
A: Just one. But the house falls down.

Andrew Siwko


One test is worth a thousand opinions.


“If you didn’t write it down, it didn’t happen.”

This saying is popular among scientists (doing experiments), but I believe it applies to software testing, particularly for real-time systems.

Larry Zana


We reject kings, presidents, and voting.
We believe in rough consensus and running code.

Dave Clark (1992)


I am a design chauvinist. I believe that good design is magical and not to be lightly tinkered with. The difference between a great design and a lousy one is in the meshing of the thousand details that either fit or don’t, and the spirit of the passionate intellect that has tied them together, or tried. That’s why programming—or buying software—on the basis of “lists of features” is a doomed and misguided effort. The features can be thrown together, as in a garbage can, or carefully laid together and interwoven in elegant unification, as in APL, or the Forth language, or the game of chess.

– Ted Nelson


Software is Too Important to be Left to Programmers, by Meilir Page-Jones.


“If you think good architecture is expensive, try bad architecture.”

– Brian Foote and Joseph Yoder


Abraham Lincoln reportedly said that, given eight hours to chop down a tree, he’d spend six sharpening his axe.

– TidBITS 654, quoted by Derek K. Miller, via Art Evans


… while we all know that unmastered complexity is at the root of the misery, we do not know what degree of simplicity can be obtained, nor to what extent the intrinsic complexity of the whole design has to show up in the interfaces. We simply do not know yet the limits of disentanglement. We do not know yet whether intrinsic intricacy can be distinguished from accidental intricacy.

– E. W. Dijkstra, Communications of the ACM, Mar 2001, Vol. 44, No. 3


You can only find truth with logic if you have already found truth without it.

– Gilbert Keith Chesterton (1874-1936) “ The Man who was Orthodox“, via Paul Black


Here is a great page about some kinds of management actually observed, and some insights on quality processes, by Joseph Koshy, via Robert Watson

  • Share/Bookmark

如何在Java的enum中使用annotation

刚才在写一个方法的时候试图在enum上使用annotation:

public enum DataKey {
    @Incremental
    @FromProbe
    @Transient(replacePolicy = ReplacePlolicy.REPLACE_IF_LATER_THAN)
    VISIT_COUNT
}

然后在merge的时候使用annotation:

if (key.getClass().isAnnotationPresent(Transient.class)) {
    ...
}

结果不进if,debug时发现key(DataKey的对象)的类型是DataKey(其实也挺顺理成章的),于是使用如下代码:

if (DataKey.class.getField(key.name()).isAnnotationPresent(Transient.class)) {
    ...
}

结果正确。
结论:在对enum类型使用FIELD一级annotation时需要使用第二种方法进行反射

  • Share/Bookmark

printf(“no title”);

春天就这么不知不觉地来了,公司前的护城河化了,沙尘暴快来了,杨树开始掉毛毛虫了,再过两天杨絮该满天飞了,凯子开始叫了……

早上10点多起,洗了个澡,把昨天晚上煎鸡蛋的锅刷了,出门打车去公司。在麦当劳买了两个双吉当午饭。这段时间一直在吃麦记,目的很简单,只想稍微长一点体重(正减肥的姐妹们别拍我),很久以前看过一个叫“Super Size Me”的片子,讲一哥们儿怎么发扬神农的精神,天天吃麦记,只为了证明那是垃圾食品,结果不负众望地增肥成功。而我,毕竟188/70太瘦了,得稍微壮一点。

到了公司,煮上去年从美国带回来的咖啡,开电脑,电驴里Lou Bega的歌当完了。推荐一下他的歌吧,是属于那种我一听就爱上的类型。Lou的歌是所谓的“mambo”风格,其实跟latin很像,源于南美,伴奏主要是萨克斯、吉他、钢琴、小号、手鼓,节奏感很强。而Lou往里加了很多新的元素,比如电子乐,rap,电子和声。描写爱情、普通生活的歌居多,而且词写得很口语化,不少还带脏字(但还没到粗口的地步)。到目前为止我能找到的只有他4张专辑:《Ladies & Gentlemen》、《A Little Bit of Membo》、《Membo No. 5》和《Lounatic》,第一、二张是当初易趣还没挂的时候从上面淘的,第三张好像就几首单曲,而且跟第二张有重复,四张就是我在电驴上下的这个。先贴几张专辑封面,百度上很少,谁要的话可以拷给你:-)

lou_1.png

lou_2.png

lou_3.png

再帖一首词

Money

Every morning I wake up by your side
Oh my feeling is so strong I cannot hide
I wan’t to hold you every second that I live
And when you ain’t next to me I get possessive
You make me happy and you buy me things
Cars and chicks and diamond rings
All the stuff that is blinkin’

[VERSE]

Some people say that money isn’t everything
I tell them no, look, you also need a diamond ring
And a ton of gold and a lot of shares
Your honey wants a private jet ?
Man who cares
You satisfy me and you turn me on
And that is why I sing this song
My dream is to own a money money factory

本来想推荐《We Makin’ Love》的,结果没找到词,有空听写吧。

  • Share/Bookmark

System.out.println(“no title”);

凌晨2点

看了MySQL的集群和Tomcat集群的资料,觉得有搞头。MySQL的cluster貌似在免费版里就有支持,但没找到详细文档,得让贤钦搭个环境测一下

看了韬子的博,丫得限酒了

烤了两片面包,其实主要是为了吃花生酱,哎从小就对这个没有抵抗力,给我一杯水我可以淡嘴吃一罐

上网买了一套FX的东西,名片夹,零钱包(一口气买了3个),可惜钱包没货了,过两天再去看看。FX其实是个不错的品牌,做的东西尤其是钱包还是有点品位的,而且也不算太贵。发现自己的品牌观念算是比较从一而终的,目前为止:FX钱包,捷安特的自行车,海飞丝的洗发水,海盗船的银饰,宜家的家具,umbro的鞋,S&K的裤子,罗技的鼠标,google的app,和路雪的蛋筒,百事的果粒橙,可口的可乐,优衣库的衬衫,中南海的烟,索爱的手机(对了,说到这个想起来了,今年决定放弃入iPhone的计划,改索爱的G900)……

今天玩了一下鬼泣 4的demo,果然是巨作,上淘宝看了一下,最便宜的300,有没有牛人跳出来把蓝光破解了造福全人类啊~~决定和凯子合买一套,应该能玩个2,3个月的吧

这个月另一个购物计划:惠威的2.0音箱,现在正在1010和1080之间犹豫,5寸的1080貌似有点大,但只比4寸的1010贵了100块钱,音质应该好不少,改天去村里看看有没有现场试听的

回了

  • Share/Bookmark

水穿石死了

一年多没来水穿石了,大运村地下室一个大学生自己的咖啡吧。今天突然想起来来这里坐坐。一进门,惊奇地发现基本没人,再一看吧台,老板换了,漂亮的服务生姐姐没了。坐下点单,招牌的水穿石咖啡竟然也没了,无线网络也没了……

还记得06年的水穿石,曾经是我们Nazca的开发基地,经常整个team就在这里从下午干到凌晨。Coding,调试,测试,部署,累了抽颗烟,翻几页杂志,饿了有奶油培根面或海鲜面,烦了和漂亮的服务生姐姐开开玩笑,大杯的水穿石曾是我的最爱,每周一,三,五晚上还有大屏幕的电影看,世界杯的时候这里还是北航的看球基地……现在这些都已经只是记忆了,墙上的相框依旧,杂志架上的杂志依旧,CD架上的CD依旧,昏暗的灯光依旧,桌子上的台灯依旧,但是,这已经不是水穿石了。

从手机里删掉水穿石的电话,拿一张名片留作纪念,以后应该不会再来了,美好的东西还是只留在记忆里吧。

(谨以此文纪念记忆中的水穿石,和Nazca在水穿石快乐coding的日子)

  • Share/Bookmark