←back to thread

Be Aware of the Makefile Effect

(blog.yossarian.net)
431 points thunderbong | 1 comments | | HN request time: 0.213s | source
Show context
teo_zero ◴[] No.42663964[source]
> the tool (or system) is too complicated (or annoying) to use from scratch.

Or boring: some systems require boilerplate with no added value. It's normal to copy & paste from previous works.

Makefiles are a good example. Every makefile author must write their own functionally identical "clean" target. Shouldn't there be an implicit default?

C is not immune, either. How many bits of interesting information do you spot in the following excerpt?

  #include <stdio.h>
  int main(int argc, char **argv)
  {
    printf("Hello\n");
    return 0;
  }
The printf alone is the real payload, the rest conveys no information. (Suggestion for compiler authors: since the programs that include stdio.h outnumber those that don't, wouldn't it be saner for a compiler to automatically do it for us, and accept a flag to not do it in those rare cases where we want to deviate?)
replies(7): >>42664020 #>>42664022 #>>42664034 #>>42664043 #>>42664258 #>>42664587 #>>42664813 #
1. chikere232 ◴[] No.42664587[source]
> Makefiles are a good example. Every makefile author must write their own functionally identical "clean" target. Shouldn't there be an implicit default?

At some point you have to give the system something to go on, and the part where it starts deleting files seems like a good one where not to guess.

It's plenty implicit in other places. You can for example, without a Makefile even, just do `make foo` and it will do its best to figure out how to do that. If there's a foo.c you'll get a `foo` executable from that with the default settings.