Does anybody know if there is a technical reason magic constants and magic numbers are bad?
In addition to the reasons you cited, I will add one more: If other people need to read/maintain your code, it may not be obvious to them what the magic value means (even if it seemed obvious to you when you wrote it), and you may run into situations where another developer (or, after enough time has passed, you) tries to "fix" your code because they don't understand what it is supposed to do.
Take a look at http://programmers.stackexchange.com/q/266717/ and http://programmers.stackexchange.com/questions/251540/ for some good discussions on magic constants.
But it's pretty much just for clarity and preventing your code from turning into an enigmatic riddle, and poorly written but logical code that uses lots of them will still compile and run just fine at the same speeds, right (not that I am advocating their use)?
Anyway, I need to try a new book. I don't care what programming language. My only two requirements are that it be a well-written/gripping read, and a consistent, current, and in depth enough book that if I work through it, I'll be at a point where I can write almost anything by supplementing my knowledge here and there independently.
Open for recommendations.
A gripping coding book??? Not sure if one exists lol.
I can't complain about "beginning Javascript" The examples are interesting and useful and it moves at a good pace. I actually feel like I kind of no what I'm doing when I write a program from scratch.
It's cool to be able to write the code and then immediately interact with the program through the browser. The mainstream browsers also have some decent debugging tools to.
I know you wanted to learn C++, but I think if you started with javascript first that it would keep your interest longer. There seem to be lots of real world examples to either practice on or emulate.
Personally I almost quit because it seemed like I wasn't getting anywhere, but I just kept doing at least 1 or 2 pages each day and eventually I gained some confidence and started to improve. Doing a little (maybe only 15 minutes or so) each day or every other day definitely helped.