Shu-Ha-Ri: A Philosophy for Learning in Software Development

Introduction

Shu-Ha-Ri is a Japanese concept that describes the stages of learning and mastery. It is often used in martial arts but has valuable applications in software development and learning new technologies. The three stages—Shu (follow), Ha (break), and Ri (transcend)—illustrate a journey from structured learning to innovation and intuition.

In this article, I want to correlate how I teach and expect people to learn. The goal is not merely to memorize but to revisit topics, experiment, break the rules when needed, and ultimately integrate knowledge so deeply that it becomes second nature.

Understanding Shu-Ha-Ri

Shu (Follow the Rules)

At the beginning of learning, one should follow established best practices, patterns, and rules. This is where structured learning happens. The focus is on absorbing knowledge, understanding principles, and avoiding deviations that might lead to confusion.

Example in Software Development:

  • Learning to write clean, idiomatic JavaScript by following established style guides like Airbnb’s JavaScript guide.
  • Implementing design patterns as they are documented before trying to modify them.
  • Using frameworks (e.g., Express, NestJS) as prescribed without deep customization.

Good Example (Following best practices in Node.js):

1
2
3
4
5
6
7
8
const express = require('express');
const app = express();

app.get('/', (req, res) => {
  res.send('Hello, world!');
});

app.listen(3000, () => console.log('Server running on port 3000'));

Here, we stick to the established way of creating an Express server, without unnecessary complexity.

Ha (Break the Rules)

Once the foundation is understood, the learner starts questioning and experimenting. This stage is about exploring alternatives, understanding why rules exist, and adapting them to real-world needs.

Example in Software Development:

  • Modifying existing patterns to better suit specific project requirements.
  • Using alternative approaches (e.g., replacing Express with Fastify for performance benefits).
  • Exploring functional programming paradigms in a traditionally object-oriented codebase.

Example (Breaking the rules for a valid reason):

1
2
3
4
5
6
7
const fastify = require('fastify')();

fastify.get('/', async (request, reply) => {
  return { message: 'Hello, world!' };
});

fastify.listen(3000, () => console.log('Fastify server running on port 3000'));

Here, instead of using Express, we opt for Fastify, which provides better performance in some cases. This is an informed decision rather than blindly following trends.

Ri (Transcend the Rules)

At this stage, rules become second nature, and the developer no longer consciously follows them—they just intuitively know what works best. This is the mastery phase, where problem-solving is fluid, and principles are internalized.

Example in Software Development:

  • Writing efficient, readable, and maintainable code naturally without actively thinking about guidelines.
  • Creating a new architecture or framework based on deep knowledge of software principles.
  • Innovating beyond best practices, introducing new methodologies that improve team productivity.

Example (Intuitive code that is efficient and elegant):

1
2
3
4
5
6
7
8
import { createServer } from 'http';

const server = createServer((req, res) => {
  res.writeHead(200, { 'Content-Type': 'application/json' });
  res.end(JSON.stringify({ message: 'Hello, world!' }));
});

server.listen(3000, () => console.log('Server running on port 3000'));

At this stage, the developer chooses the simplest, most effective approach based on the context, without over-engineering or rigidly following existing patterns.

The Importance of Revisiting Topics

The key takeaway is that learning is an ongoing process. Memorization is not the goal—rather, it’s about building a mental toolkit that you can revisit and adapt over time. Experimentation, revisiting foundational principles, and breaking conventions when necessary lead to true mastery.

Conclusion

By applying the Shu-Ha-Ri philosophy to software development, we encourage continuous growth. First, we follow (Shu), then we experiment and adapt (Ha), and finally, we internalize and innovate (Ri). This mindset ensures that learning is not about memorization but about acquiring tools that evolve with experience.


[alex_rocha] by alex

🇧🇷Senior Software Developer