You Gotta Care About the Code

You Gotta Care About the Code

Pete Goodliffe

IT DOESN’T TAKE SHERLOCK HOLMES to work out that good programmers write good code. Bad programmers…don’t. They produce monstrosities that the rest of us have to clean up. You want to write the good stuff, right?

You want to be a good programmer.

Good code doesn’t pop out of thin air. It isn’t something that happens by luck when the planets align. To get good code, you have to work at it. Hard. And you’ll only get good code if you actually care about good code.

Good programming is not born from mere technical competence. I’ve seen highly intellectual programmers who can produce intense and impressive algorithms, who know their language standard by heart, but who write the most awful code. It’s painful to read, painful to use, and painful to modify. I’ve seen more humble programmers who stick to very simple code, but who write elegant and expressive programs that are a joy to work with.

Based on my years of experience in the software factory, I’ve concluded that the real difference between adequate programmers and great programmers is this: attitude. Good programming lies in taking a professional approach, and wanting to write the best software you can, within the real-world constraints and pressures of the software factory.

The code to hell is paved with good intentions. To be an excellent programmer, you have to rise above good intentions, and actually care about the code—foster posi- tive perspectives and develop healthy attitudes. Great code is carefully crafted by master artisans, not thoughtlessly hacked out by sloppy programmers or erected mysteriously by self-professed coding gurus.

?

???????????????You want to write good code. You want to be a good programmer. So, you care about the code:

? In any coding situation, you refuse to hack something that only seems to work. You strive to craft elegant code that is clearly correct (and has good tests to show that it is correct).

? You write code that is discoverable (that other programmers can easily pick up and understand), that is maintainable (that you, or other programmers, will be easily able to modify in the future), and that is correct (you take all steps possible to determine that you have solved the problem, not just made it look like the program works).

? You work well alongside other programmers. No programmer is an island. Few programmers work alone; most work in a team of program- mers, either in a company environment or on an open source project. You consider other programmers and construct code that others can read. You want the team to write the best software possible, rather than to make yourself look clever.

? Any time you touch a piece of code, you strive to leave it better than you found it (either better structured, better tested, more understandable…).

? You care about code and about programming, so you are constantly learning new languages, idioms, and techniques. But you apply them only when appropriate.

Fortunately, you’re reading this collection of advice because you do care about code. It interests you. It’s your passion. Have fun programming. Enjoy cutting code to solve tricky problems. Produce software that makes you proud.

时间: 2024-10-06 15:44:52

You Gotta Care About the Code的相关文章

从微信官方获取微信公众号名片:http://open.weixin.qq.com/qr/code/?username=haihongruanjian

从微信官方获取微信公众号名片:http://open.weixin.qq.com/qr/code/?username=haihongruanjian 个人的号,不知道怎么获取.

微信 {"errcode":40029,"errmsg":"invalid code, hints: [ req_id: Cf.y.a0389s108 ]"}

{"errcode":40029,"errmsg":"invalid code, hints: [ req_id: Cf.y.a0389s108 ]"} 问题:微信网页授权后,获取到 openid 了,一刷新又没了 微信网页授权获取到的 code 只能使用一次(5分钟内有效),使用一次后,马上失效. 页面授权跳转成功,根据 code 也换取到 openid 了. 此时刷新页面,并不会再次进行授权,而是直接刷新了一下上一次授权跳转后的链接,带的还是

在linux系统中安装VSCode(Visual Studio Code)

1.从官网下载压缩包(话说下载下来解压就直接可以运行了咧,都不需要make) 访问Visual Studio Code官网 https://code.visualstudio.com/docs?dv=linux64 我是64位的: wget https://az764295.vo.msecnd.net/stable/7ba55c5860b152d999dda59393ca3ebeb1b5c85f/code-stable-code_1.7.2-1479766213_amd64.tar.gz 2.解

set up trace code tool

這以 GNU GLOBAL 6.5.6 為示範 1: install GNU GLOBAL https://www.gnu.org/software/global/download.html sudo ./configure; 若有以下 error,請看更下方的 Q5 說明. configure: checking "location of ncurses.h file"... configure: error: curses library is required but not f

Ubuntu16.04下安装VS Code

在Ubuntu下面安装Visual Studio Code sudo add-apt-repository ppa:ubuntu-desktop/ubuntu-make sudo apt-get update sudo apt-get install ubuntu-make umake web visual-studio-code 终于又看见亲切的大麻花了

CSDN code使用教程之git用法详解

首先需要下载GIT客户端,http://git-scm.com/downloads...   然后再code.csdn.net上面创建一个项目,如果 你的项目已经存在,那么请建立项目的时候不要选择自动生成readme文件.填写项目名称,去掉下面的勾勾,然后点击创建就OK了. 下面的就是配置本地客户端了,确认你在CSDN id,获取的方式是在登录后,进入passport.csdn.net,在"个人帐号"的最下端查看用户名:也就是你的昵称,我的就是Linux_Google 然后在命令行中输

.NET跨平台之mac 下vs code 多层架构编程

合肥程序员群:49313181.    合肥实名程序员群:128131462 (不愿透露姓名和信息者勿加入,申请备注填写姓名+技术+工作年限) Q  Q:408365330     E-Mail:[email protected] 概述: 为了研究跨平台.NET 开发,我打算利用.NET core 编写一个跨平台的cms,这个CMS我也秉着开源的原则放到github上面,为.NET 开源社区做点小小的贡献吧.如果有兴趣的可以联系我一起为.NET开源和跨平台做点小小的贡献吧.EgojitCMS传送

安装GO语言环境之安装Visual Studio Code插件

在安装Visual Studio Code插件的时候,由于谷歌的限制,在下载下列插件的时候会报错: go get -u -v github.com/nsf/gocode go get -u -v github.com/rogpeppe/godef go get -u -v github.com/golang/lint/golint go get -u -v github.com/lukehoban/go-find-references go get -u -v github.com/lukeho

Code First添加一个现有数据库中的表

描述 刚刚使用EF,还没搞明白,遇到下面问题,记录一下. 都说EF好用,一直也没用过,以前写代码都是ADO.NET,写起来费时费力还没什么大进展,如果能把这些事简化一下把精力放到逻辑或者更有用的地方岂不是更好.所以想使用EF.Code First,从字面的意思来看是先有代码后有数据库,通过Model来创建数据库,好像只能是通过Model来生成数据库,至少我接触2天以来是这样,项目已经开始一段时间了,数据库已经有一定的数据,虽然是测试数据,但也不想删掉,从新添加数据也是很烦人的事.想找到一种能够不