Hacker News new | ask | show | jobs
by s986s 3792 days ago
I selfishly want more people like you in the javascript ecosystem. I had a debate with a freind if mine about gulp. My argument is that all of these tools are useless since they can be done without them. If only certian tasks should be run, create a commander script that takes in amount of args and runs each of those tasks.

His argument is that these gulp and grunt files standardize build and test scripts. Now its something you can definitively check off a list and when looking at others code have a form of familiarity.

I personallt agree, complexity and extra wrappers around what is already working makes little sense. But there are reasons these types of frameworks exist

2 comments

> My argument is that all of these tools are useless since they can be done without them.

My gulpfile.js minifies several application modules and 3rd party libraries into a small set of modular, organized files. A polyfill is included. ES7 is converted to ES5. Bootstrap 2 libraries are upconverted to BS3. BS2 icons and BS3 glyphicons are converted to font awesome. Image URIs are transformed/replaced on disk dynamically and in CSS/JS references to my modular preferences. Public access keys (rollbar, stripe, etc.) are injected into my builds from .env variables. Tiny changes can be injected into libraries until the maintainence cost of a fork becomes less than the cost of a replace. This script can be called with one command, this script's submodules can be called individually. The full command is mulithreaded. Perhaps the issue is not that these actions can technically be done without a build tool, but that you don't use any of the advanced functionality these tools were built to automate?

I guess I just don’t see what benefit is gained by writing a dozen lines of fragile boilerplate to run Browserify via Gulp. If you want to put the build automation in a well-known location, a typical Browserify+Babel build is one line in the scripts section in package.json that says something like

    "js": "browserify src/index.js -o dist/index.js -t [ babelify --presets [ es2015 ] ]"
If you need more complicated configuration, you can use separate sections of package.json to set useful defaults, which is also the common convention for build tools in the Node/NPM ecosystem.
Again, I agree. Picture this: mocha gives testing globals, browser offers the window and dom, node offers process arguments. Coming from a partial teachers perspective (well, I wasnt hired to teach but I did talk to the students alot) gulp seemed to offer comfort and order in a world where "you can do anything" seems to cause imobilization. That problem I believe can be solved through introducing students to a philosophy of "you are in control, machines are dumb, only google can save you" but I can see where seperation makes people much more comfortable