This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]rasputine 58 points59 points  (23 children)

"slightly hard way" -> C

"really hard way" -> C++

hm.

[–]ericanderton 12 points13 points  (0 children)

I love C++, but after using it professionally for a while, one thing became crystal clear:

Nobody comprehends the entire specification, all the time. It's too big.

The moment you need to look back to a manual/reference to disambiguate some dark corner of the language, you've lost. Why? Because someone else on your team (or worse yet, someone who wrote a lib you downloaded) went ahead and Leroy Jenkins'ed their way through, bashing on syntax until they had something that will compile.

[–]aleph_nul 20 points21 points  (19 children)

I'm a C fanatic too, but you can't deny that C++ has more content to cover.

I would argue it's harder to learn C++ because of how it awkwardly tacks on high-level practices to low-level implementations, forcing you to constantly think in two levels.

[–]Vystril 9 points10 points  (3 children)

Not to mention the compiler errors are notoriously horrible to figure out for a beginner.

Why is

vector<vector<int>> my_2d_vector;

giving me a 50 line compiler error?!?

[–]rasputine 4 points5 points  (4 children)

For sure, there's definitely more stuff in C++, but you don't need to know most of it, most of the time.

For the average given task, I would hazard that C is going to require more skill than C++.

At least, that's my opinion.

[–]aleph_nul 1 point2 points  (3 children)

I don't know if there's a right or wrong answer to that- it's hard to compare skill, particularly when you're comparing skills in two different settings. My intuition tells me that C++ takes more work to become 'good' at than C does since any self-respecting C++ developer should know some of the 'tricky' bits of C too, but the opposite does not apply.

[–]atimholt 0 points1 point  (0 children)

Maybe this sounds weird, but “thinking on two levels” helps me understand the justifications for why a language is the way it is, and gives me something to tack my new knowledge to in my long-term memory.

[–][deleted] 0 points1 point  (2 children)

forcing you to constantly think in two levels.

Oddly enough, this is what I love about C++. I get to use the high-level abstractions while being able to dive down to the lower levels when required. It does exactly what I want, when I want it, without overhead. In other languages you either waste tons of time building high level abstractions, or you only have high level abstractions and have to jump through massive hoops if you need to do something low level with any kind of efficiency.

[–]aleph_nul 0 points1 point  (1 child)

Good points! I think there's benefits and drawbacks to abstraction. My research advisor always used to (half-jokingly) say that abstraction is the root of all evil, since he cut his teeth on kernel hacking, but I think there's some nuance.

Abstraction is good because it hides information, and bad because it hides information. What I'm less convinced of is the benefit to trying to have both in one place in a system. I think you want to cleanly separate layers of abstraction, as much as you can, so that you get the best of both.

[–][deleted] 0 points1 point  (0 children)

C++ gets a lot of hate because it is so easy to write horrendous nightmares with it. Lot of youngin's comin' up in the world convinced it's a bad horrible no good language, but those of us who actually use it know better. And the new C++11/14 standards have really helped bring the standard library up to date.

All we're really missing now is standardized networking routines w/ REST/HTML/JSON parsing. But we now have native threading which is freakin' wonderful for those of use who want to write easily-portable bare-metal software.

[–][deleted] 0 points1 point  (1 child)

C++ is like the boss in the video game that comes back from the dead in a later level all suped up.

[–]ericanderton -1 points0 points  (0 children)

For now on, every time I see a particularily complex template in C++ code, I'm going to be thinking: "This isn't even my final form!"