難道C++程式設計師不也是人嗎? (轉)
星期一的早上就看到如此有趣的文章,讓我心情愉快。
C++員難道真的就低人一等(或者說,高人一等)嗎?作為一種常用的OO語言,C++得到的支援少得可憐。特別是,自動化重構工具和單元測試整合的缺乏,使得C++幾乎不可能成為XP團隊的首選——或者說,使得很多C++團隊錯失了實施XP的機會。
————————
Let's Reconsider That
Aren't C++ Programmers People Too?
by Michael FeathersAugust 23,
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. started its run in the late 90s and it rdly 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 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 ho 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.
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/10752019/viewspace-982689/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 不會程式設計也是文盲?程式設計
- 天賦差的程式設計師,難道就只能半途而廢嗎?程式設計師
- 程式設計師如何做出“不難看”的設計程式設計師
- 程式設計師需要經紀人嗎?程式設計師
- 程式設計師何苦為難程式設計師?程式設計師
- 程式設計師何必難為程式設計師程式設計師
- 程式設計師也難逃的二八定律,成為頂級程式設計師真的有那麼難嗎?程式設計師
- 不黑程式設計師會死星人程式設計師
- 有人的地方就有江湖,有江湖就有恩怨,人就是恩怨,程式設計師也是人程式設計師
- 大廠大批招聘C/C++工程師,掌握了C/C++的程式設計師他不香嗎!C++工程師程式設計師
- Java從程式設計師到架構師其實並不難Java程式設計師架構
- 程式設計師轉AI工程師很難嗎?這6個技術是關鍵程式設計師AI工程師
- 程式設計師,修女也瘋狂嗎 (轉)程式設計師
- 自學程式設計難度大嗎?程式設計
- 招個程式設計師,難?程式設計師
- 美國程式設計師把工作外包給中國程式設計師,啥也不幹年入 20 萬美元,這操作也是騷...程式設計師
- 內向的人很難成為群體程式設計師嗎?程式設計師
- NPDP|程式設計師轉產品經理好轉嗎?程式設計師
- 程式設計師口述:前端開發年薪30萬真的不難!程式設計師前端
- 優秀的程式設計師真的不寫註釋嗎?程式設計師
- 女生適合UI設計嗎?會不會很難?UI
- 不寫情書,程式設計師還要學寫作嗎?程式設計師
- 程式設計師 你幸福嗎?程式設計師
- 轉行程式設計師難麼?阿里巴巴五年老鳥:程式設計學不好的只有3種人行程程式設計師阿里
- 成為一個高薪的web前端程式設計師很難嗎? 方法不對,一切白費高薪Web前端程式設計師
- 學Java程式設計難不難?怎麼才能學好?Java程式設計
- C++程式設計師看過來,false < false的設定恰當嗎?C++程式設計師False
- 不難!月薪50k程式設計師必備5大核心技能程式設計師
- 程式設計師35歲後要轉管理?69歲的老程式設計師說不!程式設計師
- 漫談程式設計師系列:一張圖道盡程式設計師的出路程式設計師
- C/C++程式設計師請注意指標的用法(轉)C++程式設計師指標
- 程式設計師都是詩人程式設計師
- 當年也是翩翩少年,如今落得禿頂大叔,程式設計師禿頂算工傷嗎?程式設計師
- 好程式設計師不寫程式碼程式設計師
- 程式設計師這條路很難走,你還要堅持下去嗎?程式設計師
- 你需要程式設計師鼓勵師嗎?程式設計師
- Web設計師需要程式設計知識嗎?Web程式設計
- 程式設計師的路好走嗎程式設計師