Private data members. In some code they are at the top of the class. They should be on top. Gnucap code is mostly on top, but some on bottom, which probably should be moved to top.

Perhaps historically they had to be on top. Single pass compiler requires to declare everything before first use. Then it was ok at bottom too… It seems to be a matter of tast, but “top” is used more widely, and should be adopted.

Often the internal structure including private data is important to the caller. Example: parameters.

There is also the notion that scope as defined by C++ may not be the same as the scope to a human. Example: a “class” with some methods implemented externally, just below in the same file. To a human reader, it's all the same scope. To C++, it isn't. So, putting the data at the bottom of the “class”, it's in the middle when the human reader tries to find it, not at all where one might want to it.

gnucap/manual/tech/data.txt · Last modified: 2022/11/25 01:46 by felixs
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Run by Debian Driven by DokuWiki