Hacker News new | past | comments | ask | show | jobs | submit login
Why I Prefer Makefiles over Package.json Scripts (atomicobject.com)
19 points by ingve on March 22, 2021 | hide | past | favorite | 4 comments



Yikes. Say what you will about package.json files and all their associated problems, but Make? Really?

I've written multi-thousand line Makefile build systems across multiple directories and multiple platforms, from scratch.

I must say Make is the most non-intuitive language I've ever had to work with. It's been near impossible for other engineers to pick up the build systems I've written. They still come back to me to ask questions years later.

And most importantly, you have to use tabs instead of spaces. ::sigh::

It's a great tool for some things, just like anything else. But I'd be careful about using it as your default.


Make is arcane and it gets really gnarly when you use it to describe a large build.

I wouldn't want to use it for its intended use without first looking hard at modern alternatives. (perhaps starting here? https://github.com/ninja-build/ninja/wiki/List-of-generators... )

But for solving the problem of "where should we keep our developer command shortcuts?" (which you might answer with "shell scripts" or "a Rakefile"), I've found Make to be pretty great!


I do exactly the same for maven builds, for exactly the same reasons (Discoverable one-liners, bash autocompletion etc.). Added bonus: facade the XML (yuck) based config language of maven


Ignoring that this post reads like ex post facto justification, programming is communication. I could write a missive about why I write in English instead of Chinese and say something like 'English has fewer characters' and 'English is supported by more fonts' but the truth of the matter is that it really comes down to who and what I'm working with.

If you're writing Makefiles for a React app, for example, you're very likely doing something wrong. Even for NodeJS the standard is gyp.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: