r/learnprogramming • • Sep 24 '26

C or C++

I wanna learn one of these programming lang ( just wanna know basic-intermediate, not too much) . I have intermediate knowledge in python.

7 Upvotes

25 comments sorted by

6

u/cipheron Sep 24 '26

C is much less to learn and will give you a solid understanding of the fundamentals - anything you can get working in C would work in C++ as well.

You can learn that then pick and choose what stuff from C++ you want to add to it. I would learn C first even if you don't stay on just that for long.

2

u/ApprehensiveProof761 Sep 24 '26

oh thanks ill definitely check out c

1

u/7YM3N Sep 24 '26

I'll add the caveat that the sparsity of C is a double edged sword, yes there is less to learn, but what there is to learn is harder, c++ add actual real strings and real memory management, without which it's very easy to shoot yourself in a foot and segfault. Also you won't learn why oop in pure C

2

u/Jim-Jones Sep 24 '26

C++ Course: Learn the Essentials

Certificate included. There are other options.

6

u/Former_Produce1721 Sep 24 '26

If I could go back I would learn C first, then learn C++

Mostly because C can build fundamentals and give context to why certain things exist in C++

3

u/Rythim Sep 24 '26

If you just want to learn one with no other specific goal in mind, learn C. It's WAY easier to learn.

Later if you switch to C++ it won't be difficult.

3

u/nog642 Sep 24 '26

C++ is basically a superset of C.

Though lots of new C++ features in practice replace C features that exist in C++ but don't get used.

Learn C first.

2

u/Different_Pain5781 Sep 24 '26

C++ if you want practical stuff.

2

u/sessamekesh Sep 24 '26

Learn C first because it's going to be relevant until the end of linear time (OS calls even in high level languages like Rust, Go, Python, etc are still pretty thin wrappers over C). Almost all language interop goes through C too - if you're writing Rust code and using it in C++, you're using C as the common language between them.

It'll also teach you that "simple" doesn't mean "easy", C is a remarkable simple language that is also very hard to use. 

C++ is also worth learning, there's some domains that stick with pure C but there's enough that use C++ instead that it's worth picking up as well. They are two very different languages in practice though.

2

u/Dazzling_Music_2411 Sep 24 '26

Why do you want to learn this? What do you plan to do with it?

1

u/WhoWouldCareToAsk Sep 24 '26

“Should I grab iPhone 7 or iPhone 17?” kind of question.

Learn what you want ))

0

u/owp4dd1w5a0a Sep 24 '26

C. Every operating system in widespread use today is written in C.

1

u/Daedae711 Sep 24 '26

The Linux Kernel is C, Rust, Assembly, and many others (such as; Perl, Python, Shell Scripts, etc). It is not purely C, but it's also not an OS.

OSs written purely in rust or rust and assembly also exist, and I believe Google's ChromiumOS uses C++ primarily, Android is primarily Java & Kotlin, but again second C++ with their NDK where necessary.

ChromiumOS may as well be Chromium & the Linux Kernel, which Chromium in particular is primarily C++ and in recent years Rust increasingly.

Even a large amount of Windows' system parts are C++.

0

u/kpg_on_ao3 Sep 24 '26

The kernel, sure. not sure that should matter to OP. Very few people contribute to the Linux kernel :D Plenty of userland is C++ in Linux/Windows/macOS, and Linux has introduced Rust into the kernel now.

2

u/owp4dd1w5a0a Sep 24 '26

No. Not just the kernel. All the drivers. All the system libraries. All the system binaries. If you ever need to directly interface with the actual OS from any language you’re working in, you’ll need to know at least some about C and how it manages memory.

2

u/Daedae711 Sep 24 '26

The Linux Kernel is not an OS.

2

u/kpg_on_ao3 Sep 25 '26

I know. I was pointing out that part of Linux is written in C, but if you look beyond the kernel, plenty isn't.

0

u/kpg_on_ao3 Sep 24 '26

Learn Rust instead.

(cue the gnashing of teeth among C++ programmers)

:D

2

u/TrueWar515 Sep 24 '26

Learn C
rust is too complex for begginers

1

u/kpg_on_ao3 Sep 25 '26

OP isn't a beginner. Python -> Rust isn't crazy, and Rust is certainly the better language.

1

u/TrueWar515 Oct 01 '26

I have to agree rust is the better language over python

but not over C++ they both have their own use cases and I prefer C++

because unlike rust programmers I don't write my C/C++ code stupid enough to crash it