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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

Why do C++ folks make things so complicated?

36 点作者 prog将近 14 年前

5 条评论

danieldk将近 14 年前
If you want to make such a distinction, Qt is probably what would come close to top-C++. It offers dynamic binding via signals/slots, Java-like iterators, simple multi-threading/parallelization, signal/slot-driven networking, database access, and some automatic memory management (deletion via parent widgets, and auto-pointers). It only misses the proposed compiler warnings to indicate that 'bottom-C++' is used.<p>Still, for the average programmar 'top-C++' makes a miserable language. Want to write a simple class? You have to make a separate header file and decide what methods to inline/make virtual, etc. Want (binary) compatibility? You'll have to worry about things such as PIMPL and d-pointers.<p>It's a low-level language, and low-level issues will always leak into higher-level subsets. And why should one go through the effort? The old mantra "write in a higher language, rewrite what is too slow in C/C++" works fine.
评论 #2656869 未加载
评论 #2658536 未加载
cageface将近 14 年前
C++ already contains "top" and "bottom" C++. You can write boost-style code, with heavy use of smart_ptr and STL algorithms &#38; functors, or you can stay pretty close to the "C with classes" layer.
评论 #2658314 未加载
mrich将近 14 年前
C# comes to mind when he is talking about top/bottom C++. They got this right, plus added some neat high-level features.
评论 #2656758 未加载
评论 #2656777 未加载
michaelfeathers将近 14 年前
I think that the main reason that C++ is so complicated is because they've had to maintain compatibility with C's model. The declaration/definition and value/reference dichotomies double up a lot of work. When you add the fact that they wanted to base STL on pointeresque semantics (iterators) and people started using template meta-programming to deal with the lack of reflection, well, it all got complicated.
dedward将近 14 年前
Simply a combination of it's nature - it's C++, and It's been around a long time. It's easy to make messy stuff with it.