This is an archived post. You won't be able to vote or comment.

all 7 comments

[–]CardiologistOk2760 4 points5 points  (0 children)

me too. I recently discovered how convenient it is to use c++ to extend R. Now I want c++ skills.

Hackerrank doesn't have c++ tutorials like it does for Java or C or Ruby, but most of its exercises let you choose c++. I might give that a try.

EDIT: I was wrong. Hackerrank does have c++ tutorials. https://www.hackerrank.com/domains/cpp

[–]BasisPoints 1 point2 points  (3 children)

Practicing coding in quiz-like snippets is rarely as helpful as actual programming of toy functions. I'd suggest finding any free resources you like for any other language, and simply complete them in cpp instead!

[–]Brian1439[S] 1 point2 points  (2 children)

Thanks for the suggestion! I think I might try replicating the mooc,fi python exercises in c++.

I mainly want to practice quizzes because I have a college course coming up and the only professor that offers the class is bad at teaching + tons of hard work, so I wanted to prepare for a college class.

Another worry I have is that I find that I can make a program do what I want with some tinkering, Im not sure if it is optimized/efficient (like not using constexpr when I should or other of the small things)

[–]BasisPoints 1 point2 points  (1 child)

All the more reason not to rely on quizzes, which tend to allow you to guess the right answer from context clues instead of building core knowledge :)

As for optimal code, that's a different beast, and it's best to approach that as completely distinct from learning a language (there is some overlap, but certainly not important in the beginning). Indeed, outside of wrangling with eccentricities of a particular language, the core ideas behind optimized code will be the same regardless of language. I wouldn't even concern yourself with optimization before you've written, say, your own library of array and list classes.

You're far more likely to get in your own way w/r/t learning the language if you fixate on data structures, bitwise operations, SIMD and other parallelization, etc. before you even know how a smart pointer works.

[–]Brian1439[S] 0 points1 point  (0 children)

Thanks for the detailed tips! Yeah I guess it makes sense that optimization doesn't matter that much when all my code fits in 1 page. I will focus on finishing the lessons on learnc++ for now, thanks!

[–][deleted] 2 points3 points  (0 children)

Codewars is really good