Let's use a scripting language for a comfortable C ++ life C ++ implementation after verification with python
I've been prototyping in Python today to see if the algorithm works.
- Write your ideas in Python.
- Graph the results so that you can see what is going on in one figure. (Spyder integrated environment)
- Make sure it works with multiple datasets.
- Make sure that another dataset works.
- Standardize the writing style with pylint.
- Write a documentation comment on the function.
- Be aware of the distinction between the basic part of the algorithm and auxiliary functions such as graphing.
- Make the basic part of the algorithm a separate module.
- Create a class if needed.
- Complete design, implementation, documentation comments, and confirmation of execution results in python.
- Clarify what needs to be implemented in C ++.
- Start development by referring to the python implementation for the part to be implemented in C ++.
- If there is C ++ of the module used in python, write it using it (example cv2.imread () → cv :: imread ()).
- Make it work even if it is solid.
- Implement and modularize (or classify) as it should be.
- Implement it as a command line application and test it under multiple conditions.
- Add const qualifier to possible arguments. Make data members private, use namespaces, etc.
- Write doc comments for use with Doxygen.
- Separate into the source code of the library to be incorporated as a module, the header file, and the source code of the main function for the executable file for stand-alone.
- Confine functions that do not need to be exposed in an anonymous namespace.
- Review the method name, function name, and variable name of the argument so that they are easy to understand as documents, and rename them if necessary.
- Write unit tests suitable for your intended use.
- For that unit test, improve the module until it passes the test.
- Unit tests describe not only normal systems but also abnormal systems.
- Incorporate the module after the test is completed into the target program.
In this way, you can verify the effectiveness earlier and then develop than developing in C ++ alone.
Note:
If you want to speed up the process
--Manage script version control.
--Perform a regression test each time you make a revision to confirm that the calculation results have not deteriorated.
--Prepare and test a sufficient number of test samples to confirm that no deterioration has occurred.
--Measure the processing time as a Python module.
--Do not explicitly write a double loop in the calculation. Use the appropriate function.
――Write a comment that gives a hint as to why the process is being processed, and check the algorithm.
--Find and simplify the parts that can be simplified by changing the order of operations.
--Reduce the waste of calculation.
--Confirm that the processing time is shortened when the waste of calculation is reduced.
--Reread the script, keeping in mind the group of meanings that are easy to understand.
I am aware of these.