5 ms·
Yes yes yes. It's important to have code standards that enable code to be easy to understand easy to navigate. I work in C++ all day and loathe when functions
by forrestthewoods 13y ago
Yes yes yes. It's important to have code standards that enable code to be easy to understand easy to navigate.
I work in C++ all day and loathe when functions are fully implemented in the class declaration. Keeping them seperate with full ClassName::FunctionName(...) scoping makes finding functions exceedingly simple and friendly. Keep implementations separate means the full class declaration is easy to read, parse, and understand. I don't want to scroll through hundreds of lines of code just to see what functions are available.
- nfoz 13y agoAren't there circumstances in C++ when this isn't possible? e.g. some uses of templates
- ramchip 13y agoNo, you can implement methods outside the class declaration even with templates. It just has to be in the header file rather than the cpp.
- marshray 13y agoI normally do C++, but started doing some Typescript (Javascript) the other day. Like Java, this doesn't make external implementation easy. I found myself using a pattern of declaring a one-off interface for complex classes and then implementing it in the real class. I'm still undecided when/if this is a useful thing to do.