Where to find time to learn functional programming?

It can be really hard to find time to learn a new language or new paradigm. How can you find the time you need? In this episode, I share 5 tips for setting yourself for success when you're learning functional programming.

Transcript

Eric Normand: Where can you find time to learn functional programming? By the end of this episode, you will have five tips to pull a learning system/learning environment together to set yourself up for success.

My name is Eric Normand. I help people thrive with functional programming.

The reason this is important is I talk to a lot of people who want to switch their careers from maybe they've been doing object-oriented programming and they want to get into functional programming.

The thing is, the older they are, the further into their careers they are, the harder it becomes. They've got more responsibilities. They're older. They have kids. They have a family. They are used to a higher salary. They don't have as much time. They don't have as much flexibility for switching.

Now, I've talked countless to people who have made the switch but it's harder. It's definitely harder. It's important because you got to start now. It's not going to get easier. No matter how old you are, it's not going to get easier.

If you're just starting out and you're just learning programming, maybe it is too early to specialize into functional programming. Just program. That's enough. But if you're already a programmer and you like what you see in functional programming, the longer you wait, the harder it's going to be.

I have five tips for how to get this set up so that you can find some time. I want to give an analogy. When people talk about starting a running habit, they want to start running, the advice is always about making it easy.

Do all the setup beforehand. You say, "I want to start running tomorrow morning." Well, they say get everything set up tonight. Get your shoes out. Put them by the door. Get your running gear. Get it ready. Set it up so that it's easy to put on.

If you are going to drink some water beforehand, get a bottle and fill it up with the water so that it's ready. Set a time when you're going to leave. OK, I'm going to leave at six o'clock before breakfast. How long are you going to run?

Make all the decisions before because, especially when you starting a new habit, you're going to have a lot of inertia. That is the same thing that you need to set up for learning functional programming.

I was lucky. I started learning functional programming...it took a lot of time. That is clear, for everyone it takes time. It's a big field. There's a lot to learn. I was lucky because I was still in school when I started.

I had plenty of time. I could do my school assignments in it. I asked my professors if it was OK. They said yes. I could choose my electives around it. It was something that I lucked out in because I found that I liked it then, early enough.

Now that I have two kids and a wife, there's just a lot of life stuff. I got a house. I don't think there is time [laughs] to learn a new skill like that. I totally sympathize even though there is. There is time. It's just about making it happen.

Here I've got five tips for getting yourself set up. The same kind of things like putting your shoes by the door the night before. It's the same kind of stuff.

The first thing is pick a language or technology. You don't want to say, "OK, I got time now to learn. What am I going to learn?" You don't want that to be the question. You want that to already be set up.

The first thing you're going to have to decide is what language are you going to use. Are you going to use a functional language that's very focused on functional programming? We're talking Haskell, Clojure, Scala, Elixir, Elm, whatever it happens to be.

You could choose one that's super functional. Just jump right into the functional side. You could also choose a different approach. Say if you are a Java programmer, you're going to focus on a small step, which is Java 8 Lambdas.

Or, if you're a JavaScript programmer, you can say, "I'm going to do functional-style JavaScript." Because JavaScript is a very paradigm-agnostic language. It has first-class functions too. People have found a lot of success doing functional programming in JavaScript.

Either choice, it's up to you. I think if you've been hesitating, it might be better to start with a smaller leap like the Java to Java 8 Lambdas, or the JavaScript to functional-style JavaScript could be a better choice.

Just a little bit more about that. I went to a meditation retreat. It was a Buddhist meditation. The teacher was talking about how you don't have to believe all of the metaphysics of Buddhism. You don't have to believe in reincarnation. You don't have to believe in any of the Buddhist dogma. What's important is you meditate. It should be practical now.

You should start to see benefits from meditation starting very quickly. You shouldn't continue if you aren't actually seeing benefits. Then he says, "Well, you got to give it two or three weeks. You can't just do it one time." His point was that Buddhist meditation is a very practical thing. You don't have to make a big leap of faith for it to have benefits. It's not a faith-based system.

