News for hackers. Stuff that matters.
Re:The Makefile I use with JavaScript projects by bitwize on Wednesday February 28, 2018 @12:36PM (#16484831)
Until a stray space finds its way into your command list indentation...
Re:The Makefile I use with JavaScript projects by bpicolo on Wednesday February 28, 2018 @12:46PM (#16484936)
Every popular text editor handles this already. People manage make, python and other whitespace-specified languages just fine.
Re:The Makefile I use with JavaScript projects by emmelaich on Wednesday February 28, 2018 @12:57PM (#16485042)
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.

Re:The Makefile I use with JavaScript projects by deathanatos on Wednesday February 28, 2018 @01:13PM (#16485194)
> 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 years. You can see the Wiki[1] page on it (which starts "This is one of the eternal Holy Wars") for arguments as to why someone might prefer tabs. I personally like them because they allow the reader of the code to choose the visual layout of the indentation.

Now, while I love tabs, I work in Python all day. But good editors, like Vim, allow you to customize the indentation settings sufficiently to handle both cases like Python (spaces for indent) and Makefile (tabs) gracefully. So "Indent" and "Dedent" just do The Right Thing™ and it mostly never matters.

[1]: http://wiki.c2.com/?TabsVersusSpaces

Re:The Makefile I use with JavaScript projects by travmatt on Wednesday February 28, 2018 @01:36PM (#16485427)
If someone is really paranoid about white space issues in a file you’re editing on vim, you can can always use `:set list` to display those characters.
Re:The Makefile I use with JavaScript projects by enriquto on Wednesday February 28, 2018 @04:11PM (#16486964)
or, you can write your recipes as

    target : requisites ; recipe
with a semicolon instead of a tab.

However, tabs are beautiful, and every occasion to use them should be cherised as precious.

Re:The Makefile I use with JavaScript projects by emmelaich on Wednesday February 28, 2018 @09:38PM (#16489240)
I'm glad it works for you. It didn't work for me.
Re:The Makefile I use with JavaScript projects by bpicolo on Wednesday February 28, 2018 @01:09PM (#16485155)
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.

Re:The Makefile I use with JavaScript projects by emmelaich on Wednesday February 28, 2018 @09:39PM (#16489243)
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 by voltagex_ on Wednesday February 28, 2018 @11:48PM (#16489745)
ninja, cmake, premake.
Re:The Makefile I use with JavaScript projects by swsieber on Wednesday February 28, 2018 @03:18PM (#16486418)
FWIW, the more experienced a programmer is, the more likely they are to prefer spaces over tabs.

My pet theory is that the more experience you have, the more likely you are to have worked with Python, which is a lot easier to work with if you just always s/\t/ / (replace tabs with spaces).