Be Aware of the Makefile Effect

blog.yossarian.net

46 points

thunderbong

3 hours ago


21 comments

teo_zero 10 minutes ago

> 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?)
dirkt 2 minutes ago

Same with programming: You just copy some old code and modify it, if you have something lying around.

Same with frameworks (Angular, Spring Boot, ...). The tools even come with templates to generate new boilerplate for people who don't have existing ones somewhere.

mattbillenstein 14 minutes ago

I think Makefile is maybe the wrong analogy - the problem with most people and makefiles is they write so few of them, the general idea of what make does is at hand, but the muscle memory of how to do it from scratch is not.

But, point taken - I've seen so much code copy-pasta'd from the web, there will be like a bunch of dead stuff in it that's actually not used. A good practice here is to keep deleting stuff until you break it, then put whatever that was back... And delete as much as possible - certainly everything you're not using at the moment.

donatj 36 minutes ago

If I had a nickel for every time I have seen a Makefile straight up copied from other projects and modified to "work" while leaving completely unrelated unnecessary build steps and targets in place.

It's a major pet peeve of mine.

  • bboygravity 10 minutes ago

    How do you know what is and isn't related if nothing is documented?

    Trial and error?

    Well have fun with that :p

mcdeltat 36 minutes ago

At my work I've noticed another contributing factor: tools/systems that devs need to interact with at some point, but otherwise provide little perceived value to learn day-to-day.

Example is build system and CI configuration. We absolutely need these but devs don't think they should be expected to deal with them day to day. CI is perceived as a system that should be "set and forget", like yeah we need it but really I have to learn all this just to build the app? Devs expect it to "just work" and if there are complexities then another team (AKA my role) deals with that. As a result, any time devs interact with the system, there's a high motivation to copy from the last working setup and move on with their day to the "real" work.

The best solution I see is meet the devs halfway. Provide them with tooling that is appropriate simple/complex for the task, provide documentation, minimise belief in "magic". Tools like Make kinda fail here because they are too complex and black-box-like.

  • nicoburns 8 minutes ago

    For me the big problems with CI setups tend to be:

    - They're often slow

    - They're often proprietary

    - They're often dealing with secrets which limits who can work on them

    - You generally can't run them locally

    So the feedback cycle for working on them is incredibly long. And working on them is therefore a massive pain.

  • exitb 11 minutes ago

    The office coffee machine is not „set and forget”, but you wouldn’t expect the entire responsibility for it’s maintenance to be evenly distributed between all people that use it. Similarly, CI needs ownership and having it fall on the last developer that attempted to use it is not an efficient way of working.

Papirola 2 minutes ago

I call it the yoghurt effect.

szarnyasg 30 minutes ago

I have observed the Makefile effect many times for LaTeX documents. Most researchers I worked with had a LaTeX file full of macros that they have been carrying from project to project for years. These were often inherited from more senior researchers, and were hammered into heavily-modified forks of article templates used in their field or thesis templates used at their institution.

  • wjholden 12 minutes ago

    This is a great example of an instance of this "Makefile effect" with a possible solution: use Markdown and Pandoc where possible. This won't work in every situation, but sometimes one can compose a basic Beamer presentation or LaTeX paper quickly using largely simple TeX and the same Markdown syntax you already know from GitHub and Reddit.

baobun 29 minutes ago

Good points in general.

On the other hand, there are cases where (beneficial/desired) verbosity prompts copy-paste and tweaking - not due to complexity but from some form of scale or size of the input.

In many cases this is a sign of something that should be dynamic data (put it in a db instead of conf) but that's not always the case and worth the tradeoff in the moment.

ruuda 27 minutes ago

I think LaTeX is the poster child of this. Nobody writes a LaTeX preamble from scratch, you always copy your previous document and tweak it.

rpcope1 an hour ago

I feel this way every time with webpack, npm and babel.

lazystar 28 minutes ago

amazon's internal build tool experiences this same phenomena. engineers are hired based on their leetcode ability; which means the average engineer has gaps in their infrastructure and config tool knowledge/skillset. until the industrys hiring practices shift, this trend will continue.

kazinator an hour ago

At first I couldn't understand what this article is saying. Then, .SECONDEXPANSION: kicked in!

travisgriggs 40 minutes ago

It’s like a variant of Pournelles Law.

malkia 18 minutes ago

or ahem... CMake

Over2Chars an hour ago

A clever point, worth discussing

fithisux 33 minutes ago

Alias, cmake effect.