By John Sonmez September 15, 2016

Learning Algorithms: Is It REALLY Necessary?

So, some of you really get stuck when it comes to learning algorithms. This might be one of the most asked questions in the programming community. Should programmers learn algorithms? Is it really necessary for a software developer, especially when it comes to doing a good job.

I know this topic divides opinions on the internet. Some programmers might say that learning algorithms will definitely make your career stand out from the crowd, while others might say that you should not invest your time in learning algorithms because it is useless.

So, where do I stand here? I actually think that learning algorithms can definitely benefit your career and this was one of the major game changes for me in my career.

Wanna know more about learning algorithms and if you should do it? Watch this video and find out!

Transcript Of The Video:

John: Hey, what’s up, John Sonmez from simpleprogrammer.com. We’re actually going to talk about programming today. Imagine that! We’re not going to talk about girls. We’re not going to talk about lifting weights. We’re not going to talk about philosophy. We’re going to talk about good old programming algorithms here. I got this question from Cohen, I believe it is. He’s from Vietnam actually and he says, “I’m a big fan of yours. I highly appreciate all of your work like your blog post, your free podcast, and your free advice on YouTube. I also have a question. I hope you can make a video answer. I’m a sophomore student in Vietnam. My major is software engineering.”

He goes on to say that he likes to build software, he creates mobile apps and stuff using some drag and drop interfaces and he wants to know, “Do I need to learn algorithms for modern programming languages?” He wants to know specifically language like C# and Java. Is it wrong for a programmer who uses drag and drop platforms to create software? He doesn’t like algorithms, doesn’t want to invest some time in this. He also created a course about object-oriented programming with C++ and published it to Udemy. I think that’s interesting without the algorithms part. More power to you.

Let me answer your question here. Do you need to learn algorithms for modern programming languages? What do I mean by algorithms? Let’s define this a little bit. Algorithms is—you can check out—I think I’ve got a blog post here on cracking the code or solving problems, breaking them down. I also have a PluralSight course. Actually let’s go to the PluralSight course. Let’s put a link here on the PluralSight job interviews course and in that I talk about algorithm. But essentially, algorithms—I’ll throw one more link up here, bam, Cracking the Coding Interview. This is a good book that talks about algorithms.

Essentially it’s this idea that sorting algorithms, solving problems, finding text, these kind of computer science problems that you have, maybe like interview questions, algorithm types of problems where you basically are going to create some algorithm and you’re going to use some kind of a data structure like a hash or let’s say a linked list or something like that to solve a problem or maybe a binary tree and you’re going to do a search algorithm or something like that so you need to know how to do this stuff in modern programming languages.

Obviously, back in the day when people were programming in assembly and started program in C and there weren’t all these libraries and a lot of this stuff wasn’t built into the language you had to know this stuff, because you had to know your bubble sort algorithm versus—and the big O notations and you had to know which thing was going to be more efficient. You need this today. We’re creating software, we’re creating mobile apps, we’re creating web apps, we really need these algorithms.

The answer is no, you don’t need them. You can get along without any algorithms but I promise you this, if you learn algorithms, and it’s not going to take you very long at all. In fact, not only is not going to take you very long but it’s going to be fun. At first it’s really painful but then it gets really fun. It becomes rewarding. It’s like doing Sudoku puzzles. I was never a big fan of Sudoku. My point is it becomes—it’s solving problems, it’s a challenge. It actually becomes really, really fun when you get into this stuff. I mean I love to—I used to love to go onto TopCoder and I would do the problems on there and it’s just a lot of fun. When I got good at algorithms I would love it when I go to a job interview and they’re like, “Hey, can you write a—how would you solve this problem if there were 5 ducks in the stew and each duck had to be scooped up but you could only use a spoon was M size in length and you had to-” I don’t know. You know what I’m saying? When they give you some kind of crazy ass problem and then you’re just like boom-boom-boom and you’re just writing on the whiteboard or you’re typing it out and you’re like, “Bam, there you go.” That’s fun. That’s awesome.

Why should you learn these things? Because one, you’re going to just kick ass at job interviews especially if you interview for Microsoft or Google. If you master algorithm that’s what they do, they give you these hard stump questions and everyone sweats about these questions and they can’t code or whiteboard, but if you come in there and you’re like, “Bam, I got it. Oh yeah, let’s just use a stack there. Oh yeah, okay, this is a classic travelling salesman problem” blah, blah, blah, bam! You’re going to have a lot more chance of getting one of those good jobs and you’re going to blow them away and you’re not going to be sweating, you’re going to have fun at interviews instead of crying into your sleeve about how cruel the interviewer was because they asked you some stupid algorithm question that you’ll never use in the real world. That’s the number 1 reason.

Number 2 is because honestly this will help you with your job. When I started learning algorithm, I started off as a programmer, didn’t really know algorithms, didn’t like algorithms, almost quit computer science completely because I was learning stupid sorting algorithms in my Java 1 class when I was in college. I was okay, I did okay, but I went and I got in to TopCoder. I did a blog post on how I got into TopCoder and I learned algorithms and I got good at them and I became like actually competing at algorithm competitions and then oh my gosh, all of a sudden it was like I put on special glasses that let me see the world in a different light and all these problems, all these places where I was like there’s no where in the real world where I’m going to use algorithms in my code, bam, it was popping up everywhere. It’s like, “Whoa! Look! Oh I recognize this. This is like a min-max problem.” Bam! All of these places I started writing really efficient, really good code because I could see the problems.

You can’t even see—you don’t even know what you don’t know. That’s one of the problems. When you have this master of algorithms and data structures and you understand that, all of a sudden you look at things in another light. This thing that would have taken you like 4 hours and you’re writing up on the whiteboard and drawing it out and writing these complex classes and stuff you instantly recognize this and you’re like, “Oh.” It takes you 10 minutes and you write the solution to it and you write this efficient algorithm. It’s beautiful and you feel good about it, and oh they’re fun, the unit tests.

Yeah, you don’t need algorithms, no, you don’t need them, but, do I recommend them? I do. I think it’s fun. I think it’s going to increase your job prospects and I think it’s going to make you a lot better of a programmer. This is some of the hard stuff—and here’s one thing, I’ll leave you one last piece advice about algorithm. It’s not that hard. It’s finite. It’s repetition. If you understand all the basic data structures and there’s not new ones that are being added, there’s only a finite number of these things. If you know stacks, lists, hashes, trees, if you know all that stuff and you know most of the basic algorithms and there’s maybe like—there’s really like 25 different types of problems or algorithms that are commonly used that will solve most of the problems, everything you can identify as breaking into one of these. You can’t see it now, it looks like there’s just all these kinds of problems, but you eventually start to—it starts to click for you. It’s not that hard. The scope is much smaller than what you think, so you could actually master this and then become an expert in algorithms.

One thing I will say is that whatever you perceive is your weakness, whatever—I did this video on do what you don’t like. You don’t like algorithms, do algorithms.

All right, so anyway, that’s it. If you have a question for me, email me at john@simpleprogrammer.com. If you would like to join the community of people who don’t like algorithms, check out the page. I’m just kidding, it’s not the community of people who don’t like algorithms, it’s a community of people who want to better themselves and better their careers and better their lives, but you could check out the patron page and support this channel, support the Simple Programmer movement and to join the community and become part of it. If you just want to watch these videos because you’re like, “Damn, that dude is buff for a programmer” subscribe to the channel. I’ll talk to you next time. Take care.

About the author

John Sonmez

John Sonmez is the founder of Simple Programmer and a life coach for software developers. He is the best selling author of the book "Soft Skills: The Software Developer's Life Manual."