The other day I discovered this useful extension that allows you to run your code from within the Atom editor. The name of the extension is Script Runner, and while there are many other extensions that do this, I really like how this one shows the code results on the right side of your screen, allowing you to easily see your code and the result of it after running it side-by-side.
After discovering this tool my first thought was, can I find the same extension or similar for the VS Code editor? The answer is Yes. The best extension I found to run your code while in the editor is Code Runner, and while this extension shows you the results in the console window, it still displays the results in a clear way by only adding the result and the time it took to execute the code. Very useful tool!
Why are these tools useful? For starters, they allow you to see the result of your code right away, without the need of setting up a unit test, or anything else really. You still have to output your result by doing a console.log for example, but you don’t have to run it in a browser or anything like that.
Below is an example of a FizzBuzz program using Atom and Script Runner:
And below is the same code using VS Code and Code Runner
They are very similar and I will be using both, I really like how easy it is to run and see your code’s output right from the editor.
To download and install these extensions, just click on the links below, and happy coding!
Script Runner – extension for Atom editor
Code Runner – extension for Code editor
Leave a Reply