优秀的程序 vs 糟糕的程序

开发者Rahul Singh近日在其个人博客中列出了他眼中的优秀的程序和糟糕的程序:

引用

优秀的程序可以使复杂的东西看起来很简单;糟糕的程序让原本简单的东西变得复杂。

优秀的程序不需要加以说明;糟糕的程序需要大量注释。

优秀的程序编写时需要更多时间,但未来花费的时间却更少;糟糕的程序往往花费较少的时间,但会在未来浪费掉更多时间。

优秀的程序需要考虑当前和未来的需求;糟糕的程序只侧重于现在,在未来可能无法正常工作。

优秀的程序非常易于维护;糟糕的程序难以维护。

优秀的程序有更长的生命周期,甚至应用范围超出预期;糟糕的程序在其工作范围之外几乎无法使用。

优秀的程序如同良好的习惯,其影响将持续很长一段时间,几乎可以永久地解决问题;糟糕的程序如同止痛药,其效果只有很短的时间,解决问题大多是暂时的。

优秀的程序是整洁的、遵守规律的;糟糕的程序是混乱的。

优秀的程序可以令人学到很多编程方法和经验;糟糕的程序只能令人越学越糟。

优秀的程序中,该重用的地方重用,该发明的地方发明;糟糕的程序会重新发明轮子,并在适合发明的地方重用。

优秀的程序依靠程序员的直觉和知识,并经过了多年良好程序习惯的熏陶;糟糕的程序往往盲目依赖他人的知识和经验,而没有自己的理解。

优秀的程序可以很容易地从一个程序员转移给另一个程序员;糟糕的程序只能被编写者理解和实施。

优秀的程序员不会刻意去记忆一段代码,他依赖于他的逻辑思维能力和理解,并能在未来轻松改善代码;糟糕的程序员往往会记住很多自己不理解的代码。

优秀的程序都有相同的特征,如简单、可读性强、效率高;糟糕的程序各有糟糕之处。

优秀的程序比程序员存在的时间要更久;糟糕的程序存在的时间很短。

Good Programming, Bad Programming

November 17, 2012

Some thoughts on Good Programming and Bad Programming:

Good Programming makes even complex things seem simple.
Bad Programming makes even simple things complex.

Good programming is self-explanatory.
Bad Programming requires explanation.

Good Programming takes more time now, but less time in future.
Bad Programming takes less time now, but more time in future.

Good Programming involves considering present and future requirements.
Bad Programming focuses only on the present and may not work in future.

Good Programs are easy to maintain.
Bad Programs are hard to maintain.

Good Programs have a longer lifespan, and may even outlast the purpose for which they were created.
Bad Programs have short lifespan and barely usable outside their working scope.

Good Programs are like good habits, whose effects last for a long time and solves the problem almost permanently.
Bad Programs are like painkillers, whose effects last for only short time and solves the problem mostly temporarily.

Good Programming is clean and disciplined.
Bad Programming is messy and chaotic.

Good Programming is learned, practiced and mastered over a period of years.
Bad Programming is self brought, and when practiced for long time makes it even more difficult to learn good programming.

Good Programming is knowing when to invent and when to reuse.
Bad Programming is inventing what's already invented, and reusing what can be better invented.

Good Programming is relying on your own instincts and knowledge, gained after years of good programming practice.
Bad Programming is relying blindly on others knowledge and experience, without applying your own understanding.

Good Programs can be transferred from one programmer to another programmer.
Bad Programs can only be understood and implemented by the same programmer.

Good Programmer doesn't memorize piece of code. He relies on his logical skills and understanding, and can enhance the code easily in future.
Bad Programmer memorizes the piece of code instead of taking right efforts to learn it, and has difficulty in making changes to the code.

Good Programs are good for similar reasons like simplicity, readability, and efficiency.
Every Bad Program is bad for its own reason.

Good Programming Concepts outlast the life of a programmer.
Bad Programming Concepts die with the programmer.

http://www.singhrahul.com/2012/11/good-programming-bad-programming.html

Python网络爬虫与推荐算法新闻推荐平台:网络爬虫:通过Python实现新浪新闻的爬取,可爬取新闻页面上的标题、文本、图片、视频链接(保留排版) 推荐算法:权重衰减+标签推荐+区域推荐+热点推荐.zip项目工程资源经过严格测试可直接运行成功且功能正常的情况才上传,可轻松复刻,拿到资料包后可轻松复现出一样的项目,本人系统开发经验充足(全领域),有任何使用问题欢迎随时与我联系,我会及时为您解惑,提供帮助。 【资源内容】:包含完整源码+工程文件+说明(如有)等。答辩评审平均分达到96分,放心下载使用!可轻松复现,设计报告也可借鉴此项目,该资源内项目代码都经过测试运行成功,功能ok的情况下才上传的。 【提供帮助】:有任何使用问题欢迎随时与我联系,我会及时解答解惑,提供帮助 【附带帮助】:若还需要相关开发工具、学习资料等,我会提供帮助,提供资料,鼓励学习进步 【项目价值】:可用在相关项目设计中,皆可应用在项目、毕业设计、课程设计、期末/期中/大作业、工程实训、大创等学科竞赛比赛、初期项目立项、学习/练手等方面,可借鉴此优质项目实现复刻,设计报告也可借鉴此项目,也可基于此项目来扩展开发出更多功能 下载后请首先打开README文件(如有),项目工程可直接复现复刻,如果基础还行,也可在此程序基础上进行修改,以实现其它功能。供开源学习/技术交流/学习参考,勿用于商业用途。质量优质,放心下载使用。
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值