As a developer, you’ll spend a lot of your time writing code. Less than you’d think, as we’ll see in future tips in the series, but still thousands of hours.
It pays dividends to master your code editor. A powerful editor, properly used, will provide a myriad of benefits.
Benefits of a code editor
The following incomplete list will give you an idea of some of the ways in which an editor can serve you:
- Speed up the process of writing code by autocompleting parts of the code you write.
- Highlight and indent your code for readability.
- Simplify the process of refactoring code (e.g., consistently change the name of a variable across your program).
- Point out obvious typos.
- Easily find code within your project (e.g., through finders or through the ability to jump to definitions).
- En mass manipulation of text and code, without having to manually perform changes lines per line (e.g., replacing strings, commenting out large sections of code, etc).
- Execute code directly without having to step out of the current window.
- Folding your code, so that you can focus on the current method or class, and ignore the rest of your code base.
- Visually identify files that have changes from your git repo.
Honestly, this isn’t even scratching the surface. Just take my word for it, being well acquainted with your editor of choice will eliminate a world of frustration from your coding experience.
Choosing a programming editor
A natural follow-up question to the previous paragraph would be, “Which programming editor should I use?”. Ask ten programmers and you’ll get at least five different answers. It’s a highly personal choice and people get religious about their editor of choice.
I’m going to share my opinion and you can then find out for yourself what works best for you.
I would divide most editors into five categories:
- Shell-based text editors. These are historic text editors that include such offerings as such as Vi/Vim and Emacs. [1] They are extremely powerful and customizable but come at the expense of a high learning curve. [2]
- WYSIWYG text editors. Examples of this type of text editor are Notepad++, Atom, and Sublime Text. Much less of a learning curve than something like Vim, but still quite powerful.
- Integrated Development Environments (IDE) that are specific to a particular development stack. Some will argue that these are not code editors, but they certainly include one, among a whole host of other features, often including a way to visually design your application. Examples of IDEs are Android Studio, XCode (for iOS and Mac OS X apps), and Visual Studio (for .NET applications).
- Niche specific editors. For example Coda for front end web design.
- Cloud editors that enable you to develop directly from your browser. One example of this sort of editor and development environment is Cloud9.
Any editor will do (well, don’t use Microsoft Word), but the choice will be very dependent on the kind of development you intend to do.
For example, if you plan to develop for the web:
- Learn the basics of Vim or Emacs for when you are remotely shelled into a Linux / BSD server.
- Master Atom or Sublime Text for your main development.
Conversely, if you plan to develop mobile apps:
- Learn the basics of Atom or Sublime Text for incidental file editing.
- Master your app platform IDE (e.g., Android Studio, XCode, Xamarin).
In general, I would recommend that you learn the basics of Vim so that you can quickly change files when connected to a remote server via the shell. [3]
Vim or one of its variants is almost always installed on Linux/Unix servers already or can be easily installed if you have admin rights.
If you love it enough to master it, you might even want to stick with it as your main code editor. Many developers do.
Regardless of what you choose or do, spend the time to become proficient in the tool you decide to use to edit your code (including reading a book on the subject if your editor or IDE is quite advanced).
- GUI versions of these editors have been developed. Generally speaking, they don’t make the editors all that much easier to learn. ^
- Technically, there are shell-based text editors that are easy to use, but they’re not as powerful as Vim or Emacs. Nano is one of them. ^
- Obviously, if you operate in the Windows world, this doesn’t apply to you. ^
Get more stuff like this
Subscribe to my mailing list to receive similar updates about programming.
Thank you for subscribing. Please check your email to confirm your subscription.
Something went wrong.
This topic is still something that I’m not confident with. I’m not a professional developer, just an enthusiast (well who would like to become professional 🙂 ), and maybe it’s the last thing that I should worry about while learning, but still it bothers me. Some say that IDEs are heavy, or you would acquire bad habits while using it as many things are automated etc, etc, etc. On the other hand, I’ve used Atom for some time and then switched to JetBrains WebStorm and it just feels so right to me like extension of myself, and you have everything just next to your hand including terminal.
Ok, I understand that you can rely too much on the IDE and then critically lose your productivity if you don’t have one available. But I don’t get the point about being heavy? Ok maybe IntelliJ itself is heavy, but WebStorm, RubyMine, PyCharm? It’s 2016 now ultrabooks have at least 8GB RAM, SSDs, i5 processors does it like really matters if WebStorm is a bit heavier of Atom for e.g.?
Antonio, could you please share your thoughts against using the IDE for newbies? Is this something that can negatively affect the Young Developer?
Thank you!
When it comes to editors and IDEs, I have a simple rule: use what makes you happy and productive. An editor or IDE should not get in the way. In fact, it should help somewhat with accidental complexity, so to speak.
You tried Atom and found WebStorm to work better for you. Awesome. Use WebStorm. There is no medal for self-sacrifice in software engineering. Anything that leads you to write better code is a good thing.
I would still recommend learning the basics of Vim for its advantages when working on a remote machine, but it’s perfectly fine to use an IDE as your main development environment and editor.
Thank you for your reasonable reply. Regarding Vim, indeed I think it would be nice to understand it better, currently I only use it at my job to edit configs/scripts on the servers. Last time I remember writing something that somewhat could be considered as program maybe 10-12 years ago in Turbo Pascal for the classes I was taking as a kid, so I guess there is a reason why I’m an IDE guy 🙂