IDE or Terminal for Development?
Developers can use an IDE, Terminal, or both for writing code. Read this post to learn why you should adopt a hybrid approach.
I am not affiliated with any of the products I mention in this post. All opinions represented in the post are solely my own.
I'm feeling a bit mirthful today, so figure it's worth making a relatively light-hearted post (but it could also just become a flaming dumpster fire, so let's see 🤣).
There are some eternal dichotomies in our day and age: good vs. evil, real vs. imaginary, soul vs. body. But none compare to emacs vs. vim. That is a tale as old as time, with a (virtual) battlefield littered with the bodies of thousands of developers jousting in the hallways of your favorite tech companies over their preferred command line editor: emacs, vim, or even...<shudder> nano. This is a bloody, savage war that will likely not end even with our grandchildren. Since no amount of eloquent writing will end this war, I will address something related, but at a higher level of abstraction 😁.
The topic du jour is use of IDEs for development vs. a terminal. For those of you newer to programming, IDE stands for "Integrated Development Environment". IDEs allow you to write, run, and debug code, all in one place, in a graphical interface. Some IDEs even have the ability to check in your code to version control systems (like git). There are scores of IDEs, but some common examples are Xcode, IntelliJ, Visual Studio, CLion, Pycharm, and Goland.
For many developers, myself included, use of both an IDE and the Terminal is a pretty common day to day occurrence. But there are some die-hards that swear by only using IDEs and others on the complete opposite end of the spectrum that use only the Terminal for everything.
I don't consider myself to be that old, but back when I first started development in the early 2000s, IDEs weren't that powerful. They may as well have just been glorified text editors. However, over the past decade or so, they have gotten incredibly advanced. Many of them are so full-featured that for 90% of all development you do day-to-day, you would never have to use a Terminal if you were to use an IDE instead. Newer programmers tend to gravitate toward use of IDEs, because they have a tangibility to them: point and click there on that menu and you will see an action happen in front of your eyes. In addition, IDEs can abstract away a lot of complicated details. For example, if you are working in a company that uses git for version control, many IDEs now can automatically add files to the git staging area, confirm commit contents, merge, rebase, show git log history and more, all at the click of a button.
In contrast to IDEs, the Terminal has been around for, well, forever, and its core functionality has been largely unchanged. Programs were initially written and run using only a keyboard at a command line interface (CLI). So old-school programmers tend to continue to use the Terminal, even for typing out code, not just running it.
Quick note: There are actually multiple Terminals in existence too. The terminal is itself a program. It's a program that runs programs. I know, try wrapping your head around that one. But stick with me on this quick aside. Because the Terminal is itself a program, you can download other Terminal applications (like iTerm2 on Mac) to customize your interaction with the command line, just like you can download other IDEs to help you with your development in a graphical manner. Each Terminal comes with certain features that its developer(s) added to cater to certain populations of command line users who have certain use cases.
One of the advantages of the Terminal is that power users can write scripts to perform lots of actions in parallel, whereas in an IDE, you are somewhat limited by how fast you can click on things. Another advantage that I see with Terminal usage is that details are not hidden from me. I have, on occasion, had an IDE do a bunch of actions on my behalf that ended up completely messing with my git history. Proponents of IDE interfaces would likely say that I just misunderstood how to use the IDE (which was probably true 🤦♂️), but because I knew what underlying actions I wanted to do anyway, using a Terminal and issuing those commands would've been more comfortable to me.
Can we use both?
So are "using an IDE" and "using a Terminal" mutually exclusive? Well, if you remember back to the beginning of this post, the answer is no! And I'll show you how.
A common development pattern in a tech company might be the following:
Start writing some code for a new functionality.
Write some tests for the new code.
Run the tests and find out you have a logic error (or even a compilation error).
Go back to the code to update the logic (or address the compilation error).
Along the way, checkpoint your progress by making git commits.
Once everything looks hunky-dory, ask your team to review your code (if your team uses Github, then this is done by putting up a PR, or Pull Request).
You read the comments your team has made on your code. Maybe one of your teammates recommended using a particular library for a certain task and there are examples in the codebase of using that library.
You go back into the code and address any comments your team made. Along the way, you look up examples of the usage of the library your teammate recommended from Step 6.
You ask for another review.
You get the go-ahead from your team and you ship the code.
Now in terms of where (IDE vs. terminal) you perform each of these steps, that is somewhat dependent on the tooling you have available within your company (available IDEs and their functionalities, build systems, logging, etc.). You may be able to do literally ALL of the above steps in an IDE without ever opening a Terminal. More mature tech companies have put a lot of investment into developing their own custom IDEs and tooling to help their developers be as productive as possible. But, if you didn't have an IDE available, or your IDE couldn't do certain steps above, you could likely use a Terminal for all the steps above too.
My IDE vs. Terminal demarcation is usually:
Aside: You would be rightly confused if you looked at this table and scratched your head as to why I do interactive debugging with compiled languages in an IDE, whereas I do interactive debugging with Python in a Terminal. I'm particular like that 😁. Joking aside, I learned Python before learning any compiled languages and the way in which I debugged my Python programs was by using pdb (Python Debugger), which is a command line application. With my first compiled language (Java), I was taught to debug from within an IDE debugger window. And I carried that forward. So my debugging practices are largely driven by habit. But I digress. Let's get back to this post.
So what should you do with all this info? Should you pick an IDE or should you pick a particular Terminal application? I'd recommend an alternative course of action: test out workflows by using different mixes of tools.
Prioritizing experimentation now to generate productivity hacks for yourself will give you massive ROI. Even if there is something that you are used to doing in an IDE, it's worth learning how to do it in the Terminal as well because it widens the scope of tools you can use and provides you with a greater understanding (and maybe you find you actually like it more). Every developer has different preferences for what tools he/she uses, so it's ultimately up to you to find what you like the best. But always keep an open mind and be curious. You may just find yourself picking up new tools and development practices every year!