Here’s What Flow State Is & How To Achieve It While Coding


Ever get so completely immersed in writing code that time slows down and you really find a groove? It’s invigorating, and can enable you to produce your best work or reach peak productivity. Turns out, this common feeling is a psychological concept called “flow.”

Positive psychologist Mihaly Csikszentmihalyi was the first researcher to identify the concept of “flow state,” and he described it as “those times when things seem to go just right, when you feel alive and fully attentive to what you are doing.”

Maybe you’ve experienced this sensation in non-work scenarios, like playing a video game, designing a web page, or trying to master a guitar lick. Flow state even shows up in an educational context, like when you’re learning a new programming language and reach an “aha moment” where things start to click.

Flow state doesn’t just happen randomly. In fact, Dr. Csikszentmihalyi’s research has shown that there are several conditions that line up and elicit flow. Here are the factors that, taken together, can lead to flow — you might already have many of them in place without realizing:

1. You’re completely concentrated on the task

Might sound like a no-brainer, but you need to be totally immersed in a task in order to reach flow. Getting rid of distractions — from Slack notifications to a messy desk — is one way to set yourself up for uninterrupted focus.

2. Your goals and rewards are clear, and you receive feedback

Focusing intensely on one thing “leads to a sense of ecstasy, a sense of clarity,” Dr. Csikszentmihalyi said in a 2004 TED Talk. When you’re in flow, it’s super clear what you want and need to do — almost like having an internal to-do list that just automatically keeps you going.

Having a consistent source of feedback is another factor that keeps you in flow. According to Dr. Csikszentmihalyi, getting feedback compels people to continue on with a task while in flow. It’s easy to see how this applies to coding: You’re constantly presented with feedback any time you run code, since it either works or it doesn’t.

3. Time distorts

Losing track of time is a key feature of flow. For example, time might feel like it slows down or flies by because you’re solely thinking about what you’re working on. Of course, this can be a double-edged sword; if you’re in flow you might need to actively set time boundaries so you don’t overwork yourself.

4. You’re doing something for the sake of doing it

There might be an external reason why you’re working on something, for example, your manager gave you an assignment or you need to meet a deadline for a freelance project. The distinct thing about flow is that you can also develop intrinsic motivation for that very same task — meaning, you’re just doing it because it’s rewarding to you personally.

5. It’s a challenging task…

Flow-inducing tasks are typically challenging enough that they require your full attention. Dr. Csikszentmihalyi wrote that flow state “acts as a magnet for learning new skills and increasing challenges.” In other words, if something is too easy, the way to get back to flow is by challenging yourself. And if something seems too difficult, you can learn something new that will help you overcome it.

6. …but can’t be too challenging

Flow involves self-esteem and self-efficacy, which is the belief that you’re capable of executing a task. Whereas an overly complicated task might feel overwhelming or frustrating, in flow, you’re confident you can accomplish what’s being asked of you. The result can be relaxing: “Flow occurs in that delicate zone between boredom and anxiety,” Dr. Csikszentmihalyi told the New York Times.

7. You stop ruminating

Though it sounds trippy or esoteric, a characteristic of flow state is feeling like your “existence is temporarily suspended,” Dr. Csikszentmihalyi said in the TED Talk. In other words, you forget yourself. With all of your attention devoted to one task, your brain tunes out other problems, worries, or even bodily sensations (like hunger, fatigue, or muscular pain).

8. You’re in control

While in flow, you’re in control of whatever outcomes happen, rather than feeling carried away or impatient.

Flow clearly can boost your productivity and performance, but there are deeper mental health benefits to the practice. There’s research that experiencing flow can make people happier and more fulfilled.

If you’re able to find flow in your professional life, that’s an added bonus. But some people might tap into flow during activities outside of work, like artistic pursuits or sports. According to Dr. Csikszentmihalyi, it’s important to keep pushing yourself by learning new skills at work. “Most jobs have a ceiling built in — you can learn them in a few days,” he told the New York Times. “Your skills for it increase rapidly, but the challenge doesn’t change, so you get bored.”

As a developer, there are always ways that you can level-up your skills and learn something new. You might want to learn a programming language, or start a code challenge based on real-world technical exams. Or, dive into a project that you can use in your professional portfolio. Not sure where to start? Take our programming personality quiz and see which languages might get you into flow state.

Catalog Home | Codecademy
If you’re not sure where to begin or what to learn next, this is a great place to start. Check out our top coding courses, Skill Paths, and Career Paths.

Related articles

4 articles