Recently I attended the online course provided by SkillSoft. One of the courses was Object-Oriented Programming Best Practices. I found there are 3 practices worth to be mentioned here.
1. Although you may provide your code in a clear, well organized format, and follow the best naming conventions, it is never possible to completely self-document your code. Therefore internal documentation a so should be provided, in addition to the self-documented code, in the form of comments. These comments are appended to the code they are documenting. This internal documentation is the responsibility of individual software developers.
2. A strongly typed variable is one that can only be of one type. This type is established at compile time and always associated with the variable. Strongly typed variables are more difficult to misuse. If you attempt to place a string in a strong y typed integer variable, this will produce a type error at compile time. If a strongly typed variable holds more than one type, type misuse is captured at runtime.
3. It is good practice to list the input parameters first, then the working parameters, and finally the output parameters, so that you can tell at a glance what the method does. An alternative is to have a consistent order for methods that use the same set of parameters. Either way, you should document the function of each parameter, and its assumptions, as you write the method.