curtinrobotics / Boozebot

4 stars 2 forks source link

Standardized procedure #11

Closed Tomant1 closed 5 years ago

Tomant1 commented 5 years ago

Need to make/agree on standard syntax procedures and need to apply all these procedures to all existing and future code.

Tomant1 commented 5 years ago

We are using the python standard defined by OOSE_2018s1_OOLanguageComparison.pdf which is available in the discord, some differences apply.

  1. We are using brackets for conditional logic.

    if (x == true):
    #code 
  2. Comments which apply to single lines like variables are placed on the same line.

    x == true #sets x to true
  3. We are using the second standard for class functions.

    class Person:
    def __init__(self, name, age):
        assert isinstance(name, str) # Optional
        assert isinstance(age, int) # Optional
        self._name = name
         self._age = age
    def getName(self):
        return self._name
    def getAge(self):
        return self._age
    def setAge(self, age)
        self._age = age

    OOSE_2018s1_OOLanguageComparison.pdf