top | item 42005507

(no title)

joaquincabezas | 1 year ago

I've been a long time considering that I should learn Rust. I am using Python as main language (for Machine Learning tasks) so I am at the edge:

Go with:

C++, because I used to code in C (for embedded, 8-bit microcontrollers) when I was younger and also for its possible advantage for learning some CUDA (this last thing is mostly for fun)

or

Rust, because I have some trauma for kernel panics with bad memory management back in the days with C, and because I want to build some tooling in a nice, efficient way

discuss

order

creata|1 year ago

Learn both. Rust first, because it's a lot more approachable. Modern C++ doesn't really have much in common with C to be honest.

Also, you'd probably have found these quickly, but cppreference.com is the nicest C++ reference (!cppref on DuckDuckGo) and doc.rust-lang.org (!rust on DuckDuckGo) has the Rust standard library documentation.

joaquincabezas|1 year ago

In some way I am stuck because I don't want to dismiss any of these (kind of Buridan's donkey) but planning this in a sequential way seems smart and would end the inner monologue

jb1991|1 year ago

Coding in C++ is very different than it is for C and you should not consider them similar in any way. They are now two very different languages and nearly all the idioms in common use in C are considered bad practice in C++. It has been many years since these two languages could be considered similar.

joaquincabezas|1 year ago

Exactly this. I've felt it while checking some C++ OSS projects, thinking "wow I am more Java than this, and I don't do Java". This prevented me directly jumping into C++ which would be the natural step coming from C (because in reality it's not the natural step)

JTyQZSnP3cQGa8B|1 year ago

IMHO Rust is between C and C++: more secure and powerful than C, simpler than C++, but it has the potential to do everything.

If you already know C and Python, it would be a better and faster choice. I’m more a C++ expert, but I’ve written a few small command line tools in Rust and it looked a bit like the Python equivalents.

pryelluw|1 year ago

If you would have just learned it in the time you’ve spent considering learning it then you would not need to decide. Go download the rust book or lessons in the terminal. They’re great resources.

randomNumber7|1 year ago

Imo C++ only makes sense if you commit enough time. If you are not planning to work with it as an expert I would look somewhere else.

I dont want to comment about rust, but personally I just don't like ideological people. Also some people seem to not understand, that the set of all valid computer programs is greater than the set of all programs that can be proved correct. It is a fact and can be proven.

Imo C# is a well designed language and would be the best start to learn more about a modern statically typed language. Swift is also interesting, but its mostly apple and has similiar ideologic problems like rust (e.g. pointers are evil).

on_the_train|1 year ago

If Rust would stop the politics pushing, I wouldn't be so afraid of it

eklavya|1 year ago

Rust, the language can not push any politics. For me, technical stuff and politics are disjoint sets. I do not care at the least what the political leanings of people I work with are. To me it sounds as none of my business as what car they drive or what perfumes they like.

What exactly are you afraid of?

singularity2001|1 year ago

IF you learn C++ I'd suggest to use it as a nicer C, without any std:: or the million other complications. Write your own List / String classes for fun, they can't be much worse than the std ones.

creata|1 year ago

The string class you implement will be worse than the stdlib one, unless you implement small-string optimization, too, which is a massive pain.

jb1991|1 year ago

This is such bad advice.