编程语录.docx

上传人:b****1 文档编号:2524532 上传时间:2023-05-03 格式:DOCX 页数:18 大小:44.74KB
下载 相关 举报
编程语录.docx_第1页
第1页 / 共18页
编程语录.docx_第2页
第2页 / 共18页
编程语录.docx_第3页
第3页 / 共18页
编程语录.docx_第4页
第4页 / 共18页
编程语录.docx_第5页
第5页 / 共18页
编程语录.docx_第6页
第6页 / 共18页
编程语录.docx_第7页
第7页 / 共18页
编程语录.docx_第8页
第8页 / 共18页
编程语录.docx_第9页
第9页 / 共18页
编程语录.docx_第10页
第10页 / 共18页
编程语录.docx_第11页
第11页 / 共18页
编程语录.docx_第12页
第12页 / 共18页
编程语录.docx_第13页
第13页 / 共18页
编程语录.docx_第14页
第14页 / 共18页
编程语录.docx_第15页
第15页 / 共18页
编程语录.docx_第16页
第16页 / 共18页
编程语录.docx_第17页
第17页 / 共18页
编程语录.docx_第18页
第18页 / 共18页
亲,该文档总共18页,全部预览完了,如果喜欢就下载吧!
下载资源
资源描述

编程语录.docx

《编程语录.docx》由会员分享,可在线阅读,更多相关《编程语录.docx(18页珍藏版)》请在冰点文库上搜索。

编程语录.docx

编程语录

下面是“Neo”和“陈皓”的翻译,我们的翻译水平有限,所以,我们提供了中英文对照,有不当之处,还请各位指正。

Agoodprogrammerissomeonewholooksbothwaysbeforecrossingaone-waystreet.—DougLinder,systemsadministrator

好的程序员这样一类人,这类人在横穿一条单行道前都要先看一下路两边。

–DougLinder,系统管理员

Amostimportant,butalsomostelusive,aspectofanytoolisitsinfluenceonthehabitsofthosewhotrainthemselvesinitsuse.Ifthetoolisaprogramminglanguagethisinfluenceis,whetherwelikeitornot,aninfluenceonourthinkinghabits.—EdsgerDijkstra,computerscientist

关于工具,一个最重要的,也是最不易察觉的方面是,工具对使用此工具的人的习惯的潜移默化的影响。

如果这个工具是一门程序语言,不管我们是否喜欢它,它都会影响我们的思维惯式。

–EdsgerDijkstra,计算机科学家,著名的“程序=数据结构+算法”的提出者。

Beingabstractissomethingprofoundlydifferentfrombeingvague…Thepurposeofabstractionisnottobevague,buttocreateanewsemanticlevelinwhichonecanbeabsolutelyprecise.—EdsgerDijkstra

抽象和模糊完全地不同,抽象的目的并不是把事情变模糊,而去创建一个新的语义层,在那里是绝对精确的描述。

—EdsgerDijkstra

Besidesamathematicalinclination,anexceptionallygoodmasteryofone’snativetongueisthemostvitalassetofacompetentprogrammer.—EdsgerDijkstra

除了数学爱好,对于一个有能力的程序员来说,出色地掌握自己的母语是最宝贵的财富。

–EdsgerDijkstra

 

Cmakesiteasytoshootyourselfinthefoot;C++makesitharder,butwhenyoudo,itblowsawayyourwholeleg.—BjarneStroustrup,developeroftheC++programminglanguage

C很容易使你搬起石头砸自己的脚,而C++把这事变得更难,但是如果一定要这么做,那么你的整条腿都会被炸飞-BjarneStroustrup,C++语言的发明者

Commentary:

mostdebuggingproblemsarefixedeasily;identifyingthelocationoftheproblemishard.—unknown

修复bug很容易,但是定位bug却很困难–匿名

Consideringthecurrentsadstateofourcomputerprograms,softwaredevelopmentisclearlystillablackart,andcannotyetbecalledanengineeringdiscipline.—BillClinton,formerPresidentoftheUnitedStates

看看当前计算机程序糟糕的事态,软件开发明显一直是一门妖术,其仍然不能被称为一个工程学。

