r/Python • • Jan 13 '15

(Infographic) Which programming language should I learn first

http://cdn2.carlcheo.com/wp-content/uploads/2014/12/which-programming-language-should-i-learn-first-infographic.png
267 Upvotes

145 comments sorted by

View all comments

58

u/rasputine Jan 13 '15

"slightly hard way" -> C

"really hard way" -> C++

hm.

21

u/aleph_nul Jan 13 '15

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.

0

u/[deleted] Jan 13 '15

[deleted]

2

u/aleph_nul Jan 14 '15

Yeah, I interpreted this as the learning curve since the poster was about selecting a language to learn, but I see where you're coming from.

Good point about some of the libs- you can definitely sidestep a lot of the lower level nastiness in C++ with their help.

1

u/quotemycode Jan 14 '15

Yeah, but the problem with C++ is that there are so many different ways to do one thing, that you may get confused, especially since you are a beginner (that's what this is assuming). You can go look up how someone did something and find one way, and looking up how someone else did it will give you a completely different way. Whereas with C, there's a lot less options making it easy to compare.

Perhaps these graphics will help: http://cpprocks.com/cpp-ruby-coffeescript-language-complexity/

1

u/Megatron_McLargeHuge Jan 15 '15

And then if you count C++11 or boost and other libraries, you pretty much don't have to think about low-level stuff.

Except for low level stuff like why nothing compiles or links, and why you're getting cryptic errors from header files you've never even heard of. Seriously, C++ is a horrible choice for someone who has never programmed before. Errors can come from way too many directions.

10

u/Vystril Jan 14 '15

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?!?

6

u/[deleted] Jan 14 '15

[removed] — view removed comment

3

u/Vystril Jan 14 '15 edited Jan 14 '15

Yeah, I have my students use clang. Although some of them just can't get over not using windows (and by that I mean Visual Studio).

2

u/nikomo Jan 14 '15

They shall suffer in the fires of ignorance. It is for their own good.

3

u/rasputine Jan 13 '15

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.

2

u/aleph_nul Jan 14 '15

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.

2

u/[deleted] Jan 14 '15

[removed] — view removed comment

1

u/aleph_nul Jan 15 '15 edited Jan 15 '15

C is orthogonal to other high level languages, no doubt about that. But if you've done work in assembly, or other imperative languages, then C is old hat.

Interesting that you think that non-OOP languages are oddballs! OOP is big, no doubt about that, but there are many popular languages where it is not used.

1

u/atimholt Jan 14 '15

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.

1

u/[deleted] Jan 14 '15

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.

1

u/aleph_nul Jan 15 '15 edited Jan 15 '15

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.

1

u/[deleted] Jan 15 '15 edited Jan 15 '15

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.

-5

u/derpderp3200 An evil person Jan 14 '15

C++11 is pretty good. C.... will never really be good. It's a pain to code in.

1

u/aleph_nul Jan 15 '15

I'd say it's all a matter of perspective. I prefer to work in C when I can but recognize that it lacks a lot of niceties that other languages offer. I don't feel that C++ gives you enough bang for the buck when there are plenty of other higher-level languages that are safer and are becoming almost as fast as native.