[quote author=“didito”]
using initialization lists is cleaner, more efficient and professional, but surely not less legibile. in fact the coding style from a visual point of view (the format and layout) is just a matter of personal taste. i.e. i prefer their style because i learned it that way.[/quote]
I think we are debating something very small, which is a style issue.
personally, I am more used to, and I find much easier to read this:
ofSoundPlayer::ofSoundPlayer(){
bLoop = false;
bLoadedOk = false;
channel = -1;
pan = 0.5f;
volume = 1.0f;
internalFreq = 44100;
speed = 1;
bPaused = false;
}
then this:
ofSoundPlayer::ofSoundPlayer() :
bLoop(false),
bLoadedOk(false),
channel(-1),
pan(0.5f),
internalFreq(44100),
speed(1),
bPaused(false)
{
}
but if you look at most all of the constructors in OF, we are mostly dealing with common variables and really not alot is happening anyway. therefore, I really don’t think it matters which way we do it. I think then it’s more important to write code in a way which is more universally understood… so that your average literate java, flash, javascript, etc programmer can look and say “ok, those variables are being set.”
at any rate, I am super happy to debate these things, and our mind is definitely open, and I have to admit (a) I have never used initialization lists (b) I learned alot researching them in the process © I could be open to using them in more complicated situations, or where performance was really an issue.
thanks!!
zach
ps: as a side note, theo and I put in our first template code into the next version of OF - so we are not totally against modern c++ style coding 