–比尔.克林顿美国前总统

Foralongtimeitpuzzledmehowsomethingsoexpensive,soleadingedge,couldbesouseless,andthenitoccurredtomethatacomputerisastupidmachinewiththeabilitytodoincrediblysmartthings,whilecomputerprogrammersaresmartpeoplewiththeabilitytodoincrediblystupidthings.Theyare,inshort,aperfectmatch.—BillBryson,author,fromNotesfromaBigCountry

长期以来,有个事一直困扰着我,那就是越是昂贵的,越是前沿的,就越可能是没用的。

然后,困扰我的另一个事是,计算机是一个死的机器,却可以不可思议地去完成那些巧妙的事情,而计算机程序员是那么聪明人却在做着不可思议的愚蠢的事情,简而言之,他们真是天生的一对。

–BillBryson旅游文学作家BigCountry中的笔记

Givenenougheyeballs,allbugsareshallow(e.g.,givenalargeenoughbeta-testerandco-developerbase,almosteveryproblemwillbecharacterizedquicklyandthefixobvioustosomeone).—EricS.Raymond,programmerandadvocateofopensourcesoftware,fromTheCathedralandtheBazaar

足够多的眼睛,就可让所有问题浮现(比如:

只要给于足够多的beta测试者和开发人员一起工作,那么,几所所有的问题都会很快的出现,而修正也会是显而易见的)

Goodcodeisitsownbestdocumentation.Asyou’reabouttoaddacomment,askyourself,‘HowcanIimprovethecodesothatthiscommentisn’tneeded?

’Improvethecodeandthendocumentittomakeitevenclearer.—SteveMcConnell,softwareengineerandauthor,fromCodeComplete

好的代码自己本身就是最好的文档。

当你打算加注释的时候,问问自己‘我如何才能把我的代码改善到不需增加注释?

’重构自己的代码,然后使文档让其更清楚。

—SteveMcConnell《代码大全》的作者

Hey!

Itcompiles!

Shipit!

—unknown

嘿,编译通过了!

出货!

–匿名

Insideeverywell-writtenlargeprogramisawell-writtensmallprogram.—CharlesAntonyRichardHoare,computerscientist

在每个编写精良的大程序里面都是一个编写精良的小程序。

–CharlesAntonyRichardHoare,计算机科学家

Itshouldbenotedthatnoethically-trainedsoftwareengineerwouldeverconsenttowriteaDestroyBaghdadprocedure.BasicprofessionalethicswouldinsteadrequirehimtowriteaDestroyCityprocedure,towhichBaghdadcouldbegivenasaparameter.—NathanielS.Borenstein,computerscientist

需要注意的是,没有哪个经过规范培训的工程师会赞成写一个DestoryBaghdad(摧毁巴克达)的函数。

最基本的职业规范会告诉他们应该去写一个叫DestoryCity的函数,然后把“Baghdad”(巴克达)当成这个函数的参数。

—— NathanielS.Borenstein, 计算机科学家

Managingprogrammersislikeherdingcats.—unknown

管理程序员就如同养一群猫一样–匿名

Measuringprogrammingprogressbylinesofcodeislikemeasuringaircraftbuildingprogressbyweight.—BillGates,co-founderofMicrosoftCorporation

用代码行数来衡量编程的进度,就如同用航空器零件的重量来衡量航空飞机的制造进度一样。

——BillGates,微软创始人

Moregoodcodehasbeenwritteninlanguagesdenouncedasbadthaninlanguagesproclaimedwonderful—muchmore.—BjarneStroustrup,fromTheDesignandEvolutionofC++

好的代码都都在的批评声中写成的,而差的则是在表杨声中写成的。

——BjarneStroustrup,摘自《TheDesignandEvolutionofC++》

Programsmustbewrittenforpeopletoread,andonlyincidentallyformachinestoexecute.—HaroldAbelsonandGeraldJaySussman,computerscientistsandauthors,fromTheStructureandInterpretationofComputerPrograms

代码应该是写给其他人来读的,而能让机器运行的仅仅是附带着的。

