I'm kicking around this idea that, when learning a new programming language, it is more helpful to start with examples of things that one should *not* do, rather than what one *should* do.

My logic here is that the things you *can* do in a language are effectively infinite, however what you *can't* (or shouldn't) do is a very finite and relatively manageable number.

Obviously at some point you learn how to do things correctly, but I'm curious if this method lessens the initial pre-grok haze.


I've really been considering diving in deeper on C or C++, and that's what spurred this.

I've programmed in Python/PHP and of course hacked around with some shell scripting for at least 20+ years now.

I started my programming adventures with a C++ book as a kid and dabbled in C for microprocessors later... but I've never really wrapped my head fully around those two languages and it's kind of embarrassing.

There's just so much stuff written in those languages that I'd like to contribute too.

@self Also consider Rust. I started with C spent much of my career (and hobbytime) writing C++ and recently began learning Rust. Nothing wrong with C/C++ if those are the languages you want to use, but Rust is I think a decent advance and already has lots of amazing projects you can contribute to.

@happybeing 100%, Rust is the most exciting new language I'm aware of! The C/C++ thing isn't a practical decision, but rather just something to make me less useless on so many of the existing open-source projects I love haha.

I certainly want to learn Rust, but I also worry that with my Python/PHP background maybe learning more C and/or C++ would make the transition smoother. Or do you think it wouldn't make much difference and I should just dive in to Rust?

@self @happybeing have you done a lot of concurrency before? IMO the most important difference between C or C++ and Rust from a learners perspective is its concurrency model. It can really mess with your head and make it hard to do things that seem like they should be simple until you fully grasp Borrowing + Ownership.

@self there's certainly a benefit to knowing C/C++ and indeed what happens under the hood of a systems language, before learning Rust.

But even with this, borrowing and lifetimes are challenging, and I don't claim to understand them properly yet, but I can now understand lots of Rust code and have built a decent Rust CLI app: github.com/happybeing/vdash

So don't assume it's too much for you, there's lots of excellent docs, tutorials and folks to help, so you can always dip in and see.

@happybeing that sounds great, and very encouraging! Thanks so much! :)

@self you're welcome, feel free to ask for pointers.

What works for you will depend on your preferred way to learn, but head over to rust-lang.org/, and don't be shy to ask for help on the Rust forum and the two Discord channels, and here!

Tip: start by installing rustup and then use that to install the compiler and tools. VSCode works well with Rust if you use that.

@self At this point I would consider Go or Rust rather than C or C++.

Of the two, Go is easier but uses automatic memory management. Rust lets you avoid even the possibility of tiny GC pauses, but at the cost of making programming more complicated.

Sign in to participate in the conversation
mastadon.linuxlusers.com | Mastodon

Lusers unite! Despite the name, no loyalty or alignment with any software or technology are prerequisite - we welcome all! This instance is dedicated to inclusion and will not become yet another negative "tech" stereotype! For example, if you're not okay with people of different races or genders... please move along. If you think it's harmful for projects to adopt a code of conduct or ethical license... please move along. There are plenty of other Mastodon instances out there, and I would like to have mastodon.linuxlusers.com be one of the few Linux/open-source related instances that does not reaffirm stereotypes!