Quote: "
Redoing a few of the commands at the moment, partly to make them a bit more familiar to STD:: users. For example, rather than Bitmpap.Circle(2,2,2);, Bitmap << DarkCircle(2,2,2); Anyone disagree with this being a good use of operator overloading?
"
Standards, (I know you mean STD library...but its a standard/common way to get things done) as a rule, are good - because it lowers learning curve. Alternatively, I read an article how operator overloading - by definition - changing what operators are normally expected to do - makes reading the code only possible after a the "Scan for all operator overloading in the source code so you know what is really going on" prerequisite is complete. This seems trivial to many - "Big deal! Just learn how to code!" and they are right - providing the person who wrote the library did so in a very logical manner - meaning - the operator overloading works as one might expect. Sometimes though - debugging can be a bit nightmare'ish if you are running into overload stuff and you don't really know what's going on in the classes youi're invoking etc.
So - as usual - two schools of thought - I guess you have to make a judgement call. I just wanted to point out there is an argument for both ways of doing it (concerning To Use or Not Use operator Overloading).
I think the hardcore C++ guys would be fine with the operator overloading - providing your operators worked in a logical way - however I would consider possibly having "More than one way to Skin the cat".
For instance - I broke the operator overload law terribly with my own string class - by making a function called
Equal purposely over making an overloaded operator. Why?
This makes sense to me - and keeps the "==" available the way it was designed - allowing me to test pointers if I want AND have a way to test for Equal.
if(s->Equal("Some String")){DoSomething();};
I bet there is a lot wrong with this - if picked apart - however - I do program for a living and there is always something better that could have been done - perhaps with more time available - or perhaps ... it was just a judgement call
I personally listen very carefully to IanM's suggestions on programming. I don't follow every "method" he talks about - but I think hard about them - so I have a bigger tool box of "ideas" and "ways" to do this stuff. frankly he is pretty darn good at this - I'd like to go to the convention to "rap" with some other gurus and see what thier thoughts are - bummer its in the UK