News for hackers. Stuff that matters.
Re:Using Make – writing less Makefile by enriquto on Tuesday December 26, 2023 @06:46PM (#38777337)
> I wish they had fixed it to accept both tabs and spaces a long time ago.

I have good news for you: this is already the case! In all modern versions of make you can use semicolons instead of tabs.

You just write

    target : dependencies ; rule
instead of

    target : dependencies
    ^Irule
if, for some reason, you hate the beautiful tab characters.
Re:Using Make – writing less Makefile by bxparks on Tuesday December 26, 2023 @07:56PM (#38777831)
Ha, what if the 'rule' is 5 lines long?

Many times, a Makefile snippet in an HTML page or a PDF file has had the tab character auto-magically morphed into spaces. So when it is copied, it will be a syntax error in a Makefile. Even copying Makefile snippets from one terminal window to another will eat those tab characters. Fortunately my vim editor is configured to handle most of those edge cases now, but it took me... I don't know... 10-15 years to get that right.

My personal rule is that control characters which are visually indistinguishable from other characters have no place in source code which are meant to be written, read, and copied by human beings. So yeah, that includes the <tab> character. And yes, I do think the Golang people got that wrong, although the 'go fmt' command largely solves that problem. Except when reading Go source code on web sites which don't handle tabs well, and you are nested 6 levels deep, and half the code is unreadable because it's bled off the right side of the page.

Re:Using Make – writing less Makefile by enriquto on Tuesday December 26, 2023 @09:58PM (#38778602)
> control characters which are visually indistinguishable from other characters

This is a text editor configuration issue, not a character choice issue.

Re:Using Make – writing less Makefile by twaw on Wednesday December 27, 2023 @01:58AM (#38779726)
In my editor, tabs are shown with reddish background, so they cannot be mismatched with spaces. Fix your editor.