Hacker News new | ask | show | jobs
by nailer 3977 days ago
I'd rather use JS than add shell mixed in with Makefile. Two extra languages just to run a build system seems like adding unnecessary complexity.
2 comments

Shell and make are pervasive. If you're not comfortable with them, you will glean great value from becoming so.

Your perspective rings to me like "There's plenty of technical literature in Mandarin; learning English just to ...." Not wrong, per se. But profoundly limiting, and to an extent you won't comprehend until you've crossed that knowledge barrier.

Elswhere in this comment stream someone talks about the 'innovation' of incremental builds in the JS build tool landscape... I think you might find that Make discovered, and solved, most of the build-system challenges the language-specific tools will encounter, decades ago.

It's a dependency graph. It's just a data structure. You can do that in any language. Saying you need automake for a build system, or would gain anything from doing so compared to a native system, is akin to saying you need another language for arrays.

Regarding your popularity argument: amongst other JS developers you'd get more network effect from gulp. If your backend is, say, Python or Ruby learning automake wouldn't help you there either.

The point is that shell is not "another language", it's a foundation of the entire world of modern programming, not some esoteric thing for a single purpose.
It's a shaky foundation typically based on scraping text. 'its important and popular' is not a significant reason to add a language (or two in this case) to a project.
If writing everything in one language is your goal, then you are severely limiting yourself.

The beauty of Make is that it doesn't care what languages the scripts are written that it's running.

In my JS projects I typically have Makefiles that use a combination of: JS, bash and Python

If you compile NodeJS from source, guess what command you have to type in...

I feel being more open minded in terms of programing languages will make you a better and more powerful programmer.

Except one of the most important ones.

Hermetic and 100% Reproducible builds. Sadly most of the Make replacements still haven't really solved that one either so your point still stands in a way.

I find it depends on the scale of the project. If I just need something to encapsulate my test runner and packing tool invocations, then I'll just toss those in a five-line Makefile, because why add a heavyweight build tool most of whose capabilities I'm not going to exercise?