How to eschew the Arduino IDE for a combination of and Arduino command-line tool (Arduino CLI) and a professional code editor (Visual Studio Code).
I'm always looking for the most productive way to get my work done. When I'm in software-engineer mode, my familiarity with the features of my development environment play a huge role in that efficiency. My favorite integrated development environment (IDE) varies by programming language, but, increasingly -- whether I'm programming in C/C++, Javascript or Python -- I try to find any excuse I can to use Visual Studio Code.
VS Code (not to be confused with Visual Studio) is a free, open source code editor supported by Microsoft. It has a long list of features including powerful key-bind-ability, file navigation, extensions to support just about any language and a pleasantly modern UI.
I've used VS Code as my IDE for platforms ranging from the nRF52840 and the C-based nRF5 SDK to a Raspberry Pi running Python scripts. However, a big chunk of the software development we do here at SparkFun revolves around Arduino, which usually means utilization of the Arduino IDE. Compared to VS Code, the Arduino IDE's feature-set is limited -- there's basic syntax highlighting, auto formatting, and line numbering, but not much more. It's missing modern IDE features like:
Until recently, beyond exploring Arduino's "Use External Editor" preference, there wasn't much to be done to add more functionality to the Arduino development workflow. That all changed with the release of Arduino CLI.
Arduino CLI is a command-line software tool that features board and file management functionality plus compilation and programming tools. Whether you want to download a new Arduino library or upload a compiled Arduino sketch to a RedBoard, the Arduino CLI is there for all of your scripting and command-lining needs. Taking it a step further -- combined with an IDE or editor (like VS Code) -- Arduino CLI can become an integral part of a powerful, DIY Arduino sketch, library, and core development environment.
To document this pairing, I wrote up a quick tutorial:
The tutorial explains how to pair VS Code with Arduino CLI to get the best of both development worlds: a modern IDE and the simplicity of Arduino's API and board support.