Here are some general coding tips submitted by the Exothermic Robotics club:
Make sure the program works with the competition mode/switch. Don't wait until the competition to check!
For autonomous, plan out the EXACT route first, but be willing to improvise as you go.
Work on the autonomous one step at a time so you know exactly where the problem is.
The programmer should participate in the building so they know how the robot works and moves. This is the same vice versa.
Add descriptive comments to your code so other people can understand it. The more descriptive the comments, the better. Judges love it when you do this because it makes their job so much easier.
Use PID. PID stands for Proportional Integral Derivative. There is more information about it below.
Be consistent! A consistent Autonomous program is much better than a higher scoring inconsistent Autonomous program.
Make things easier for your driver by automating some parts.
Use brakeType hold/break only when you need it.
Organize your code! You might think that you know what your code is doing right now, but when you look at it again in a few days, you'll be surprised at
how hard it is to decipher your own code. Do your future self a favor by organizing your code. It'll save you so much time.