***Check out our Pong Video and Code!***
***Learn to program and prototype with Arduino now! Join our membership.***
***Get the code, transcript, challenges, etc for this lesson on our website***
***We designed this circuit board for beginners!***
Kit-On-A-Shield:
FOLLOW US ELSEWHERE
---------------------------------------------------
Facebook:
Twitter:
Website:
________________________________
Now, it might come as a shocker to some folks but the more you learn how to program, the more code you end up reading than actually writing. I mean, you could be reading code in a library that you want to use, or you could be reading a teammate’s code, or reading code that you wrote that you totally forgot about, whatever the case, reading code is a fundamental part of being a programmer. The better you can read and digest code, the more capable you’ll be to be able to talk about that code with someone else or modify and use that code for your own purposes. In this lesson, we’re gonna cover strategies for helping you read code that you may not have written. Stay tuned. Well before we dive in, I’d really appreciate if you could take a moment and click that subscribe button. It doesn’t cost you but a click but it really helps us grow our YouTube channel and bring you great content like this. So let’s cut straight to the chase. Reading other people’s code can be hard, even if it’s well written code. I mean, it’s pretty tough just to code something yourself. Trying to figure out what other people wrote is sometimes even more daunting. Worse yet is when you’re brand new to programming, then it feels like you’re reading ancient Sanskrit. So let’s talk about a couple strategies to hopefully make this easier for you. So let’s start with some actual code. This code right here is from our Pong video game project. If you haven’t seen that video, you should check it out. It’s pretty cool. This code that you see here was written by Steve, one of the technical writers and contributors at Programming Electronics Academy. He did this project just for fun and like I said, it’s pretty cool. All in all, we’re looking at just over 400 lines of code. That’s everything, spaces and comments, but you know, it feels like a lot and if I’m being honest big pieces of code always intimidate me. I think to myself like, “Man, this is too complex “for some guy like me to understand,“ because I am no wiz. You know what I’m saying? So the first thing I try to do when reading other people’s code is to set reasonable expectations. I should expect that it will be hard to read and understand code and that it’s gonna take me a bit of time. If I think in my head that I’ll just be able to pop in and understand some code from top to bottom in no time flat, I am kidding myself and I’m really just setting myself up to be frustrated. I mean, maybe some folks are wiz kids, they can read code super fast, understand it all. That is just not me. So I just try to keep it real. The other expectation I have is that there are going to be things that I should know that I will forget. For example, I should know how to write code for a rotary encoder. I’ve written code for rotary encoders. I’ve studied code for rotary encoders. But in many cases my memory is like a broken fishnet. It seems like everything I learn tries to escape out the back door. So I could sit around and kind of cry about that, or I just recognize that, “Hey, this is a feature of my brain, I just deal with it.“ So anytime that I’m looking at some code, if I forget something that I know I should know I don’t beat myself up about it. I just look it up. Hey, that’s life. So what’s the moral of the story here? This is it. You are setting yourself up for disappointment if you think you’ll be able to understand a complex piece of code without exerting some effort and trying to understand it. So when you start reading some code and you feel confused, hey, that’s just a normal part of reading code. It’s nothing to get worked up about. So once I remind myself of some reasonable expectations, the next thing I do is try and anticipate what I might find in the code. So most software developers will spend time thinking about the code they’re going to write before they actually write the code. Thinking and planning what you’re going to do is an important part of software development.
CONTINUED...
***About Us:***
This Arduino lesson was created by Programming Electronics Academy. We are an online education company who seeks to help people learn about electronics and programming through the ubiquitous Arduino development board.
***We have no affiliation whatsoever with Arduino LLC, other than we think they are cool.***
1 view
246
80
4 months ago 00:00:00 1
LE GRAND RETOUR DE NATACHA REY : SA SANTÉ, L’AFFAIRE JEAN-MICHEL TROGNEUX, ON FAIT LE POINT | GPTV
4 months ago 00:58:43 1
Jacques Baud : Western sanctions against Russia are creating news alliances between the “bad guys”
4 months ago 01:00:38 1
UN PRINCE GILET JAUNE AU SERVICE DU PEUPLE FRANÇAIS | DE BOURBON-PARME DESCENDANT DE LOUIS XIV |GPTV
4 months ago 01:16:52 1
Россию ждет триумф? Каким будет мир в 2030 году? Невероятный прогноз Гаррета Джонстона
4 months ago 00:07:45 1
I Wore Toe Spacers for 2 Years…Here’s What Happened
4 months ago 00:00:45 1
Vassal Income BUGGED, Now Vassal Steal Insane Amount of Money in Warhammer3
4 months ago 00:17:03 1
Основы биржевой торговли Лекция №194 (часть 2) / Термины рынка опционов (Put Call Греки Стратегии)
4 months ago 01:55:04 1
LE RÈGNE DE LA VIOLENCE ET DU CRIME DANS LA FRANCE DE MACRON | JÉRÔME BOURBON | GPTV
4 months ago 00:03:51 1
Наводнение в Индии прорыв 8 стратегических дамб, под водой более 2800 деревень
4 months ago 01:28:48 1
SATANISME, PÉDOCRIMINALITÉ : UNE SURVIVANTE RÉVÈLE TOUT CE QU’ELLE A SUBI | HÉLÈNE PELOSSE | GPTV
4 months ago 00:58:30 1
INCROYABLE : TRUMP ÉTAIT AU COURANT DE SA TENTATIVE D’ASSASSINAT ?! | ALEXIS COSSETTE | GPTV
4 months ago 00:43:24 1
JOE BIDEN ABANDONNE ET KAMALA HARRIS, VALIDÉE PAR ALEX SOROS, ARRIVE À LA RESCOUSSE ! | GPTV
4 months ago 00:12:45 1
The Progression of a Ski Racer from Age 2 - 16 / MY STORY
4 months ago 00:07:55 1
Seizures: Mechanisms | Clinical Neurology
4 months ago 00:07:13 1
АРКТИЧЕСКИЕ НОВОСТИ #1/ самый теплый год, новый ледокол и арктическое кафе
4 months ago 01:39:17 1
Корабельные Ранги
4 months ago 00:12:07 1
Age of Civilizations 2 ОБЗОР МОДА ZombieWorld !
4 months ago 00:05:36 1
Развитие с нуля. Лутал ивент Вулкан 1час. Пионер купил мод.
4 months ago 00:14:44 1
Стратегия создания напряженности в обществе.Работает во всем мире
4 months ago 00:01:04 1
How Dwarfs have GRUDGES to Every Faction Worldwide As Soon As Campaign Begins
4 months ago 09:43:44 1
X международный научно-экспертный форум «Примаковские чтения», 25 июня 2024 г.
4 months ago 00:02:53 1
MAFIA II FINAL CUT - Racing Demonstration Gameplay
4 months ago 00:28:14 2
Unboxing Heroes of Might and Magic III - Epic Adventures Await!