Code structure and implementation (FSM)

  • Hi

    I have mostly background in generic software development and a bit limited experience with FW, but enought to be familiar with lower lever programming.

    In terms of program structure I am wondering if there are some general guidlines when using micropython. So a few questions:

    1. To what extend do you split your project into multiple submodules (.py files)
    2. To what extend do you use classes vs. simple functions?
    3. FSM (Finite State Machine) is a common way to implement FW. Do you use this?
    4. If FSM to what extend do you use this (just as part of specific logic or as the main structure of your program).
    5. Are there any best practice for how to implement FSM in python?
    6. Is there any best practice in fault handling?
    7. Other important considerations
    8. What practices do you follow to harden your code with regards to reliability


Pycom on Twitter