2 min read 0 comments

In writing code, all this time, I have been mostly using Sublime Text, my favorite editor. In fact, this blog is being written right now using Sublime. In my system, I currently have Sublime, Visual Studio Code, and Brackets to use as editor. In my previous system, I had used Atom as well. I also actually used PyCharm, too. Brackets is a little bit new to me and have not really explored or used it yet. I actually got to use Atom first in the beginning of my coding journey (the first one was actually Notepad). I then got to know Sublime and then Visual Studio Code. But Sublime Text stuck to me.

Anyways, I want this blog to be about how I test my code while writing them, and not what code editor I use. :-) I learned about how to use a console within Sublime while I was participating at the Hack Reactor Structured Study Program. One of the students wrote a post on the Slack channel about it, and I have been using it ever since.

There are a lot of blog posts that show how to set up Sublime Text to use the console within it. I can’t remember which blog post I used to set up my system, but here is one by a developer named Pawel (thanks to him for posting this) that does the same. It’s just so convenient to be able to run your code within the editor while writing it. It uses less keystrokes and hence, quick. I can now write Python or JavaScript and test the code within Sublime, making sure that I’m in the correct ‘build system’ while writing the code and testing it. This capability is, however, not limited to Sublime. I have seen Atom have this capability as well. But I just stuck to Sublime.

At this point, I have actually used the console on my Sublime a lot more than in the browser when writing JavaScript codes. I have actually favored it over repl.it. So I haven’t found the use of the browser to test code necessary.

That was until yesterday when I was having a problem trying to get my JavaScript code to work. I asked for help and got introduced to how to use the debugger in Chrome developer tool. To use it, of course the script has to be running on the Chrome browser. This means that I have to create a HTML file with the code if it’s not already, and then open it on the browser. To learn more about how to use the Chrome developer tool, especially in debugging, there is no better resource than the Chrome DevTools website. So this is where I would be heading to in the next few days to learn more!