avatarAlexandros Roumpos

Free AI web copilot to create summaries, insights and extended knowledge, download it at here

1348

Abstract

does it do. The good is that reading all the comments of the code, after an hour I was able to figure out what it does.</p><p id="083c">Every programmer knows that the compiler doesn’t care about your intentions, it follows some rules and interprets what you have written to actions. That’s the reason I advise you to even comment on simple lines of code where you assign a variable. You should comment on what this variable is about and why you gave her a specific value.</p><p id="7151">That will keep you out of trouble in the future. Believe me, I was where you are and it worth the time you invest to comment on your code. Imagine that you are writing a program for Arduino to control when a generator should start and the program to control the ignition of the petroleum engine. (That is the program I was looking after a year and I mentioned before )</p><figure id="1e50"><img src="https://cdn-images-1.readmedium.com/v2/resize:fit:800/1*u6g-hqskuLdkK85x8kDyaQ.jpeg"><figcaption>My code for Arduino</figcaption></figure><p id="b7db">It is a program that has more than 30 variables. When you are writing it you know exactly what each of the variables is doing, but after a while, it is not humanly possible to remember it. Take in mind that the code is more than 700 lines, which makes it harder to find out what each variable is about.</p><

Options

p id="bade">So my slogan is:” Comment now, make your future life easier “.</p><div id="bc51" class="link-block"> <a href="https://readmedium.com/want-to-be-a-millionaire-5ea3b3d743e9"> <div> <div> <h2>Want to be a millionaire</h2> <div><h3>Here’s is the hard truth.</h3></div> <div><p>medium.com</p></div> </div> <div> <div style="background-image: url(https://miro.readmedium.com/v2/resize:fit:320/1*XofmVhoBtheCM9b_I2iH-w.jpeg)"></div> </div> </div> </a> </div><div id="f5aa" class="link-block"> <a href="https://readmedium.com/if-you-are-still-using-booking-com-you-live-in-the-past-ae817567499c"> <div> <div> <h2>If You Are Still Using Booking.Com, You Live in the Past.</h2> <div><h3>A game-changer in the travel industry has arrived to make your travel experience better and cheaper.</h3></div> <div><p>medium.com</p></div> </div> <div> <div style="background-image: url(https://miro.readmedium.com/v2/resize:fit:320/1*OLFGj6fRLvmxf8p2Wo_ezw.jpeg)"></div> </div> </div> </a> </div></article></body>

Programming Advice for Anyone.

The most important and simple advice to follow to make your future life easier.

Arduino and development board, photo by author.

What is the most common and basic advice that I could give to a new programmer, even if he couldn’t write more than a couple of lines of code? What is the mistake that even experienced programmers are doing? It isn’t that they are making a terrible mistake about the syntax OR the semantics of there programming language.

It is that they don’t comment on every single line of code they write. So, sincerely speaking, my advice is: “ comment any single line of code explaining what it does”

Why is it so important? Believe it or not your brain and your memory will fool you. If you return to your code after a semester you will not remember what it does. If you have a look at your own program after a year you will not recognize that you have written it.

That happened to me. The funny thing is that I wrote a program for Arduino and even if I have commented it, my first reaction was thinking who the heck has written it and what does it do. The good is that reading all the comments of the code, after an hour I was able to figure out what it does.

Every programmer knows that the compiler doesn’t care about your intentions, it follows some rules and interprets what you have written to actions. That’s the reason I advise you to even comment on simple lines of code where you assign a variable. You should comment on what this variable is about and why you gave her a specific value.

That will keep you out of trouble in the future. Believe me, I was where you are and it worth the time you invest to comment on your code. Imagine that you are writing a program for Arduino to control when a generator should start and the program to control the ignition of the petroleum engine. (That is the program I was looking after a year and I mentioned before )

My code for Arduino

It is a program that has more than 30 variables. When you are writing it you know exactly what each of the variables is doing, but after a while, it is not humanly possible to remember it. Take in mind that the code is more than 700 lines, which makes it harder to find out what each variable is about.

So my slogan is:” Comment now, make your future life easier “.

Programming
Software Development
Software
Productivity
Arduino
Recommended from ReadMedium