-
Notifications
You must be signed in to change notification settings - Fork 13
Code Design
Modular Design, I want to be able to abstract every device and make accessible through a software interface which hides all of the device's details. When I say interface, I mean providing the rest of the team with a set of well documented functions which the rest of the team can include in their code without the team having to know how these functions accomplish what they do.
The ultimate goal would be to have an interface so well designed that you could replace the device and replace it with another which performs the same task and write new software which is able to implement exactly the same interface. This way everyone can focus on their specific piece of software.
Github allows every user to have their own fork of any project they wish to work on. There is one main team owned Github account called QMAST which will hold our published code.
I would like everyone to make their own fork for their account, and only make changes to the repository on their account. When they want to put what they have written into the main account they should submit a pull request, and whoever is in charge of maintaining the team Github account will review and merge the changes in.
If you want to get code from other people, you can always pull their changes directly from their Github account rather than waiting for them to first be published in the main account.
If you are having trouble with getting the latest version of code from QMAST check out this page for reference. This is for command line, not the GUI interface, but command line is much easier to work with for getting and pushing changes.
Whether or not you place opening curly braces on the same line as the function definition, or on the line underneath is your own choice, as long as it doesn't make things confusing, its cool. With that said, try not to criticize other people's code based off of its aesthetics.
There are however a few things I would like to try and avoid in our code base. The first being the omission of curly braces for anything, such as an if statement, for loop, and etc.
Don't nest if statements more than two deep. If you find you need to, it is probably a good indication that you should create a new function, which the if statements then call.
Don't allow lines to become more than around 80 characters long. Though this may not sound feasible, its actually really simple. The compiler doesn't parse the end of a line unless a semi colon is present. So to extend the line, just create a new line at the 80 character mark and continue, remembering to finish with a semi-colon