Shop OBEX P1 Docs P2 Docs Learn Events
RFC: For All: Object Declaration Recommendation — Parallax Forums

RFC: For All: Object Declaration Recommendation

rpdbrpdb Posts: 101
edited 2010-02-08 18:27 in Robotics
Just a recommenation that all use the following template for code submitted. Andy Lindsay gave this to me a while back at a class.

Every Object should have a Start/stop method

Replace the comment section with appropriate descriptions of pin usage.

Comments are everything, especially hours/days/years from now. Tell me how you got your equation, please!!!!·Comments dont get compiled,but are sure useful.

Please see the RFC:Stingray Standards·thread.


Post Edited (rpdb) : 2/7/2010 12:17:25 AM GMT

Comments

  • SRLMSRLM Posts: 5,045
    edited 2010-02-07 03:36
    Comment: this could be useful if it was packaged correctly (in a printable pdf document) and included a full set of recommendations. Some things to consider (out of many) would be 1)should objects have clock speed hard coded? 2)should objects use coginit? 3)should the start/stop method return anything? 4)should spin methods have a standard naming convention? 5)how should versioning be controlled? 6) how should "init" methods be used with respect to "start" methods?

    Anyway...

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Powered by enthusiasm
  • John R.John R. Posts: 1,376
    edited 2010-02-08 18:27
    The risk to things like this is that if someone develops working code, but does not/did not follow "the rules", you run the risk of the person not sharing the code.

    The plus side is easier to use code, as well as some good guidlines for new and experienced coders alike.

    "Recommended" and "Encouraged" are good terms. "Required" would be bad...

    Potentially there could also be a "class" (no pun intended) of submissions that "Required" a higher level of compliance. Maybe this could have a title like "commercially ready", "Best Practices Compliant" or something like that.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    John R.
    Click here to see my Nomad Build Log
Sign In or Register to comment.