That really struck a chord with me, especially since I think the same about functional programming. It should be practical from the beginning. Every technique you learn should be applicable in a non-functional language or in a non-functional context. You don't have to make a big leap of faith.

You don't have to say, "Oh, it's Haskell or nothing," or "I believe that Clojure is the best possible language." You don't have to do that. You could learn just one concept from functional programming, and that should make your programming better. Then, of course, there's more. You might want to learn the second one, then the third one. Those should all help all of your programming.

It's OK if you just stay in Java and learn how to do Java 8 streams. It's OK if you just learn how to do something in JavaScript like higher-order functions, something like that. It's just perfectly fine. I would applaud you if you did that. That was number one.

Number two is to get your system set up. Get your computer installed with whatever language or technology you need. Get your IDE set up. Make sure you can open a file. Get Clojure installed, and make sure the REPL works.

Whatever it is, get set up so that when you do have a moment, when you have some time that you've dedicated to learning, you don't have to start installing and stuff and feel like, "Oh, this is just a waste time."

You want to get that done ahead of time. Those are the kinds of things that you can do in the spaces between things like, "Oh. Let me look up the commands for installing Haskell." Then you just have them open in a tab. Then at some point you're like, "Hey, I have some time. Let me type those things in. OK. I had an error. I'll search for it, but I don't really have time to solve it now."

You can do these things gradually. The worst would be is if you cleared your schedule. You got a babysitter for the kids. You went to a coffee shop, and you bought a really expensive coffee and a big slice of cake. You're sitting down. You're all ready. You're like, "Oh, now I'm just going through error messages and stuff." You don't want to get there. You want to spend that time elsewhere.

You want to spend the time from, "Oh, I had 10 minutes after work when I was just futzing around trying to get the Haskell installed. It wasn't stressful because I just put it aside when it stopped working. I'll come back to it," whatever.

Anyway, get yourself set up so you don't have to do that in your dedicated focus time. It's not worth learning [laughs] how to set this thing up. It's not a huge, great skill to have. It's not worth that dedicated focus time.

Number three. Pick a small project. Something small, tiny. Even getting Fibonacci written, I would not say that's too small. If that's a challenge for you, that's perfect. It could be something like get a Web server running in Clojure. I can boot it up, I can hit a Hello World page, and then I can take it down.

That could be, for you, a nice size project. When I say a nice size project, it's something that you think you could do in three hours. I believe that it should be something you could do in another language. That's nice because it means you're not trying to learn too much.

If you've never done Web programming before, it might be too much to start Web programming in a new language. You're learning two things at the same time and you can't tell is this part of Clojure or is this part of the Web?

Another thing is just to help with motivation, it could be something you were going to do anyway. Like, "Oh, I was going to write this script in Python, and I kind of already know how to do it. Why don't I try writing it in Elixir instead?" Something like that where you're motivated to do it. You already have the need for it. You're going to do it anyway. Why not do it in this new language?

I want to emphasize the size really matters. You want to find something that you can achieve. If you only have two hours to do something, don't make a big project and then feel frustrated like, "I didn't get anywhere," or "I only got 10 percent of the way done but nothing to show for it."

You want it to be small. Start in small steps. You can build a huge application one step at a time. You want to know, "OK, I got something done. I learned a little thing." That's good. You don't have a lot of time. You want to achieve something.

Now, the thing is though, that small project can be part of a big project. If you say my first step is to get Clojure running, and then shut it down, you want to have another step in reserve. After I get the Web server running, I want to have it serving files from the local file system. Once I have that, now I want to get it so I'm using a CSS framework on my pages.

Little steps but have some in reserve so that if it turns out that you are really fast, and you get the Web server running really quickly, you're not going to waste the rest of the time. You already have stuff ready.

