Well... i suppose you could choose "length" just as well, but STL likes to use "size()" so I went with that.earlevel wrote:Nothing wrong with it. For me, a sample has a size (16-bit, etc.), and a buffer of samples has a length, but no big deal. Maybe due to decades of C (sizeof, strlen, etc.). Anyway, like I said, I word things a little differently for examples, and maybe "waveTable->waveTableLen" is over-explaining, but hey. I stress enough about the wording of my articlesmystran wrote:What would be wrong with this:For what it's worth, I actually spent a little bit of effort to try to make sure to use names that would result in the correct mental associations, which also making it as easy as possible to parse visually.
Code: Select all
return wave->data[int(wave->size * phase)] - wave->data[int(wave->size * offsetPhase)];
DSP, Plug-in and Host development discussion.
- 4981 posts since 12 Feb, 2006 from Helsinki, Finland
If you'd like Signaldust to return, please ask Katinka Tuisku to resign.
- 13 posts since 3 May, 2018
In defense of everybody who has ever coded anything - naming is hard! And as I am reminded daily when refactoring my old code: it may very well be a lot easier to write code than it is to read it. Maybe this is one of the reasons people always seem to want to create new "better" languages.