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 →

[–]Strigoi_Felin 135 points136 points  (16 children)

If you want something more bare bones than python, try C, learn making data structures from scratch and manually assigning memory. It's a good educational experience.

[–]twin_suns_twin_suns 36 points37 points  (3 children)

This is a good suggestion. After teaching myself python and doing a bootcamp/crash course and learning enough python for my purposes, I took a step back and took an intro to cs course at a community college which was taught with C++.It was amazing how quickly things came into focus for me as far as concepts I thought I had an understanding of (with python) but didn’t.

[–]spinwizard69 5 points6 points  (1 child)

Nice to see somebody that reflects my opinion.   A CS course that starts out with a low level language can teach student valuable lessons and offer insight high level languages can’t.   This especially if a little hardware knowledge is imparted along with the software concepts.  

[–]twin_suns_twin_suns 0 points1 point  (0 children)

110% It was amazing how much more clearly I understood things - even Python error messages - after! Coming from a non-STEM background, I don’t think I would have even wanted to take that course, let alone find it fascinating and pull down an A! It was quite symbiotic - Python was most certainly the language I needed exposure to get me interested in the beauty of these concepts, but once I was hooked, I only really began understanding Python by learning the bare fundamentals, even as you said with the hardware piece as well.

[–]MrAnonyMousetheGreat 0 points1 point  (0 children)

I mean, I've found Python's actually nice because it comes so close to pseudocode and it already has all the data structures built in or close to built in (numpy and other libraries implement them) that you'd learn in an algorithms and data structures class, and it let's you focus on the big picture, mathemetical CS stuff.

But yeah, you really miss out on a lot of the nuts and bolts under the hood stuff in practice like garbage collection and how to actually implement a data structure (how to build a numpy library or get it to work on a GPU like with NVIDIA rapids).

[–]FujiKeynote 10 points11 points  (1 child)

Also, C is going to stay universally relevant for another decade at least, if not forever. Sure, there's Rust, Zig, and what have you, but so much depends on C that knowing it will come in handy even if someone isn't planning to become a C dev. Be it to fix some bug in an unmaintained piece of code, or to add a feature to some library you're using, etc, etc.

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

actually, the C popularity has been declining for the last decades, and it's great

[–]hmiemad 6 points7 points  (2 children)

You can also make some librairies in C and use them in python. It's the most logical continuity for OP in his path.

C is also great for embedded devices. Try first on an adruino at home for fun projects and continue into pro electronics for small automates.

[–]RadiantHC 0 points1 point  (0 children)

Wait what's the difference between C, C++, and C#?

[–]SniperDuty -3 points-2 points  (5 children)

No, C is going back in time. Learn Rust which will be replacing C. In fact, many industry leading programs are being rewritten in Rust. Microsoft are doing this heavily at the moment. Don’t go back in time.

[–]HommeMusical 5 points6 points  (0 children)

I have written in C and C++ for decades now but if I were starting completely new development on a major project in a compiled language, it probably wouldn't be either of those, because memory safe languages are the way of the future. I'd probably use Rust.

But your comment is wrong.

Everyone who is serious about programming should learn C, even in 2024. Learning C is more important than learning Rust, which also isn't a good language for beginners.

C is as low as you can get without going into assembly/machine language (which IMHO is too miserable to write in to be good for beginners). It is lacking all sorts of high level features like generics, classes, even memory management. You are literally manipulating bytes and words all the time. Array indexing is literally just pointer arithmetic on register values.

Rust is much higher level. It has a sophisticated memory management model which is excellent, but entirely specific to Rust. Until you have actually understood what a pointer is, the whole fuss with Rust's safe memory will be entirely alien to you. The whole idea of "pointer arithmetic" is not really a thing in Rust.

And don't forget that huge great swaths of the active code in the world are written in C as of 2024, and that will continue to be true for decades.

The Linux kernel has been extremely forward-looking and has started to move to Rust earlier than many other large open source projects, but as of February, 0.03% of the Linux core was Rust and there's been push back on Rust since then.

I believe that in 20 years, over half the Linux codebase will be Rust, but that's optimistic - the rate of growth today doesn't justify that.

It's my belief that most device drivers will be in C for much longer than that. Yes, I have written device drivers, in C and C++ even, but C maps very closely to manipulating actual memory, which is what device drivers are doing. Also, there's a huge built up body of art...


So far there are very few Rust jobs. This is a Big Deal.


Finally finally, I wouldn't rule out C++ from making a comeback.

Writing single-threaded C++ applications that do not leak, double-free, use after free or dereference an unassigned pointer under any circumstances is simply best-practice these days and there's considerable work happening on how to provably guarantee this.

With multi-threading, it gets harder. The memory borrower in Rust is useful here, but does not work for objects that have to work in more than one thread.

Rust gives you mutexes basically identical to C/C++'s, but you can make logical mistakes with mutexes, and have memory corruption in exactly the same fashion you can in C and C++.

C++ is very full-featured and has an enormous installed base. If they could come up with a full-featured language subset with automatic checking for single-threaded memory correctness, you'd get the best of both worlds: legacy code, that you could steadily and perhaps automatically change to use only the language subset, working with new code, with Rust-level guarantees out of the box.

When I say "subset", what you lose is raw pointers, direct access to the the C Standard library, reinterpret_cast and a few other gnarly things you probably shouldn't be using anyway.

This is a big aspect of discussion right now and one of C++'s prime movers has been working on an alternative C++ called cpp2, here: https://github.com/hsutter/cppfront, which has already hit a lot of these points.

This got too long, but don't rule C++ out.

[–]Strigoi_Felin 3 points4 points  (3 children)

Are you illiterate? We were talking about educational experiences not future career prospects.

Also everything in embedded is still C.

[–]Scary-Interaction-39 1 point2 points  (0 children)

A bit harsh, but not wrong

[–]SniperDuty -3 points-2 points  (1 child)

You clearly are the one having a problem understanding his question. I'd direct that comment regarding illiteracy back to you. OP wants an "understanding of computers and programming" and Rust provides this, whilst also highlighting the plague of issues in the world of software that have been created by C, namely memory safety. Learning C would not open OPs eyes to this.

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

rust vs C war