Number four. Set up your environment. We, people that is, are very good at learning. That's what we do. We tend to also have this ability to...If something is out of sight, it's out of mind. Setting up an environment for learning is something you can do to help improve your learning.

Something you could do that's pretty easy is order some books on the topic, the task, or order some Haskell books. Have those Haskell books ready, available, sitting where you put your books that if you're bored, you leaf through. If you want to go all out, you could find a chapter that you want to read and leave it open so that when you're passing by, you see it.

Other things you could do — get some cheat sheets ready, print out some tutorials. Have them ready. They don't have to be spread out on your desk but have them in the environment so that if you need them, you can just pull them down. These are all things to do to set up your environment.

Think about when someone wants to learn a foreign language. The best thing to do is to go to the country where they speak that language. You start interacting with people. It's everywhere. You're now breathing that, and so your mind is just going to pick it up.

We learn a lot just by having the stuff happening around us. Your mind starts to realize "Man, if I need to buy something, I need to learn how to understand numbers in the language, so I better start picking that up."

It learns things that you haven't consciously realized you learned. You haven't taught it. Just having stuff in your environment.

Think about what you would do in your house if you wanted to learn a foreign language. You might start labeling everything in that language. You get some Post-its and you say, "This is coffee, and in Spanish it's café." You put a little sign that says café on it. Little things like that. All those things stimulate you, help you learn. Get yourself set up like that.

Get some things to put on the wall that's the Haskell syntax. Just have it there. I'm not saying distract yourself. Those little things, every now and then when you glance at it, you'll pick up a little thing. You'll get used to the syntax, even if it's just that.

You might not pick up any particular thing that you can do, but it's starting to look familiar now. Before, it looked kind of weird. That's set up your environment.

Number five, commit to some time. I would say at least a week out. I'll talk about why in a second. Commit to some time. Say, "OK, on Saturday, from one o'clock to 4:00, one to three hours, I'm going to work on this small piece of my project." Really commit. That means make sure that you've got focus time. No one's going to interrupt you. Turn off your phones. Those kinds of things.

Just get it all so that you can concentrate. Pick a project that you can do in that time that you can achieve, so that you can have some sense of accomplishment in it. That's a win. If you get that done, no matter what else you get done, that's good enough for that amount of time.

It's really important that you have something you can focus on. When you're learning, you learn better when you are fully engaged and focused on it. You want to get it so that you can get good at it. Get good at something in that small amount of time.

The reason to set a far future — I guess that's more like near future, one week out — is because it's a trick that I like to do. Once I've committed to it, I'm like, "Oh, yeah. I'm going to get it so I can move a circle around on the screen in this three-hour block. That's good enough." Then during the week I'm looking forward to it.

I'll have a little bit of time here and there where I can do a Google search. "How do I move a circle on the screen in this language? Maybe there's a tutorial." I can just use these little pockets of three minutes here that I'm on my phone or in the supermarket waiting in line. "Oh, there is a tutorial. Let me save it. I'll print it out when I get home."

I can set up all those things to maximize my success at that time. It's all about making it easy. That's really what it is. Make it easy so that you can maximize the time that you have to focus on it.

To recap, I'll talk about the five things. One, pick a language. Two, get set up. Three, pick a small project. Four, set up your environment. Five, commit to the time.

Do yourselves a favor. Look for ways to make it easy. Even one little thing could get you to learn one more bit. What actions can you take today to get yourself set up for success?

Please do me a favor. If you like this material, please subscribe or share it with your friends. If you subscribe, there's more like this coming down the pipe and you'll be notified of it. Sharing with your friends. If you liked it, you might know someone who'll like it, too.

I also like to get into email discussions. If you've got questions like things you want answered about functional programming, about learning functional programming, please email me. Eric@lispcast.com.

Also, you can get into discussions on Twitter. Ask me questions on Twitter. I'm @ericnormand with a D. Also, on LinkedIn. I will answer your questions there. Just search for Eric Normand, and you'll find me.

I'll see you next time. Bye.