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.

C++ is an expert language

3 pointsby muriithiabout 17 years ago

4 comments

pmjordanabout 17 years ago
Yep, C++ is unnecessarily complex, suffers from bloated syntax, and is almost as hard to read for a compiler as it is for a human. The point the author has missed is that it's fundamentally not that flawed as a C replacement for projects where C outgrows its usefulness.<p>Okay, so it's essentially destroying itself as a general-purpose language with the complexity and idiosyncracy of some of the additions; a decently standardised ABI would help for embedded stuff. <i>But on the whole I'd rather use std::vector&#60;&#62; than malloc() and free()</i> when it's impossible or exceedingly impractical to use my favourite Lisp, or Ruby if I'm feeling imperative, or Java/C# if someone's forcing me.<p>Yes, you need to know what's going on under the hood, but it can save you a lot of micro-management that slows you down in C. I've come to realise that you have to treat C++ as exactly what the name suggests: a step up from C. If you treat it as anything more, you end up building template empires. Been there, done that, realised it was a bad idea. I'd still pick it over C though.
astonabout 17 years ago
This article has some weird examples. I could've sworn most C++ compilers would go ahead and throw in default and copy constructors for you by default. It's only by explicitly defining a <i>lack of</i> one of these that you would hit an error (as he did in his examples). As in, your basic class would be fine, and then as you added special constructors without adding the basic ones, you'd make trouble for yourself. Note that he has to explicitly declare the copy constructor private to break things...<p>Then again, I was never really that far into C++ land, so I wouldn't be surprised if I were wrong.
deathbyzenabout 17 years ago
This was slightly interesting to me as I took a few CS courses during my brief stint in college. The professor taught in C++ and made it seem simple which seemed like something of an accomplishment at the time.
keatingabout 17 years ago
If it crashes, it's probably written in C++.<p>// eof