Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is "Code over configuration"?

Tags:

gulp

I have seen this terms many times on the google code over configuration or configuration over code. I tried on by searching it on google, but still got nothing. Recently i started work it on gulp again the mystery came code over configuration.

Can you please tell me what is both and what is the difference on them?

like image 374
Sivabalan Avatar asked Aug 29 '16 07:08

Sivabalan


2 Answers

Since you tagged this with gulp, I'll give you a popular comparision to another tool (Gruunt) to tell the difference.

Grunt’s tasks are configured in a configuration object inside the Gruntfile, while Gulp’s are coded using a Node style syntax.

taken from here

So basically with configuration you have to give your tool the information it needs to work like it thinks it has to work. If you focus on code you tell your tool what steps it has to complete directly.

There's quite a bunch of discussion about which one is better. You'll have to have a read and decide what fits your project best.

like image 157
Calon Avatar answered Nov 18 '22 00:11

Calon


Code over configuration (followed by gulp) and the opposite configuration over code (followed by grunt) are approaches/principles in software/program development where both gulp and grunt are using for the same thing as automate tasks. The approach refers to developing programs according to typical programming conventions, versus programmer defined configurations. Both approaches has its own context / purpose and not a question of which one is better.

In gulp each tasks are a java-script function, necessarily no configuration involved up-front (although functions can normally take configuration values) and chaining multiple functions together to create a build script. Gulp use node stream. A stream basically continuously flow of data and can be manipulated asynchronously. However in grunt all the tasks are configured in a configuration object in a file and those are run in sequence.

Reference: https://deliciousbrains.com/grunt-vs-gulp-battle-build-tools/

like image 2
Syed Ekram Uddin Avatar answered Nov 18 '22 01:11

Syed Ekram Uddin