TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Why I No Longer Like or Use C++

22 点作者 muriithi大约 17 年前

4 条评论

scott_s大约 17 年前
C++ is a systems programming language first, and an application programming language second. There was a time when there was little difference between the two areas.<p>System resources are not as precious as they used to be, so the distinction has become more apparent. Hence, people who use C++ for non-systems programming encounter friction when performance goals are at odds with productivity goals. They then move to languages which take the opposite approach and sacrifice performance for productivity.<p>I use and like using C++. Yet I don't see any reason to argue when he says C++ is not for him any longer - he's probably right. I think the domain where C++ is appropriate has shrunk and continue to do so, and that's fine.<p>(For the record, rvalue references are a means to eliminate copying objects. This is, indeed, a performance optimization that most people don't care about.)
评论 #135757 未加载
huhtenberg大约 17 年前
First comment on the article's own page pretty much nails it. C++ is flexible enough to be used as beefed up C - templates instead of macros, abstract classes and 'this' instead of callbacks and their arguments, operator overloading to produce more compact the code, etc. Noone is <i>forced</i> to use multiple inheritance, virtual base classes, template specialization and other ++ wonders.<p>The guy also claims that "every single aspect of C++ being designed around higher performance instead of my productivity". This is false. The fact that it allows writing high-performance code does not mean it was one of the primary design goals. It simply was not, this aspect of the language was inherited from C .. which is one of the languages the author declares to be "going back" to. Kind of ironic if you think about it.<p><a href="http://www.dmk.com/c++/stroustrup_1986_10.html" rel="nofollow">http://www.dmk.com/c++/stroustrup_1986_10.html</a>
评论 #135703 未加载
ghiotion大约 17 年前
I used VC++ in my first job, using Microsoft's ATL to extend the functionality of an ActiveX based Web app from Mercury Interactive (TestDirector, for those that are interested). It was utterly horrible, but I wasn't aware of it at the time.<p>I basically agree with the author of the post. I've never understood the use of virtual and template classes. However, I like what Anonymous says in the comments:<p>&#62;Here's the secret to good use of C++: Never use STL. Never use any template libraries. Furthermore, never use templates.<p>&#62;Pretend that it's C, with some nifty object-oriented features and operator overloading. Nothing more.
评论 #135432 未加载
aswanson大约 17 年前
I use C++ for image processing. Would I like to use Ruby? Of course. Do I know that if I do so I cannot process 30 frames a second? Yes. You take what liberties the problem at hand extends to you and save the dogma for the preisthood.