Gulp and Grunt. Ah! The Two Task Runners

Gulp.js is a new Node based automated task runner that has been causing lots of buzz. Although automation and task runners are not a new idea, they have become very popular in the front-end community after the introduction of Grunt.js. Grunt was built by Ben Alman to help simplify the process of automating repetitive tasks. In this respect, both Gulp and Grunt allow developers to speed up their workflow and optimize site performance. Some of the tasks include compiling SASS, linting CSS, concatenating files, minifying files, auto-generating image sprites and compressing images.

There are a couple of things that sets Gulp apart from Grunt. The first is speed. Gulp uses Node streams to group tasks together and process them sequentially in memory. To run four tasks on a group of files in Gulp requires only one write to the disk. With Grunt you would need to configure an input and output for each task resulting in four separate writes. The speed difference is not noticeable with smaller projects, but can become an issue with the more files and tasks that need to be processed. Another difference between the two is Gulp’s focuses on code over configuration. Grunt’s tasks are configured in a configuration object inside the Gruntfile, while Gulp’s are coded using a Node style syntax. As a developer, I would much rather code than configure. The configuration style for each Grunt plugin can vary depending on the plugin author. With Gulp configuration options are much more standardized.

There are a couple of areas where Gulp falls behind Grunt. It is a young project with a smaller following and not as well documented. As of November 2015, Gulp only has 1,916 plugins while Grunt’s repo contains over 5,000. There is a Gulp plugin that can run any Grunt plugin but it still feels like a limitation to me. Another area where Gulp needs work is its error messages; while debugging issues I found the error messages to be unhelpful.

In a world without walls and fences, who needs windows and gates ? No gates, no windows bt apache inside! #dev Love for #Unix #Linux #Apple. Interests in coding, music, creative design, Linux and Apple products.