Live data from Hacker News

The Makefile I use with JavaScript projects

olioapps.com

371–380 of 525 posts

Re: The Makefile I use with JavaScript projects

#371

I used make heavily in the 80s and 90s, but haven't much since then. Recently I started a project that had source files getting processed into PDF files, for use by humans. Since this is the 21st century, those files have spaces in their names. At a certain point, I realized that I should be managing this processing somehow, so I thought of using a simple Makefile. A little searching reveals that the consensus on usi…

Is there any clone of make that's aiming to address the issues with file name spaces?

Being incapable of handling spaces is a bug that's been marked Minor since 2002 - https://savannah.gnu.org/bugs/?712

(plus I find double quotation marks easier to read and write than escaping every space in a path)

Edit: https://stackoverflow.com/questions/66800/promising-alternat... (they aren't really clones tho)

Re: The Makefile I use with JavaScript projects

#372
I'm baffled at the amount of debate in this thread. Make is good for tasks that can be expressed as a directed acyclic graph of steps, where the steps' inputs and outputs are files, and steps can be expressed in a few lines of shell script. It works pretty well for such tasks in my opinion. Yes, it will look contorted for tasks that don't fit this model.

Re: The Makefile I use with JavaScript projects

#373

Earlier quoted context omitted.

> Meanwhile over in Windows land, all tools have been expected to deal with spaces in them for what is approaching 20 years. That is an excellent example that deserves a second look from a different aspect. ... it has trained a crop of computer users that are afraid of command lines and with an attitude of anything beneath the GUI interface is owned by and of someone else's problem. They are scared of computers more…

Which is not a problem. The command line was only one, historical UI. Not the be-all end-all of UIs, and there's no reason it should be of any real interest to modern desktop users (non devs). And I cut my teeth as a developer on DOS, Sun OS (pre-Solaris), and HP-UX, and early Linux back in the day.

To be fair to modern desktop users, a command line that doesn't redefine the word "command" to fit the constraints of the system would look something like this:

$ take this list of transactions and for each group of duplicate names show me the name and total dollar amount spent, sorted from highest to lowest

$ I think I have a SQL command for that. Are you feeling lucky? [y/n] y

Foo $25 Bar $20 Blah $15

$ Was this what you were looking for? [y/n]

Re: The Makefile I use with JavaScript projects

#374

Earlier quoted context omitted.

They don't though. Vanilla Vim/Vi doesn't for instance. Regardless of whether the editor can or not, I just don't see how insisting on tab and not space is remotely defensible.

> Vanilla Vim/Vi doesn't for instance. Vim does handle this. Here is Vim (and I've removed my .vimrc file, so this is not a setting I have set personally), on a Makefile where the third line erroneously uses spaces: https://i.imgur.com/xMHXeL4.png > I just don't see how insisting on tab and not space is remotely defensible. This is like insisting that people haven't been having religious wars over this sort topic for…

I'm glad it works for you. It didn't work for me.

Re: The Makefile I use with JavaScript projects

#375

Earlier quoted context omitted.

They don't though. Vanilla Vim/Vi doesn't for instance. Regardless of whether the editor can or not, I just don't see how insisting on tab and not space is remotely defensible.

https://stackoverflow.com/a/29787362 > remotely defensible Feel free to write your own make superset that supports spaces. It's an irrelevant factor to the usability of make as a whole.

It's something that almost everyone trips over.

Multiple times.

Actually writing a preprocessor for Make sounds like a pretty good idea.

Re: The Makefile I use with JavaScript projects

#376

I used make heavily in the 80s and 90s, but haven't much since then. Recently I started a project that had source files getting processed into PDF files, for use by humans. Since this is the 21st century, those files have spaces in their names. At a certain point, I realized that I should be managing this processing somehow, so I thought of using a simple Makefile. A little searching reveals that the consensus on usi…

Demanding the support of spaces in filenames significantly complicates code as simple space delimination no longer works and other delimination schemes are much more error prone -- forgetting balancing quotes, any one? While you are allowing spaces, you probabaly are allowing all possible code points or maybe even a null byte? Thinking about it gives me headaches. I hate hearing people using 21st century or modern as…

I am old-school and hate spaces. They do occasionally show up on my computer. But never in anything I'd be touching with a Makefile.

Re: The Makefile I use with JavaScript projects

#377

Earlier quoted context omitted.

> "The tools are not the same on every platform." Any common examples? > "It’s not very idiomatic for JavaScript projects to use Make." While I agree that popularity is a factor in picking a tool, it shouldn't be a deciding factor. Going by popularity is precisely how we end up with a new Build System of the Year(TM) every few years. The fact that we've gone through 4 fairly prominent tools (Gulp, Grunt, Broccoli, We…

This comment points out the kind of problems that can occur just on Unix systems - https://news.ycombinator.com/item?id=16485637 And then there’s Windows... Anyway, the fact that things change quickly in JS-land is more of a testament to how popular it is than anything else IMO. If C were used in the same environments as JS, I’m sure that you'd see just as much churn.

You can use gnu make on platforms where the usual make is not gnu. For example I install it from ports on *bsd and have an msys gnu make on Windows.

Re: The Makefile I use with JavaScript projects

#378
post #364

Earlier quoted context omitted.

Human beings who name things are going to use spaces. That spaces were used as delimiters for computers is somewhere between unfortunate and a colossal mistake. But to use that as evidence of why spaces should not be supported in filenames is putting the cart before the horse. The goal of software is not to perpetuate whatever mistakes have been made in the past. It's to solve problems for human beings. And human bei…

Not all languages have (or had) spaces.

I apologize if I implied that they did, because that has nothing to do with my intended message.

Re: The Makefile I use with JavaScript projects

#379
post #311

Earlier quoted context omitted.

Identification is a form of communication. The identifier assigned to me at birth contains two spaces. Most people use one of the shorthand forms, but still.

I'm intrigued. Your first name has two spaces in it? That is, I think it is safe to say that we expect we can include spaces in the names of things. The movie is named "Star Wars", after all. That seems natural. For people, though, we have grown used to someone having multiple parts of their name separated by a space. If given out of order, a comma. Even in the "naming things" category. We are used to having to put q…

> I'm intrigued. Your first name has two spaces in it?

No. But my name does.

> For people, though, we have grown used to someone having multiple parts of their name separated by a space. If given out of order, a comma.

https://www.kalzumeus.com/2010/06/17/falsehoods-programmers-...

Re: The Makefile I use with JavaScript projects

#380

Earlier quoted context omitted.

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.

Most languages become popular because they have a reputation of necessity. Which is to say, they are popular due to marketing, not due to quality. (As most things are.)
Post reply on HN