TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Why do C++ folks make things so complicated?

36 pointsby progalmost 14 years ago

5 comments

danieldkalmost 14 years ago
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 未加载
cagefacealmost 14 years ago
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 未加载
mrichalmost 14 years ago
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 未加载
michaelfeathersalmost 14 years ago
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.
dedwardalmost 14 years ago
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.