There is a particular kind of tech educator who doesn’t just teach you how to write code — they teach you how to think about code. Mattias Petter Johansson, known universally as MPJ, built one of the most beloved programming channels on YouTube with an approach that combined deep technical insight, philosophical curiosity, and an infectious energy that made functional programming feel like an adventure rather than an academic exercise. As the creator of Fun Fun Function, he transformed how an entire generation of JavaScript developers understood concepts like higher-order functions, monads, and composition — all while wearing costumes and cracking jokes at his own expense.
Early Life and Background
Mattias Petter Johansson grew up in Sweden, where he developed an early fascination with computers and creative expression. From a young age, he was drawn to the intersection of technology and art — a theme that would define his entire career. Sweden’s strong tech ecosystem, home to companies like Spotify, Ericsson, and King, provided a fertile ground for a curious mind eager to push boundaries.
MPJ studied computer science in Sweden, where he first encountered the functional programming paradigms that would later become central to his teaching. Unlike many who treat university as a purely vocational pipeline, Johansson was deeply influenced by the theoretical side of computing — lambda calculus, type theory, and the mathematical foundations that underpin modern programming languages. He has cited Abelson and Sussman’s Structure and Interpretation of Computer Programs as a formative text, a book that treats programming as a means of expressing ideas rather than merely instructing machines. This dual appreciation for both the practical and the theoretical gave him a rare ability to translate complex ideas into approachable explanations — a skill that would later distinguish him from countless other tech educators competing for attention on YouTube.
Before becoming a public figure, MPJ spent years as a working software engineer, building real products and shipping production code at multiple companies in Sweden’s thriving startup scene. He worked across the full stack, gaining experience with everything from frontend interfaces to backend distributed systems. This hands-on experience would prove invaluable: when he eventually stood in front of a camera, he wasn’t teaching from textbooks alone. He was teaching from the trenches, armed with the kind of battle-tested intuition that only comes from years of debugging production incidents at three in the morning.
Career and the Fun Fun Function Revolution
Technical Innovation: Making Functional JavaScript Accessible
MPJ’s career took shape across several significant roles in the Swedish tech scene. He worked as a software engineer at Spotify, one of the world’s largest music streaming platforms, where he contributed to the complex distributed systems powering millions of concurrent streams. At Spotify, he worked alongside world-class engineers, honing his craft in large-scale JavaScript and backend systems architecture.
But it was in 2015 that MPJ made the move that would define his legacy. He launched Fun Fun Function, a YouTube channel dedicated to explaining programming concepts — particularly JavaScript and functional programming — in an entertaining and deeply human way. The channel’s name itself was a statement of intent: programming should be fun, and functions (in the functional programming sense) are the gateway to elegant code.
What set Fun Fun Function apart was MPJ’s ability to take notoriously difficult concepts and make them feel natural. His series on functional programming in JavaScript became a canonical resource, covering topics like map, reduce, and filter with clarity that textbooks rarely achieve. Consider how MPJ would teach the concept of higher-order functions:
// MPJ's teaching style: start simple, build intuition
const animals = [
{ name: 'Fluffykins', species: 'rabbit' },
{ name: 'Caro', species: 'dog' },
{ name: 'Hamilton', species: 'dog' },
{ name: 'Harold', species: 'fish' },
{ name: 'Ursula', species: 'cat' },
{ name: 'Jimmy', species: 'fish' }
];
// Imperative approach — what most beginners write
const dogs = [];
for (let i = 0; i < animals.length; i++) {
if (animals[i].species === 'dog') {
dogs.push(animals[i]);
}
}
// Functional approach — what MPJ taught millions to embrace
const isDog = (animal) => animal.species === 'dog';
const dogs2 = animals.filter(isDog);
// The key insight: functions as values unlock composition
const getNames = (animals) => animals.map(a => a.name);
const dogNames = getNames(animals.filter(isDog));
// => ['Caro', 'Hamilton']
This wasn’t just about syntax. MPJ consistently emphasized the why behind functional patterns — reduced cognitive load, fewer side effects, and code that reads like a declaration of intent rather than a sequence of machine instructions. His approach echoed the philosophy championed by pioneers like Douglas Crockford, who had long advocated for JavaScript’s good parts and functional capabilities.
The channel grew rapidly, eventually amassing over 250,000 subscribers and tens of millions of views. MPJ covered an enormous range of topics: closures, promises, async/await, object composition versus class inheritance, monads (his “Functors” episode remains legendary), dependency injection, and test-driven development. Each episode was typically 10-15 minutes — long enough to build real understanding, short enough to hold attention.
Why It Mattered: Democratizing Advanced Concepts
To understand MPJ’s impact, you have to understand the landscape of JavaScript education in the mid-2010s. The language was undergoing a massive transformation. ES6 had introduced arrow functions, destructuring, template literals, and native promises. Frameworks like React (created by Dan Abramov and the React team) were pushing developers toward functional patterns and immutable data flows. Meanwhile, Ryan Dahl’s Node.js had made JavaScript a full-stack language, and the ecosystem was evolving at a breakneck pace.
Most educational content at the time fell into two categories: beginner tutorials that never went deep enough, or academic papers and conference talks that assumed significant prior knowledge. MPJ filled the critical gap in between. He made functional programming — a paradigm that had historically been the domain of Haskell academics and Lisp enthusiasts — feel accessible to everyday JavaScript developers building web applications.
His video on composition over inheritance became a touchstone for the JavaScript community, challenging the class-based OOP patterns that many developers had imported from Java and C#. He argued, with characteristic humor and rigor, that object composition leads to more flexible and maintainable code — a message that resonated deeply as the React ecosystem moved toward hooks and functional components.
MPJ’s influence extended beyond individual viewers. His teaching style — conversational, vulnerable, willing to admit confusion — gave other educators permission to be imperfect on camera. He helped normalize the idea that a senior engineer doesn’t have all the answers, and that the learning process itself is worth documenting. This ethos influenced creators like Wes Bos and Kent C. Dodds, who similarly built educational empires around accessible, personality-driven teaching.
Other Contributions
Beyond Fun Fun Function, MPJ contributed to the broader developer community in several meaningful ways. His time at Spotify gave him deep insight into how large engineering organizations function (and malfunction), and he frequently shared lessons about team dynamics, code review culture, and the human side of software development.
MPJ was an early and vocal advocate for the composition pattern in JavaScript, helping popularize the idea that small, pure functions composed together can replace complex class hierarchies. He demonstrated this through practical refactoring examples that showed real codebases becoming simpler and more testable:
// Composition over inheritance — MPJ's signature teaching topic
// Instead of a deep class hierarchy:
// Animal → Pet → Dog → GuideDog
// Use composition of small, focused functions:
const canWalk = (state) => ({
walk: () => console.log(`${state.name} is walking`)
});
const canSwim = (state) => ({
swim: () => console.log(`${state.name} is swimming`)
});
const canBark = (state) => ({
bark: () => console.log(`${state.name} says woof!`)
});
// Compose behaviors freely without rigid hierarchies
const createDog = (name) => {
const state = { name };
return Object.assign(
{ name },
canWalk(state),
canSwim(state),
canBark(state)
);
};
const rex = createDog('Rex');
rex.walk(); // Rex is walking
rex.bark(); // Rex says woof!
He also contributed to conversations around developer mental health and burnout — topics that were still taboo in tech when MPJ began discussing them openly on his channel. In an industry that often glorifies overwork, his willingness to talk about anxiety, imposter syndrome, and the pressure to constantly learn was both brave and necessary.
MPJ’s later work expanded into broader explorations of technology and society. He discussed AI, the ethics of software engineering, and the responsibility that developers carry when their code affects millions of lives. This philosophical bent connected him to a tradition of thoughtful technologists who see programming as more than a trade — a perspective shared by educator-engineers across the industry who believe in building tools that genuinely help people work better.
After ending Fun Fun Function in 2020 — a decision he discussed with raw honesty in his final episodes — MPJ transitioned to new ventures, including work on developer tools and continued mentorship. His departure from YouTube was itself a lesson: knowing when to stop is as important as knowing when to start. In his farewell video, he explained that the creative well had run dry and that continuing would mean producing content he wasn’t proud of — a level of self-awareness and professional integrity that earned him even more respect from his audience.
Philosophy and Approach
MPJ’s teaching philosophy was rooted in several core beliefs that distinguished him from other programming educators. Where many instructors focus purely on technical correctness, MPJ was deeply interested in how people experience the act of programming — the emotional journey, the cognitive patterns, and the human factors that determine whether a developer thrives or burns out.
His philosophy drew from the same well that inspired the creator of JavaScript himself. Brendan Eich built JavaScript with functional programming DNA — first-class functions, closures, prototypal inheritance — and MPJ became one of the language’s most effective advocates for embracing that functional heritage rather than fighting against it.
Key Principles
- Composition over inheritance — Build complex behavior by combining small, focused functions rather than creating deep class hierarchies. This leads to code that is more flexible, testable, and easier to reason about.
- Embrace vulnerability in learning — Being confused is not a sign of weakness; it’s a natural and necessary part of growth. The best engineers are the ones who can sit with discomfort and work through it.
- Functions are the fundamental unit of abstraction — Pure functions with clear inputs and outputs are the building blocks of reliable software. Side effects should be isolated and managed, not scattered throughout your codebase.
- Joy matters in programming — If your development process feels like a grind, something is wrong. Good tools, good patterns, and good teams should make coding feel creative and rewarding. Modern project management approaches increasingly recognize that developer experience directly impacts product quality.
- Teach by showing your process, not just the result — Students learn more from watching someone struggle with a problem than from seeing a polished solution. The mess is where the real learning happens.
- Question everything, especially best practices — Just because something is widely adopted doesn’t mean it’s right for your context. Think critically about the tools and patterns you use.
- Community is a responsibility — Having a platform means having an obligation to be honest, inclusive, and thoughtful about the messages you amplify.
Legacy and Influence
Mattias Petter Johansson’s impact on the JavaScript ecosystem cannot be measured in lines of code or GitHub stars. His legacy lives in the mental models of hundreds of thousands of developers who learned to think functionally because a Swedish engineer with a quirky sense of humor made it feel safe to try.
Fun Fun Function demonstrated that technical education doesn’t have to be dry or intimidating. By bringing personality, humor, and philosophical depth to programming tutorials, MPJ helped create the modern landscape of developer content creation. Today’s thriving ecosystem of programming YouTubers, Twitch streamers, and course creators owes a significant debt to the trail he blazed.
His advocacy for functional programming in JavaScript specifically helped accelerate the language community’s shift away from classical OOP patterns. The rise of React Hooks, the popularity of libraries like Ramda and fp-ts, and the general embrace of immutability and pure functions in frontend development all trace partly back to the evangelism that MPJ and others championed during the critical 2015-2020 period.
Perhaps most importantly, MPJ showed that being a great engineer and being a great communicator are not mutually exclusive talents. In a field that often rewards quiet technical brilliance while undervaluing the ability to teach and inspire, he proved that education is itself a form of engineering — designing systems of understanding that scale to millions of minds.
The functional programming revolution in JavaScript was not the work of any single person. It was a movement built by creators like Evan You, who brought reactive composition to Vue.js, and Rich Harris, who pushed the boundaries of what compile-time optimization could achieve. But MPJ was the movement’s most gifted storyteller — the person who could take a monad, strip away the jargon, and show you why it matters for the code you write on Monday morning.
Key Facts
- Full name: Mattias Petter Johansson
- Known as: MPJ
- Nationality: Swedish
- Notable role: Software engineer at Spotify
- Signature project: Fun Fun Function (YouTube channel, 2015-2020)
- Subscribers at peak: Over 250,000
- Primary topics: Functional programming, JavaScript, composition patterns, developer philosophy
- Famous series: Functional Programming in JavaScript, Composition over Inheritance
- Key advocacy: Developer mental health, vulnerability in learning, functional paradigms
- Influence: Helped popularize functional JavaScript patterns adopted by React, Vue, and modern frameworks
Frequently Asked Questions
What made Fun Fun Function different from other programming channels?
Fun Fun Function stood out because MPJ combined genuine technical depth with an approachable, often comedic presentation style. Unlike tutorial channels that focus on step-by-step instructions, MPJ emphasized understanding — explaining the reasoning behind patterns and encouraging viewers to think critically. His willingness to show confusion, make mistakes on camera, and discuss the emotional aspects of programming created an unusually authentic learning environment that resonated with beginners and senior developers alike.
Why did MPJ focus so heavily on functional programming in JavaScript?
MPJ recognized that JavaScript had powerful functional capabilities — first-class functions, closures, higher-order functions — that most developers were not fully utilizing. As frameworks like React began encouraging functional patterns (pure components, immutability, declarative rendering), MPJ saw an opportunity to help the community embrace these paradigms. He believed that functional programming reduced bugs, improved code readability, and made developers more productive. His timing proved prescient: the shift toward React Hooks and functional components validated much of what he had been teaching.
What is the composition over inheritance principle that MPJ championed?
Composition over inheritance is the design principle that software should achieve code reuse and polymorphism by composing small, independent pieces of functionality rather than building deep class hierarchies. MPJ argued that classical inheritance (as commonly taught in Java and C++) creates rigid, brittle code where changes to a parent class can cascade unpredictably through the inheritance tree. Instead, he advocated for creating small functions or objects that can be freely combined — similar to how Unix pipes compose simple tools into complex workflows. This approach aligns with how modern JavaScript frameworks like React and Vue structure their component models.
How did MPJ influence the modern JavaScript education landscape?
MPJ was a pioneer in the personality-driven programming education format that dominates YouTube and online learning today. Before Fun Fun Function, most programming content was either dry screen recordings or formal university lectures. MPJ proved that technical content could be entertaining without sacrificing depth, inspiring a wave of creator-educators who followed his model. His open discussions about burnout and imposter syndrome also helped normalize conversations about developer mental health, influencing both individual creators and companies to take these issues more seriously.