难道C++程序员不也是人吗?

原创 2003年09月09日 08:58:00

星期一的早上就看到如此有趣的文章,让我心情愉快。

C++程序员难道真的就低人一等(或者说,高人一等)吗?作为一种常用的OO语言,C++得到的支持少得可怜。特别是,自动化重构工具和单元测试IDE集成的缺乏,使得C++几乎不可能成为XP团队的首选——或者说,使得很多C++团队错失了实施XP的机会。

————————

Let's Reconsider That

Aren't C++ Programmers People Too?

by Michael Feathers
August 23, 2003
Summary
The industry needs refactoring tools for C++. Now.

C++ programmers are people too, aren't they? You wouldn't think anyone thought so, the way the industry looks today. Java started its run in the late 90s and it rapidly became the lingua franca of programming. Over night, authors started using it for all of their examples in books and articles. Certainly this was response to the market, but Java is also a much more succinct language. If you are going to write about design, Java gives you a better chance of fitting a code snippet on a page. The net effect, however, is that if you look around for evidence of C++'s continued existence, it is pretty easy to miss it. And, if you are one of these invisible C++ programmers and you are aware of that tools are available for Java but not C++, well, you should be screaming. C++ was my first OO language and every time I go back to program in it I notice the lack of support.

A few weeks ago, I was working with a team whose code is split right down the middle. Half of the code is Java and the other half is C++. At the beginning of each iteration, the team members sign up for tasks. When someone walks into the room each morning you can pretty much tell whether they'll be working in C++ or Java. Their faces tell the story. The people who are going to be working in Java march in confidently and start up their Java-based IDE, then they go to get coffee while it loads (yes, there still are some issues in Java-land). When they get back with steaming cups in hand, they look around at the code, find the methods they need to change. They click a menu item and it shows them all of the places that send a particular message. Then they start going through the work of carving out a space to work with their code. They click the mouse around to extract interfaces and methods automatically so that they can get some tests in place for their changes. The C++ programmers come in and bring up vi or emacs (they load quickly so no coffee for the C++ guys) then they browse around the code manually and start to figure out where to make their changes. Figuring out what uses what is often a blind-alley search. When they are ready to break some dependencies, they sit there and try to manually peel off interfaces by introducing virtual functions. They create new header files and extract methods by hand, all the while hoping and praying that they aren't breaking anything. Without an automated tool to check their refactorings it is a nerve-wearing process and it's also several times slower. They know that the Java code is getting better, but it is hard to feel the progress on the C++ side. I don't think the lack of coffee has anything to do with it.

Occasionally, some C++ teams I visit don't know what refactoring tools are out there. I was showing a team a testing technique a while back. The technique was language independent, so I pulled up a Java IDE. Over the course of my coding I found a method name that I didn't like. I pulled down a menu and hit rename. When I typed in the new name it was replaced every place it was used. Not every place in the file, every place it was used. Three of the team members recognized what they saw when I did it and they shouted "NNNOOO WAAAAAYYY!!!" I think I could have induced dead faints if I'd shown an automated extract method refactoring.

The sad thing is, it shouldn't be like this.

The first research into automated OO refactoring was done by Bill Opdyke and Ralph Johnson in the early 1990s, in C++. After that, John Brant and Don Roberts developed the first Smalltalk refactoring browser. Later, Martin Fowler wrote the book 'Refactoring.' That book and Extreme Programming really put refactoring on the radar screen. Java vendors scrambled to build refactoring tools into their IDEs. After all, it was the lingua franca, the language everyone is using, right?

In a few weeks, I'll be visiting another C++ team. This isn't atypical. There is a lot of C++ out there. More than anyone would imagine from looking at literature in "the industry." I wish I could tell them that someday there will be a refactoring tool for C++. For teams with large existing code bases it would be an immediate boost.

C/C++是程序员必须掌握的语言吗?

滚滚长江东逝水,浪花淘尽英雄。虽说是个人英雄的时代已经成为过去,但我们仍然不能对这样的榜样们有所忘怀,他们是WPS求伯君、CCDOS严援朝、2.13吴晓军、四通利方王志东、CCED朱崇君、UCDOS鲍...
  • JefferyLee
  • JefferyLee
  • 2006年01月08日 12:25
  • 945

我曾经也是个程序员

一程序员家的水管坏了,他打电话叫来一个水管工修理.  水管工鼓捣了一个小时,终于把管子修好了,他递给程序员一张600元的帐单. “600元!”程序员愤怒地说:“我当程序员一天都赚不了这么多钱!” “是...
  • stpeace
  • stpeace
  • 2012年11月09日 19:35
  • 3320

有多少程序员的女朋友也是程序员呢?

晚上回宾馆看电视的时候小卫跟他男朋友打电话,大概意思好象她男友接的个私活不想继续做了,似乎在空闲时间做了有几个月了,听小卫很生气的表示做事怎么能半途而废?那前面花费的时间不能都浪费了。表示周末回去不看...
  • a5174
  • a5174
  • 2007年04月06日 11:24
  • 467

C++语言可以运行在任何机器上么?

最近在VS2005下用C++写了一个Console程序,在一台未安装VS2005上运行,显示:  “系统无法执行指定的程序”  是不是一定要在这台机器上安装VS2005才可以运行?  请...
  • THISISPAN
  • THISISPAN
  • 2012年06月18日 13:58
  • 696

程序员能成为富人吗?

近日忙里偷闲看了几本富爸爸,穷爸爸>>财商系列的书,真是越看越汗颜,因为不仅发现自已的许多思想许多行为与穷爸爸的一模一样,而且发现自已要学习的东东还太多太多,这也使自已对作为程序员出身的我及广大同...
  • chenguoda
  • chenguoda
  • 2008年03月11日 13:27
  • 128

程序员能成为富人吗?

from http://blog.csdn.net/harrymeng/archive/2003/09/03/6113.aspx近日忙里偷闲看了几本>财商系列的书,真是越看越汗颜,因为不仅发现自已的许...
  • redvalley
  • redvalley
  • 2007年12月20日 00:52
  • 689

漫谈程序员(十九)天天写业务代码,如何成为技术大牛?

漫谈程序员(十九)天天写业务代码,如何成为技术大牛?  不管是开发、测试、运维,每个技术人员心理多多少少都有一个成为技术大牛的梦,毕竟“梦想总是要有的,万一实现了呢”!正是对技术梦的追求,促使我们不断...
  • sunhuaqiang1
  • sunhuaqiang1
  • 2017年01月10日 16:50
  • 43866

【转】 设计模式真的有使用的必要吗?

设计模式真的有使用的必要吗?http://tech.it168.com/j/e/2007-05-19/200705191646375.shtml一、 设计模式的隐喻 武功套路是习武的门径。新手...
  • strawbingo
  • strawbingo
  • 2010年03月05日 17:40
  • 327

程序员的四种境界

据说知识的掌握可分四个阶段:1. unconciously unskilled 2. conciously unskilled3. conciously skilled4. unconciously ...
  • macrosea8
  • macrosea8
  • 2006年09月02日 21:20
  • 480

如何进阶c++高级程序员

c++进阶导航飞机票
  • li438730745
  • li438730745
  • 2016年09月13日 09:29
  • 802
内容举报
返回顶部
收藏助手
不良信息举报
您举报文章:难道C++程序员不也是人吗?
举报原因:
原因补充:

(最多只允许输入30个字)