—— HaroldAbelson与GeraldJaySussman,计算机科学家和作家,摘自《TheStructureandInterpretationofComputerPrograms》

Realprogrammersdon’tcommenttheircode.Ifitwashardtowrite,itshouldbehardtounderstand.—unknown

真正程序员从来不写代码的注释,如果代码非常难写,那么同样代码的注释也会非常难懂–匿名

Simplicityisprerequisiteforreliability.—EdsgerDijkstra

简单是可靠的前提条件—迪杰斯特拉

TheCprogramminglanguage—alanguagewhichcombinestheflexibilityofassemblylanguagewiththepowerofassemblylanguage.—unknown

C语言——一门同时具有了汇编语言灵活性和汇编语言强大能力的语言。

–匿名

Thefirst90%ofthecodeaccountsforthefirst90%ofthedevelopmenttime.Theremaining10%ofthecodeaccountsfortheother90%ofthedevelopmenttime.—TomCargill,object-orientedprogrammingexpertatBellLabs

开始的90%的代码用了90%的开发时间,而剩下的最后的10%的代码会需要另外90%的开发时间。

–TomCargill,面向对象编程专家,贝尔实验室

Theimportantpointisthatthecostofaddingafeatureisn’tjustthetimeittakestocodeit.Thecostalsoincludestheadditionofanobstacletofutureexpansion.Sure,anygivenfeaturelistcanbeimplemented,givenenoughcodingtime.Butinadditiontocomingoutlate,youwillusuallywindupwithacodebasethatissofragilethatnewideasthatshouldbedead-simplewinduptakinglongerandlongertoworkintothetangledexistingweb.Thetrickistopickthefeaturesthatdon’tfighteachother.—JohnCarmack,computergameprogrammer

增加一个功能特性的成本并不单单是为这些功能编码所花费时间的成本,还这个成本应该包括特性扩展的障碍成本。

当然,任何的功能清单都可以被实现,只需要有足够的时间。

但是除些之外,你应该对你的代码库的脆弱性感到紧张,而那些新的想法应该足够的简单,而不是去花费更多更多的时间去纠缠于现有的蜘蛛网。

这里的决窃是挑选那些不会和别人冲突的的功能。

Thekeytoperformanceiselegance,notbattalionsofspecialcases.Theterribletemptationtotweakshouldberesistedunlessthepayoffisreallynoticeable.—JonBentlyandM.DouglasMcIlroy,bothcomputerscientistsatBellLabs

表现的关键是精美和典雅的,并不是使用大量的特殊案例。

对于任何调整的冲动都应该是被限制的,除非其回报真的是值得注意的。

–JonBentlyandM.DouglasMcIlroy,二者都是贝尔试验实的计算机科学家

ThelastgoodthingwritteninCwasFranzSchubert’sSymphonyNumber9.—ErwinDieterich,programmer

最后一件用C做的好作品就是弗朗茨.舒伯特的C大调第9交响曲—ErwinDieterich,programmer程序员

TheproblemwithusingC++…isthatthere’salreadyastrongtendencyinthelanguagetorequireyoutoknoweverythingbeforeyoucandoanything.—LarryWall,developerofthePerllanguage

使用C++最大的问题是..在C++语言里,存在这一种很强的趋势,就是如果你不明白C++语言的细节,你就无法做好任何事情。

–LarryWall,developerofthePerllanguage

Thesooneryoustarttocode,thelongertheprogramwilltake.—RoyCarlson,UniversityofWisconsin

你越早开始都手编码,你所花费来编程的时间就越长—RoyCarlson,UniversityofWisconsin

Thevalueofaprototypeisintheeducationitgivesyou,notinthecodeitself.—AlanCooper,softwareauthor,fromTheInmatesareRunningtheAsylum

原型的价值在于他给你的教训,而不是代码自身—AlanCooper,softwareauthor,fromTheInmatesareRunningtheAsylum

Thereareonlytwokindsofprogramminglanguages:

thosepeoplealwaysbitchaboutandthosenobodyuses.—BjarneStroustrup

世界上只有两类编程语言:

人们都抱怨的语言和从来没有人使用的语言—BjarneStroustrup

