News for hackers. Stuff that matters.
Re:An opinionated approach to GNU Make by GordonS on Tuesday December 17, 2019 @08:17AM (#21813114)
Happened to me just the other day.

I added a makefile to a project that didn't yet have one, and I didn't have makefile support added in my IDE.

Got some weird, unhelpful errors when trying to run make, and eventually realised spaces were being used instead of tabs.

The solution was to configure my .editorconfig file to use tabs for makefiles, and as a nice-to-have, to also install a makefile plugin in my IDE.

Re:An opinionated approach to GNU Make by account42 on Tuesday December 17, 2019 @08:31AM (#21813225)
> The solution was to configure my .editorconfig file to use tabs for makefiles

The real solution is to not have your editor silently convert tabs to spaces, ever.

Re:An opinionated approach to GNU Make by simias on Tuesday December 17, 2019 @09:02AM (#21813474)
The real solution for dealing with spaces vs tabs is that there's no real solution that will work all the time. Or maybe we could go back in time and murder both hitler and the person who decided that tabs should be a separate character (which I wouldn't be surprised if they were the same person).

If you don't autoconvert you risk ending up with a file mixing tabs and spaces which can range from a mild annoyance to generating very perplexing errors that are a pain to debug if the file's format is sensitive to indentation (such as python scripts or... Makefiles). I suppose you could argue that the conversion should require user interaction but frankly that sounds like a hassle since 99% of the time autoconverting is absolutely fine.

Furthermore it makes total sense to use an editor config to force a certain standard and avoid problems in the future, especially if you work with many third party libraries with different coding styles. At work I deal with python files indented with 4 spaces, the Linux kernel indented indented with 8-space tabs and a bunch of other projects and language who may or may not be using other variants. You'll have to pry my editorconfigs from my cold, dead hands.

Re:An opinionated approach to GNU Make by bhaak on Tuesday December 17, 2019 @04:19PM (#21818953)
> Or maybe we could go back in time and murder both hitler and the person who decided that tabs should be a separate character (which I wouldn't be surprised if they were the same person).

You got the timeline almost right. A tab and a space are not only different characters, they are not even in the same category of characters.

A space is a whitespace character whereas a tab is a control character that moves the cursor to a specific position. Its name is an indicator for what it was used in the beginning, to arrange data in a tabular form.

The real problem is that many editors don't show tabs differently from spaces. In vim you can do a lot with the options "listchars".

My settings there are: set list listchars=tab:>-,eol:$,nbsp:~,trail:X

Re:An opinionated approach to GNU Make by gumby on Tuesday December 17, 2019 @09:12PM (#21821126)
> Or maybe we could go back in time and murder both hitler and the person who decided that tabs should be a separate character (which I wouldn't be surprised if they were the same person).

Tab released the spring holding the carriage in place and let it slide backwards until a tab on the base his a tab on the carriage that prevented it moving further on its own. High tech typewriters let you adjust the position of these tab stops (or "stop tabs", if you prefer). This back from the days when many typewriters omitted "1" and "0" -- we just typed l and O.

Tab on the oldest printing terminals simply had this behavior as they were essentially complicated typewriters anyway ("TTY" is "Tele TYpewriter")

BTW your post does not invoke Godwin's law.

Re:An opinionated approach to GNU Make by GordonS on Tuesday December 17, 2019 @08:37AM (#21813275)
I have to say, I long favoured tabs myself - but I eventually gave up and decided not to die on that hill.
Re:An opinionated approach to GNU Make by mixmastamyk on Tuesday December 17, 2019 @05:56PM (#21819870)
Any editor from the last twenty years should know to indent a Makefile with tabs.
Re:An opinionated approach to GNU Make by GordonS on Tuesday December 17, 2019 @06:02PM (#21819919)
Well, we could pretend that's the case, or we could accept the reality - many don't, at least not out of the box.
Re:An opinionated approach to GNU Make by mixmastamyk on Tuesday December 17, 2019 @10:00PM (#21821371)
Given that plenty are FLOSS there’s no reason to pretend that it’s difficult to upgrade.