難道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/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 天賦差的程式設計師,難道就只能半途而廢嗎?程式設計師
- 程式設計師何苦為難程式設計師?程式設計師
- 程式設計師轉AI工程師很難嗎?這6個技術是關鍵程式設計師AI工程師
- 大廠大批招聘C/C++工程師,掌握了C/C++的程式設計師他不香嗎!C++工程師程式設計師
- 程式設計師也難逃的二八定律,成為頂級程式設計師真的有那麼難嗎?程式設計師
- 不黑程式設計師會死星人程式設計師
- NPDP|程式設計師轉產品經理好轉嗎?程式設計師
- Java從程式設計師到架構師其實並不難Java程式設計師架構
- 招個程式設計師,難?程式設計師
- 程式設計師口述:前端開發年薪30萬真的不難!程式設計師前端
- 轉行程式設計師難麼?阿里巴巴五年老鳥:程式設計學不好的只有3種人行程程式設計師阿里
- 美國程式設計師把工作外包給中國程式設計師,啥也不幹年入 20 萬美元,這操作也是騷...程式設計師
- 優秀的程式設計師真的不寫註釋嗎?程式設計師
- 自學程式設計難度大嗎?程式設計
- 不寫情書,程式設計師還要學寫作嗎?程式設計師
- 平面設計難不難學?
- 不難!月薪50k程式設計師必備5大核心技能程式設計師
- 成為一個高薪的web前端程式設計師很難嗎? 方法不對,一切白費高薪Web前端程式設計師
- 好程式設計師不寫程式碼程式設計師
- 女生適合UI設計嗎?會不會很難?UI
- 學Java程式設計難不難?怎麼才能學好?Java程式設計
- 你需要程式設計師鼓勵師嗎?程式設計師
- 程式設計師,你焦慮嗎?程式設計師
- 程式設計師的路好走嗎程式設計師
- 程式設計師這條路很難走,你還要堅持下去嗎?程式設計師
- 程式設計師被懟!HR:對不起,我們不招“精通Excel”的程式設計師程式設計師Excel
- 雙十一,程式設計師可太難了程式設計師
- 不會填坑的程式設計師不是一個好程式設計師!程式設計師
- 95後為什麼想當程式設計師?難道只是因為掙錢多?程式設計師
- 程式設計師寫的跳轉程式設計師
- java程式設計師學歷重要嗎?Java程式設計師
- 程式設計師適合創業嗎?程式設計師創業
- 程式設計師能被淘汰嗎? | Journal程式設計師
- 0基礎小白轉行程式設計師,企業願意要嗎?行程程式設計師
- 程式設計師可以自己寫測試?還需要測試人員嗎?程式設計師
- 程式設計面試問題真的越難越好嗎?No!程式設計面試
- 程式設計師小白的個人思考程式設計師
- 程式設計師嘆息:太難了,三萬的程式設計師確實不如三千公務員?程式設計師
- 中年程式設計師只能坐等被裁嗎?程式設計師