Therearetwowaysofconstructingasoftwaredesign.Onewayistomakeitsosimplethatthereareobviouslynodeficiencies.Andtheotherwayistomakeitsocomplicatedthattherearenoobviousdeficiencies.—CharlesAntonyRichardHoare

世界上有两个设计软件的方法,一种方法是设计的尽量简单,以至于明显的没有什么缺陷,另外一种方式是使他尽量的复杂,以至于其缺陷不那么明显。

Uglyprogramsarelikeuglysuspensionbridges:

they’remuchmoreliabletocollapsethanprettyones,becausethewayhumans(especiallyengineer-humans)perceivebeautyisintimatelyrelatedtoourabilitytoprocessandunderstandcomplexity.Alanguagethatmakesithardtowriteelegantcodemakesithardtowritegoodcode.—EricS.Raymond

丑陋的程序就像一座丑陋的吊桥:

他们相比漂亮的良好的吊桥起来,更有可能会坍塌,这是因为人类(尤其是工程师)感知漂亮的东西是和我们处理和理解复杂问题的能力相关的。

所以,一个程序语言如果很难以优雅地方式编程,那么其就很难写出好的代码。

Weeksofprogrammingcansaveyouhoursofplanning.—unknown

多做几周的编程可以节省你做计划的时间——匿名(意思为,只有实践过了,你才更容易做计划,没有实践过,做起计划来将会很头痛)

WhenaprogramminglanguageiscreatedthatallowsprogrammerstoprograminsimpleEnglish,itwillbediscoveredthatprogrammerscannotspeakEnglish.—unknown

当程序语言被设计成允许程序以很简单的英语来编程的时候,人们将会发现编写程序的程序员都来自不会说英语的地方。

–匿名

(全文完,翻译水平有限,如果有误,还请批评指正!

22条经典的编程引言编辑本段回目录

下面的这些经典的引言来自英文,也许有些我翻译的是不很好,所以,我提供了中英对照,如果有问题,请大家指正。

 

过早的优化是万恶之源。

Prematureoptimizationistherootofallevil!

-DonaldKnuth

 

在水里行走和以一个需求规格进行软件开发,有一点是相同的,那就是如果水或需求都被冻住不了,那么行走和软件开发都会变得容易。

Walkingonwateranddevelopingsoftwarefromaspecificationareeasyifbotharefrozen

-EdwardVBerard

 

Hofstadter定理:

“一件事情总是会花费比你预期更多的时间,就算是你已经考虑过本条Hofstadter定理”。

Italwaystakeslongerthanyouexpect,evenwhenyoutakeintoaccountHofstadter’sLaw.

-Hofstadter’sLaw

 

有些遇到问题的人总是会说“我知道,我会使用正则表达式”,那么,你现在有两个问题了。

(意思是:

你本想用正则表达式来解决你已有问题,但实际上你又引入了“正则表达式”的一个新问题)Somepeople,whenconfrontedwithaproblem,think“Iknow,I’lluseregularexpressions.”Nowtheyhavetwoproblems

-JamieZawinski

 

调试程序的难度是写代码的两倍。

因此,只要你的代码写的尽可能的清楚,那么你在调试代码时就不需要那么地有技巧。

Debuggingistwiceashardaswritingthecodeinthefirstplace.Therefore,ifyouwritethecodeascleverlyaspossible,youare,bydefinition,notsmartenoughtodebugit.

-BrianKernighan

 

用代码行来衡量开发进度,无异于用重量来衡量制造飞机的进度。

Measuringprogrammingprogressbylinesofcodeislikemeasuringaircraftbuildingprogressbyweight.

-BillGates

 

PHP被一些不合格的业余人员造就成了一个小恶魔;而Perl则是被一些熟练的但不正当的专业人员造就成了一个超级大恶魔。

PHPisaminorevi

展开阅读全文
相关资源
猜你喜欢
相关搜索
资源标签

当前位置:首页 > 农林牧渔 > 林学

copyright@ 2008-2023 冰点文库 网站版权所有

经营许可证编号:鄂ICP备19020893号-2