Live data from Hacker News

The Makefile I use with JavaScript projects

olioapps.com

41–50 of 525 posts

Re: The Makefile I use with JavaScript projects

#41
post #21

As a non-programer the only experience I have with makefiles are unpleasant ones of running ./configure then ./make only to go down an endless rabbit hole of missing dependencies. I am very grateful that yum/apt-get, etc. have come such a long way, they grab all your dependencies, you don't have to wait long periods of time for the code to compile. I am sure Make still has it's uses, but I am sure glad package manage…

This is not really a fair comparison though. Makefiles and package managers are orthogonal and the latter has not really replaced the former. Makefiles are like a recipe, package managers are food delivery. Somebody has still to cook the food.

And the dependency tree (kudzu?) can be blamed on the "chef" preparing said recipe.

Re: The Makefile I use with JavaScript projects

#42
post #23

Make's interface is horrible. Significant tabs. Syntax which relies on bizarre punctuation... If only whoever authored Make 40 years ago had had the design acumen of a Ken Thompson or a Dennis Ritchie! We're stuck with Make because of network effects. I wish that it could just become "lost" forever and a different dependency-based-programming build tool could replace it... but that's just wishful thinking. The pace o…

Make is such a horrifically awful thing to work with that I just end up using a regular scripting language for building. Why learn another language with all its eccentricities and footguns when I already know several others?

because then people new to your project can see a makefile and know that “make” and “make test” and “make install” probably work without having to learn your homebrew, one-off build system.

Re: The Makefile I use with JavaScript projects

#43
post #23

Make's interface is horrible. Significant tabs. Syntax which relies on bizarre punctuation... If only whoever authored Make 40 years ago had had the design acumen of a Ken Thompson or a Dennis Ritchie! We're stuck with Make because of network effects. I wish that it could just become "lost" forever and a different dependency-based-programming build tool could replace it... but that's just wishful thinking. The pace o…

It's not like C is famous for having particularly good syntax. If anything, it's the worst thing about it.

They must have got something good though. Else why would there entire families of C-like languages ?

Plus, to me C syntax is particularly good. You're writing real words and the computers does the things you tell it to. To the letter.

Re: The Makefile I use with JavaScript projects

#45
post #19

CMake is so nice compared to vanilla makefiles. I wonder if it can be used this way with Javascript.

Maybe I'm wrong, but I always assumed CMake was optimized for the C language (thus the name)? That's at least what I've always seen it used for.

What would you gain if you're using it for other, less supported languages, like Javascript?

Re: The Makefile I use with JavaScript projects

#46
post #26

Anyone here uses makefiles for anything other than compilation and build? One can use it to add some level of concurrency to shell scripts.

Only really makes sense when you need to generate targets from a series of inputs. The targets don't have to be files, but it helps if they are to preserve the timestamp.

Re: The Makefile I use with JavaScript projects

#49
post #40

Earlier quoted context omitted.

Make is such a horrifically awful thing to work with that I just end up using a regular scripting language for building. Why learn another language with all its eccentricities and footguns when I already know several others?

Another advantage of using a scripting language is that the hard work of portability will already have been done for you by the authors of the scripting language. Make, in contrast, works within a shell and invokes programs which may be either wildly or subtly incompatible across platforms. Add in the lacking support for conditionals in POSIX make and portability is a nightmare.

it is possible that if you need to do that much in a makefile that you are running into shell incompatibilities then perhaps you are attempting to cram too much complexity into your build system and perhaps should be using something like Docker to decrease incidences of “works on my machine/os/distro/et c”.

(I am aware that this advice does not hold true in all cases; just that for many of them overly complicated build systems is a code smell.)

Re: The Makefile I use with JavaScript projects

#50
post #42

Earlier quoted context omitted.

Make is such a horrifically awful thing to work with that I just end up using a regular scripting language for building. Why learn another language with all its eccentricities and footguns when I already know several others?

because then people new to your project can see a makefile and know that “make” and “make test” and “make install” probably work without having to learn your homebrew, one-off build system.

This argument for Make is exclusively based on network effects. Fine. we accept that we're stuck with it. It still sucks.
Post reply on HN