COAST-Lab / Open-Water-Level

An open-source, low-cost, DIY ultrasonic water level sensor
MIT License
9 stars 4 forks source link

Beautify your code! #4

Open SUPScientist opened 11 months ago

SUPScientist commented 11 months ago

Arduino/Wiring/Particle's Device OS/C/C++/etc... do not care about if/how you indent your code, but it is far more readable if nested loops (loops inside loops, or if/for blocks, etc.) show increasing levels of indentation. This isn't hard to do by hand (keyboard) and VS Code tries to help you out along the way. But it can occasionally be very helpful to use a free online formatter/beautifier to do it for you.

Check out https://codebeautify.org/cpp-formatter-beautifier as an example. Put in your code chunk, or entire script, and see it spit out nicely formatted code. Note that the link above is for C++ (which covers Arduino/Particle) but there are other flavors for Python and other languages, too.

@BentleySettin, @hseppey, et al., please use that occasionally to ensure nicely formatted and more readable code. It won't just help others; it will help you follow your own code better!