Embracing the command line
It was in 2013 that I walked into a meeting with my employer’s development team (my role in the company is mainly design), and I witnessed something in how they worked that surprised me. The developers were using the command line terminal to perform aspects of their work. Now I know today it’s a standard, but back then I never would have fathomed this for web development.
With the new age of version control systems such as Git, and task-running platforms like Grunt or Gulp, it makes complete sense why web developers have brought the terminal back into our work. I’ll admit I carried a reluctance, feeling that the command line is “old tech” in today’s world of GUI-based software, but I’ve seen the light, and want to share my insights on how and why you should take the plunge.
Version control is the standard now
If you’re not using some kind of version control in your web development, then you might want to reconsider. I know for a lone developer, it’s easy to just think saving a copy of your files on a second drive is enough, but our work spans way beyond the simple freelance gig where you’re doing it all. Team environments and agile development are a part of life, and thus knowing how to use a version control system (Git, Subversion, Mercurial, etc.) is crucial to staying relevant in this industry.
When I crafted the website for Revolt Amplification, I took it as an opportunity to learn how to use Git. Granted I used a GUI-based app (SourceTree), but walk into most companies now and managers will want developers who are comfortable in the command line. Ask any experienced dev and they’ll simply say how much easier command line is for them.
I honestly think using the terminal for version control is not something you should overlook or put off. Even now I’m pushing myself to be able to use Git in the command line, even if I choose to keep using SourceTree for future work.
Task Runners are amazing
For instance, do you write your stylesheets in .LESS or SCSS? How then do you compile them into the final CSS files you’ll put online?
So you might think there are some downloadable apps you could easily use to compile your CSS and minify your code. However, do you want to go through a series of apps every time you wish to deploy a website build?
Taking the plunge
The idea is that instead of you finding a website, downloading a file, placing it in a specific folder, and making sure it’s “connected” up with your work, you instead let NPM do it for you with one simple command line in the terminal:
$ npm install moduleName
That’s the basic command. So you would replace moduleName with whatever it is you wish you use. It could be Gulp, or Grunt, or any of its plugins. It could be libraries such as Angular or React, or anything online as an NPM package.
Now I’m not going to go into great detail on how to use all this. Not when there are well-crafted explanations that helped me. For Node.js, I’d suggest starting with this great article from Sitepoint on how to setup Node. Unfortunately for us Windows users, much of the literature was geared towards Macs. Some will try a UNIX command line emulator like Cmder, but I also found some great tips on StackOverflow for using Node in Windows. In all honesty, beyond the OS-specific command line quirks, all the kinds of commands you would use in Node, Gulp, and Grunt are the same.
Lastly, if you wish to try out Gulp, I suggest this article from CSS Tricks to get you started. For Windows users, London-based developer Ollie MacFarlane wrote up a nice guide on getting you started in Gulp.
It’s a brave new world we’re in, and thus we move on to the next evolution of web development with the command line.
Do you use the command line for web development? How about task runners?