| C++ | Java | |
|---|---|---|
| Casing | Uppercase first letter (e.g. "CamelCase()") | Lowercase first letter (e.g. "camelCase()") |
| Utility functions | Simply call functions (e.g. "Wait(1.0)") | All functions are methods in classes (e.g. "Timer.delay(1.0)") |
| Digital inputs (also applies to outputs) | 1 (open), 0 (closed) | True (open), False (closed) |
| Namespaces and Pointers | (ex) Robot::oi->joy1 | (ex) Robot.oi.joy1 |
(not final)
Tabs, not spaces (spaces for alignment only)
Spaces after if, for, while, switch, etc. but not after functions
Open brackets on same line, closed on new
e.g.:
function foo(bar) {
if (bar) {
fooBar();
}
}