Quote:Original post by Polymorphic OOP
Really now you're going overboard.
Please notice that I'm critisizing his crappy reasoning in his objection rather than the objection itself. If you want to object don't just say "C++ HABITS BAD!" Give a reason why you think it's bad. LessBread did not advance a valid reason, he just brought forward meaningless generalities that ignored the fact that C and C++ have a sufficiently common lineage that good habits in either language will come from
just the fact the other language exists, such as the #ifdef __cplusplus, and decided to make a snide comment rather than justify his stance.
Quote:
Not having to take the address explicitly is provided as a convenience, just like easily being able to get the address of the first element of an array.
And so are conversion operators, and those are rarely good form. And so is ignoring the return value of system calls. Just because the language lets you get away with it doesn't necessarily mean it's a good idea.
Quote:
I don't see anyone arguing that whenever you pass an array to a function by iterator to the first element that you explicitly go &my_array[0].
That isn't an apples to apples comparison. First off, my_array isn't hungarian, so someone using that array name wouldn't be using those kinds of C type matching skills. In any case, if the array name was properly decorated, you wouldn't need the &, because the type prefix is there, which will satisfy the instintictive pattern matching. In contrast, function names are not decorated with type prefixes under Hungarian, so a the & is needed to match against the pointer type assignment of the pointer type.
Now then, if you want to argue that Hungarian, even in C, isn't a good idea, I'll accept that as a rationale that you wouldn't use the & to prefix the function pointer assignment. I'll wonder how you get any meaningful work done in C, but I'll accept it. If you want to say that your doctor ordered you to avoid using & and other symbols because of carpal tunnel, then ok, fine. I'm sure there are other objections I'll find reasonable. However, vague cries of "C++ HABITS BAD!" is not an acceptable objection.