tkaplan/algo — pull request #1 by BeenEncoded (2014-11-11 05:08:55+00:00)
Title: Jonathan tidy

I made changes so that the code follows good practice and increased efficiency. I also removed the stupid getter from the class that didn't do anything but return a horrible pointer to an object not dynamically allocated.

- Never, EVER make getters that return references for private members of a class... EVER! (erfficiency, and pointless)
- modified function declaration and definitions to follow const correctness. Also, they pass by ref instead of value... grossly inefficient to pass by value.
- made modifications to downloadTickers so that it wasn't as slow as an old turtle going uphill against the wind in a snowstorm on Jupiter...
- Better exception handling; a std::runtime_error is now thrown with indication of the line and file that is is thrown... instead of just a wimpy display.

----------------------
Recommendations:
- If you can avoid try-catch statements, do so! They are grossly inefficient when compared with a simple return value. If the exception can be handled, it can be returned. Exceptions are indicative of programming error, not a fault. Please follow good practice.

Signed-off-by: Jonathan