I need help! (Beginner with C++)

Started by
9 comments, last by Matt-D 12 years, 3 months ago

[quote name='Matt-D' timestamp='1326163694' post='4901164']
BeerNuts, I think it belongs especially in a Beginners' Forum -- note that in the C++ FAQ I've linked to it's located in the "newbie section" -- and it's no accident. IMHO it's better to learn about the quirks of floating-point numbers (if not the details, then at least the existence thereof) early on, as soon as one learns about the existence of "float" and "double" types, rather than to discover them by accident and waste hours (we're talking about a hypothetical "new programmer" here after all) on debugging the code that made the assumption that they behave like, say, integers. It's also better not to give anyone the mistaken impression of how the operator== works on such an important and fundamental (esp. for game development) family of types.


It's like if you were teaching 3rd grade math, and, in explaining triangles, you start describing unit circles, and the relationship of the angles and how they match up with sine, cosine, and tangent. Sure, it might be true, but all you've succeeded in doing is confuse them even more, and probably frustrate them.
[/quote]

Well, I disagree. It's already categorized under the "newbie section" in C++ FAQ and I happen to agree with this categorization. It's really programming 101, irrespectively of the language -- and if you don't learn it soon enough, it will bite you in the a** in the most unexpected moment. I also take issue with this sloppy attitude of "let's "simplify" stuff to the point of teaching bad habits, we can always correct that later, it would only be confusing to teach this now" -- in my opinion, if anything, it's better simply not to make deceptively "intuitive" claims like "walk==walk is always true" at all -- at least that would be a genuine simplification that avoids introducing bad habits. Failing that, it's better to correct the claims early on. But to persist in insisting on the incorrect explanation in the mistaken belief that it somehow makes things more intuitive or easier for a beginner is just wrong and ends up being ultimately more confusing (potentially resulting in hours of frustration spent on correcting subtle bugs that might result from such an attitude).

While simpler is usually better when introducing a topic, wrong is rarely simpler or better.

This topic is closed to new replies.

Advertisement