<story><title>Why I Prefer Makefiles over Package.json Scripts</title><url>https://spin.atomicobject.com/2021/03/22/makefiles-vs-package-json-scripts/</url></story><parent_chain><item><author>pletnes</author><text>I could not agree more. However most people are on windows for which obtaining gnu make is painful, or maybe even impossible - at least the path handling has many sharp edges.</text></item><item><author>kemenaran</author><text>I like nothing more than dropping into a new project, and, rather than figuring out the commands to make it run, see that it has a Makefile with a handful of targets for common tasks.&lt;p&gt;With some collegues we wrote an article about the benefits of this approach a few years ago: &lt;a href=&quot;https:&amp;#x2F;&amp;#x2F;blog.capitaines.fr&amp;#x2F;2016&amp;#x2F;09&amp;#x2F;30&amp;#x2F;standardizing-interfaces-across-projects-with-makefiles&amp;#x2F;&quot; rel=&quot;nofollow&quot;&gt;https:&amp;#x2F;&amp;#x2F;blog.capitaines.fr&amp;#x2F;2016&amp;#x2F;09&amp;#x2F;30&amp;#x2F;standardizing-interfac...&lt;/a&gt;</text></item><item><author>Steltek</author><text>This seems to be missing the obvious point: Make isn&amp;#x27;t anchored to any single language. If you will only ever use npm for your entire life, then you go ahead an live happily in package.json script land.&lt;p&gt;But I&amp;#x27;ve lost track of the number of languages and environments that I&amp;#x27;ve worked in. Make ties it together by being the Good Enough anchor point that documents and launches all the other tools and compilers.&lt;p&gt;- Compile this Rust app with Cargo then flash it to the esp32? Make.&lt;p&gt;- Build this page with JS using Tool Of The Week and push it to a test container? Make.&lt;p&gt;- Compile ancient C app and build a .deb? Make.&lt;p&gt;And so on.&lt;p&gt;Why not use shell scripts you may ask? Because shell scripts are way too free form and your tastes will change over time. Make forces just enough structure that you won&amp;#x27;t get carried away with yourself. Not for the basic task running stuff anyway.</text></item></parent_chain><comment><author>jokethrowaway</author><text>I don&amp;#x27;t comprehend how people can develop on windows (without linux subsystem).&lt;p&gt;I have to do that every once and then (to ship the occasional C++ or Rust build on Windows) and it&amp;#x27;s the stuff of nightmare. Stuff breaking randomly from one day to another, env variables to be set in weird ways, GUI installers, 8 different versions of mingw or similar. Recently I&amp;#x27;ve seen that there are a few package managers now (I used chocolatey and at least 2 others just trying to get something to compile) but still, compiling something trivial is always an adventure.&lt;p&gt;Mac OS X is kind of okay. Brew is barely decent and things mostly work (unless you discover you need to install 12GB of XCode for some dependency or your script is expecting coreutils instead of bsd).&lt;p&gt;Every linux distro comes with a package manager and compiling is trivial</text></comment>
<story><title>Why I Prefer Makefiles over Package.json Scripts</title><url>https://spin.atomicobject.com/2021/03/22/makefiles-vs-package-json-scripts/</url></story><parent_chain><item><author>pletnes</author><text>I could not agree more. However most people are on windows for which obtaining gnu make is painful, or maybe even impossible - at least the path handling has many sharp edges.</text></item><item><author>kemenaran</author><text>I like nothing more than dropping into a new project, and, rather than figuring out the commands to make it run, see that it has a Makefile with a handful of targets for common tasks.&lt;p&gt;With some collegues we wrote an article about the benefits of this approach a few years ago: &lt;a href=&quot;https:&amp;#x2F;&amp;#x2F;blog.capitaines.fr&amp;#x2F;2016&amp;#x2F;09&amp;#x2F;30&amp;#x2F;standardizing-interfaces-across-projects-with-makefiles&amp;#x2F;&quot; rel=&quot;nofollow&quot;&gt;https:&amp;#x2F;&amp;#x2F;blog.capitaines.fr&amp;#x2F;2016&amp;#x2F;09&amp;#x2F;30&amp;#x2F;standardizing-interfac...&lt;/a&gt;</text></item><item><author>Steltek</author><text>This seems to be missing the obvious point: Make isn&amp;#x27;t anchored to any single language. If you will only ever use npm for your entire life, then you go ahead an live happily in package.json script land.&lt;p&gt;But I&amp;#x27;ve lost track of the number of languages and environments that I&amp;#x27;ve worked in. Make ties it together by being the Good Enough anchor point that documents and launches all the other tools and compilers.&lt;p&gt;- Compile this Rust app with Cargo then flash it to the esp32? Make.&lt;p&gt;- Build this page with JS using Tool Of The Week and push it to a test container? Make.&lt;p&gt;- Compile ancient C app and build a .deb? Make.&lt;p&gt;And so on.&lt;p&gt;Why not use shell scripts you may ask? Because shell scripts are way too free form and your tastes will change over time. Make forces just enough structure that you won&amp;#x27;t get carried away with yourself. Not for the basic task running stuff anyway.</text></item></parent_chain><comment><author>kemenaran</author><text>Indeed – although I guess WSL made unix tools slightly easier to use nowadays.&lt;p&gt;But even without executing the Makefile, simply reading it can tell new developers which language-specific command needs to be run to build the project (and then the command can be copy-pasted and run manually).</text></comment>