Just Eat GJ Kooijmans

Just Eat: Best Practices for Writing Compose Code

Original post Best Practices for Writing Compose Code

Article Summary

GJ Kooijmans from Just Eat Takeaway compares writing software to Bruce Springsteen's E Street Band. Both succeed by composing simple parts into harmonious wholes—but most developers struggle with the composition part.

This article breaks down function composition principles using JavaScript examples, drawing from Eric Elliott's book 'Composing Software.' Kooijmans argues that learning to compose code properly is the difference between maintainable software and projects held together with duct tape.

Key Takeaways

Critical Insight

Mastering function composition makes your code structured, scalable, and understandable by breaking complex problems into simple, composable solutions.

Continue reading

What This Article Covers

Problem

When developers work with composed functions, they can't see the intermediate values. This makes it hard to figure out where calculations break down in multi-step pipelines.

Solution

GJ Kooijmans built a trace utility function that logs values between composed functions. Developers can now inspect outputs at each step without breaking the composition chain.

Impact

Using pipe and trace utilities keeps code concise and easier to read. Other developers spend less mental effort understanding how the functions connect.

The article includes a practical refactoring example that transforms messy price calculation code into a clean, one-line pipeline.

This page summarizes “Best Practices for Writing Compose Code” by Just Eat, published Aug 23, 2021. All credit for the original work goes to the authors.

Read the original on medium.com (opens in new tab)

AI tools for Android

Browse all AI tools →