Programming Logic: How To Get Better At It?

Written By John Sonmez

“The term programming logic has its roots in the advancement of computer science. Programming logic started only with ‘hard and fast logic' compiled into sophisticated algorithms and expressed in programming languages like Prolog.

Basic computers developed ways to deal with numbers and logical states, applying specific operators that lead to precise results.”
(Source: https://www.techopedia.com/definition/3945/programming-logic)

In this video, I've received a question from a reader asking how he could become better at programming logic and this is kind of a recurrent question I get almost every day.

So, how do you get better at programming logic? Watch this video and find out!

Transcript Of The Video

John Sonmez: Hey, what's up John Sonmez from simpleprogrammer.com, and today I got a video for you on how to get better at programming logic. I don't know if this means programming logic or programming logic, either way.

Obviously you didn't watch my video on not to learn C, and how do I learn C … Just kidding, that's C++. And he says, “But, whenever I went to a new instruction or instructor, he tells me the language can be learned by anyone, but the logic is where you have to focus.” Okay. “So, can you tell me how to get better at programming logic? Thank you very much.”

So, one of the things that your instructor is talking about is that anyone can learn a language, anyone can learn how to write code and understand the syntax of a language. But, what's difficult and what the real skill is, is how can you use that language? What is the logic that you can create with that? I called this algorithm's, I've done quite a few videos on algorithms. If you're interested on learning algorithms and getting better at those, check out this playlist here on programming algorithms; on whether you need to learn algorithms, how to learn them, cracking the coding interview, all of that stuff.

But, I wanna talk … I wanna go a little bit meta here and talk in the bigger sense about what it means to be good at programming logic, or how to learn that. Basically, when you learn a programming language what a lot of people do is they try to study the syntax, they try to go through the reference manual and understand all of the examples, and what all the commands do and understand the syntax. And it's a very, very difficult way to learn.

I'll give you a little bit of a story, a little bit of an example here. So, I used to play it I'll admit it, and this was … You know what, this was one of the most fun things that I ever did in my life. Actually, I was just reflecting on this, so I was like, “Man, you know, what is the most fun time I ever had in my life?” I think it was honestly playing Magic The Gathering Tournaments. I really think so, it was just so much fun just collecting the cards and going through … Yeah. Yeah, I know I'm a bit of a geek. All right.

But, I'm a Software Developer so … Even though I got biceps. Here's the thing, okay, when I played Magic The Gathering I memorize so many cards, I knew exactly what these cards did. I memorize the mechanics of the game, I had all of this information in my head, and just a ridiculous amount of information. It was not … I didn't sit down and try to memorize these cards, and what they did, and what their attributes were. Okay. I just automatically got all that stuff just from playing the game, and from obsessing over over this game. Honestly, I was obsessing about it.

So, my point is this that's why I'm saying this, is that if I had tried, if I had tried to memorize magic cards, man, that would have been a grueling headache. If I said, “Okay, I wanna be a good magic player. So what I'm gonna do is I'm gonna memorize all the magic cards. Let's just start drilling this into my brain, and then when I have them all memorized, then they'll have a big arsenal of tools that I can use to play this card game.” And it doesn't work that way, okay.

But, that's what a lot of people try to do with programming is, they try to say, “Okay, I'm gonna learn this language, once I learn the language and I know the ins and outs of the language, then I can use the language and then I can use that tool.” And see it's the wrong way because you gotta play, you gotta have fun that's how you learn best. We always learn best by having fun by playing.

And so if you want to … If I wanted to learn the magic cards, I didn't even have to try. What I had to do was I had to do something with them, I had to play the game. So, if you wanna learn programming, if you wanna learn the language better how to use it, the logic of it, you gotta use it. You gotta use it in the application of solving something. I talk about this all the time, if you've ever heard me talk about how to learn things and how to learn effectively.

In fact, in my course on 10 Steps To Learn Anything Quickly; If you haven't checked that out, you might wanna check that out. I talk about this a lot, this idea that you gotta play and you always have to … Whenever you are learning something, this is just critical. It needs to be, “I want to learn X so I can do Y.” So, you gotta try, you gotta put it in the action, you gotta do Y. We learn best that way, it's a learning myth to say that some of us are auditory, some of us are visual, and some of us are kinesthetic learners, bet you didn't know I was gonna pull that word out of my ass; kinesthetic.

But, what it mean is that it's a myth, there's no learning styles, we all learn best by doing. And so if you wanna learn programming logic … Okay, if you wanna learn to become a better programmer, if you wanna really learn a programming language, don't learn the syntax. Don't just go through the reference manual, don't just do some minor exercises. Instead, pick some kind of thing that you're gonna build, pick some kind of application, a small project; start with small and build it.

And then say, “Oh, I, I …” You've skimmed through their reference manual, you've gone through … You can go through my 10 steps program if you really want the in depth steps. What I'm giving you is the short of it, which is basically you go and you say, “Huh, I need to lay a brick right here. Damn, I needed a tool to do that, what kinda tool?” So, then you'd go and you look up, “Oh. Oh, I see, I need a loop. I could do a loop. Hm, how about a For Loop?”

And then you place the For Loop in there, and you travel it over, and you're like, “Oh shit, that works.” And now you understand how a For Loop works, you've got the understanding. We've actually develop the sense of using that language, that's the logic that you're after, that's learning the programming logic.

That's so much different than saying, “I'm gonna study For Loops, and I'm gonna study Do While Loops, and I'm gonna study all this stuff, and then hopefully I'll remember this stuff so I can apply it when I need to use it.” And instead you go and you say, “How can … I need to use this stuff first and let me go get the stuff.” And that's how it works, it does the same thing as learning the magic cards from playing the game versus trying to memorize the cards.

So, if you wanna get good, if you wanna learn programming logic, pick some small applications, do little projects, do them, use the language, use the features and that's gonna force you. You're gonna have to write the logic to do that, but it'll be for a purpose. If you just do drills, and you just do the exercises … Not that that doesn't help you, deliberate practice is a good thing. But, for the basic understanding, getting the logic, getting the learning, and really learning something, understanding something, there's a difference between learning and understanding.

But to understand something, you have to use it in action where it's applicable. So, create a project, do something that's gonna require you to have that skill, then utilize that skill and, bam, then it goes into that understanding place. Okay. By the way, if you wanna get one of these T-shirts, I'm gonna start telling you about this now that they're on sale.

I'll talk to you next time, take care.