Sunday, 22 January 2017

C++ | Progresssion Path





I know the basic OOP-related topics, RTTI, Templates. Reverting back from Java' Collection Framework, I tried to find such collections in C++ and found STL, and am trying to use it in my projects (although I don't know them in and out). I searched and found recommendations for books like Accelerated C++, Effective and More Effective C++.



But I am not sure what should be my progression path. I am looking for something like this -- Python-Progression Path:




def apprentice():
read(diveintopython)
experiment(interpreter)
read(python_tutorial)
experiment(interpreter, modules/files)

watch(pycon)

def master():
refer(python-essential-reference)
refer(PEPs/language reference)
experiment()
read(good_python_code) # Eg. twisted, other libraries
write(basic_library) # reinvent wheel and compare to existing wheels
if have_interesting_ideas:
give_talk(pycon)


def guru():
pass # Not qualified to comment. Fix the GIL perhaps?



  1. Discover list comprehensions

  2. Discover generators

  3. Incorporate map, reduce, filter, iter, range, xrange often into your code

  4. Discover Decorators


  5. Write recursive functions, a lot

  6. Discover itertools and functools

  7. Read Real World Haskell

  8. Rewrite all your old Python code with tons of higher order functions, recursion, and whatnot.

  9. Annoy your cubicle mates every time they present you with a Python class. Claim it could be "better" implemented as a dictionary
    plus some functions. Embrace functional programming.

  10. Rediscover the Strategy pattern and then all those things from imperative code you tried so hard to forget after
    Haskell.

  11. Find a balance.




Answer



It's a tough question, because what you really need is becoming good at what you do, and thus no authoritative list exists.



That being said...




  • Read Effective C++ by Meyers and C++ Coding Standards by Sutter, you're not likely to understand everything if you're a beginner, so re-read them from time to time (it's also a good vaccine)

  • Time to introduce the STL (it's an amazing little pearl), learn to use its algorithms instead of hand-crafting everything, if possible jump straight to the C++0x version

  • Incorporate Boost into the mix, softly at first: boost::optional, boost::variant, boost::lexical_cast, boost::numeric_cast make your code safer and more idiomatic. Also poke the Boost String Algorithms library.


  • Template Meta Programming and Boost.MPL are next: C++ Template Meta Programming by Abrahams Gurtovoy will help there. You might have to leverage Boost.Preprocessor for some template stuff.

  • Learn more Boost Libraries, it's a gigormous repository and it's amazing all the libraries there are.



I am still at that last part myself, so cannot comment on going further :)



At each step, you should write a lot of code, reading isn't sufficient, you need to experiment. Programming is not just technic, the architectural part of the program is extremely important in the field.



Oh and try and join (if only to read) an open-source project, nothing beats writing code and it's better when someone else reviews it :)


No comments:

Post a Comment

c++ - Does curly brackets matter for empty constructor?

Those brackets declare an empty, inline constructor. In that case, with them, the constructor does exist, it merely does nothing more than t...