星期一的早上就看到如此有趣的文章,让我心情愉快。
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++ ppt 有些人需要的东西,不过只适合于初级程序员
《C/C++程序员实用大全》的源代码 希望对想学习C,C++语言的人有所帮助。
C++ C 程序员 笔试题 面试题 今年找工作,搜集的c++程序员经典笔试题、面试题,希望对找工作的人有用!
C、C++语言是IT行业的主流编程语言,也是很多程序员必备的软件基本功,是软件开发行业招聘考查的重点。本书以流行的面试题讲解为主要内容,介绍了C、C++语言基本概念,包括保留字、字符串、指针和引用、结构体、...
C++程序员笔试题,我觉得很好,对刚开始学习的人是一份很好的资料
《Visual C++程序员成长攻略》-戴博-源代码 ,光盘全部内容,这本书适合有一些vc基础的人学习,好好的把这本书和里面的代码掌握了,有很大的提高。
我也不知道一本书该怎么写这个软件介绍,只能说这个书适合很多的人
现在还有人使用 C++ 吗? 为何 C++ 没被用于编写操作系统? 有什么好的认证是面向 C++ 程序员的吗? 关于我: 为何不回复我的电子邮件?(使用了部分叶丰原来的译文) “bjarne”是冒名顶替的吗? 那真是你说的吗?...
本WORD主要讲解有关C++方面的知识,针对程序员经常用到的知识进行了汇总等。
针对c++程序员转lua的快速入门书籍。针对c++基本特性和lua特性的对比
Visual C++ 程序员指南,送给需要到人!
Visual C++ 程序员指南,送给需要到人!
Visual C++ 程序员指南,送给需要到人!
Visual C++ 程序员指南,送给需要到人!
这篇教程提供了一个面向C++程序员关于protocolbuffers的基础介绍。通过创建一个简单的示例应用程序,它将向我们展示:在.proto文件中定义消息格式使用protocolbuffer编译器使用C++protocolbufferAPI读写消息这不是一...
在20世纪80年代以及90年代的大部分时间里,许多人为C++的发展和修订做出了不懈的努力。最后,在1998年,采用了C++的一个ANSl/lSO标准。简单地说,C++就是C语言的面向对象版本。C++是在C89及其1995年修订的基础上构建...
在本书中,C++专家Rob Murray就与我们分享了他宝贵的经验和建议,以帮助初中级C++程序员得到进一步的提高。作者大量采用了实际开发中的代码来作为示例,向读者展示了那些有用的编程策略,并对那些有害的做法进行了...
Python概述:C++程序员眼中的Python分类: Python2013-05-28 21:53 2330人阅读 评论(0) 收藏 举报PythonC++对
技术管理层谈招人经验及C++游戏程序员发展
面向有经验的 C 和 C++ 程序员的 Rust 教程。 跳转到。 跳转到。 本教程适用于已经知道指针和引用如何工作并习惯于系统编程概念(如整数宽度和内存管理)的程序员。 我们打算主要介绍 Rust 和 C++ 之间的区别,让...