Recap of Code Writing Strategies
What We’ve Covered So Far
Pseudocode is code that is meant for human beings to plan out how to write some code.
Logic Flow Charts help people understand how code or robots are supposed to work and they have three parts:The circle is where the program or robot starts. Squares are actions that the program or robot takes which don’t require making a decision or looping. Diamonds are places where the program or robot needs to make a decision. If the answer to the question in the diamond is “yes” then the program or robot follows the arrow labeled “yes.” If the answer to the question in the diamond is “no” then the program or robot follows the arrow labeled “no.”
Writing code slowly, one piece at a time really helps.Seriously. Get in the habit of adding one little piece of code and then running the program to see how that new code runs on your robot.
Example code can sometimes trip you up.Make sure that the person who wrote it knows what they are doing and that it is for the same hardware you are using.
Comment. I can’t say this enough. Comment your code.The only thing worse than opening up some really sweet code you want to use only to find that there are no comments to make it easier to understand is being asked to help someone with code they wrote that has no comments in it.
Ok! You’ve worked your way through a whole bunch of coding concepts. Congratulations! This is the end of the beginner code section. If you want to go further check out Beyond Basic Coding or start playing around with Sparki and writing your own code: