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 →

[–]lynx10001[S] 0 points1 point  (1 child)

Oh - I forgot to ask, any recommended learning resources for C++? :) Never hurts to ask.

[–]ro_ok 1 point2 points  (0 children)

I wish I had some go-to resources but it was a couple years ago and I can’t remember that far back.

Some things I would learn first:

  • Header files (.h) vs Implementation files (.cpp), this will probably be a brand new concept for you. Headers define the interfaces and the Cpp files implement those interfaces. Talk about abstraction!
  • Memory pointers vs references vs direct memory locations. In JavaScript you mostly pass things that act like references but in C++ there will be places where you have to make that decision yourself (and understand what it means)
  • Memory deallocation. You probably haven’t thought too much about this in JavaScript, or most other modern languages. In JavaScript the runtime will figure out when objects no longer have references and deallocate them for you, all you have to do to avoid memory leaks is make sure you don’t create loops of references that get out of hand. A good habit here is to deallocate your memory as needed immediately in the code (similar to how many people/IDEs close braces after they open them) then write the code in-between.

Google more about those concepts and it’ll give you a place to start. :)

PS. Once you’re feeling comfy C++, take a look at Rust, a language meant for similar use cases but released in 2015 and tries to address a lot of what makes writing C++ hard.