DEV Community

Cover image for The Subtle Art Of Programming.
Roosevelt Innocent
Roosevelt Innocent

Posted on • Originally published at Medium

The Subtle Art Of Programming.

Learning to program.

Learning to program defines two important things, which are learning a new language, and learning to solve problems with that language. This means writing functional code and describing your solution to that problem. Let me go deeper into this.

This post you’re reading right now is made up of text. When I was writing I used English to come up with adequate explanations to a problem “How can someone best understand and learn how to program?”

Reading this text you also use the English language. if you think what you are doing right now, you will notice that you do not think about English as a language at all, right? instead what you are doing is using the language in order to figure out what I am talking about, and what that might mean to you.

Try to remember when you last walked up the stairs. Walking up the stairs was a pretty complex series of movements, and it took you quite a while to properly learn it as a child. The exact order and coordination of movements, bending your knees, ankles, while keeping your overall balance, is so complex that we probably wouldn’t even be able to describe it properly. However, we have somehow managed to learn this ability and we can now use it.

The point I am trying to make here is: When you last walked up the stairs you were thinking about all sorts of things. Maybe you were on the phone with someone, searching for your phone in your pockets, and thinking about looking for a nice introduction to programming online … maybe you did all of these at the same time. Whatever it was, you did not think about how exactly to bend your knees and ankles while trying to maintain your balance and get up to the next step.

Programming is very much the same, As programmers, while we program, we do not think about the programming language, and how to use it. instead we simply just use it. and meanwhile think about very different things, such as the problem we are trying to solve, how we can make things easier for fellow programmers, and how to best suit the needs of our users, or customers, and so on.

when I started learning how to program I first learned about the basic concepts of the programming language. And sometimes I felt so overwhelmed and wondered how programmers will be able to remember all this stuff. The trick is: you don’t, consciously. Instead, you will have to assimilate these concepts so much that you are able to simply use them, without consciously remembering or thinking about them. Just like we use English, or our ability to walk up the stairs.

that’s why learning a programming language, just like any other language, or skill, is a lot about repetition: you basically brainwash yourself into being able to form meaningful “sentences” (code) without having to think about the concepts that you are using.

Over time, while you repeat basic concepts of a programming language over and over again (by way of doing exercises and writing code) you will notice that things become very natural, and this probably will happen much quicker than you think.

At first, you will not understand almost anything. It’ll be weird, just like with learning any human language. You will struggle with words, and not know what symbols are what, and it’ll all be very confusing. Then one day BANG your brain will snap and you will suddenly “get it.” If you keep doing the exercises and keep trying to understand them, you will get it.

The feel of creation

we bring things to life when we program.

programming feels like creation. In my own words whenever I run a program, a little miniverse is created. things come to life and interact with each other, according to the rules that you, as the programmer creator, define.

Imagine you build an application like WhatsApp or twitter. Then as a developer, in the programming language of your choice, you would say things like “let there be users! And let there be tweets!”, and once your application starts, these things will come into existence. Next, you would go ahead and define “Users can create tweets, and they can follow each other”. And from now on, every time new users are created in the little miniverse that is your application, these users will have the ability to tweet and follow each other.

How we learn things

different people, different methods.

How we learn things

Different people learn things differently.

sometimes we compare ourselves to other successful programmers and feel we are no good at all to learn or be a successful programmer. if you feel this way then you need to figure out the right way to understand things.

  • Some people like to listen to lectures or read books that thoroughly explain concepts before they then start exercising and experiment with what they just learned.

  • Some like to get their hands dirty and play with code until it does what they want.

  • Some want to fully understand what a certain line of code does, and why.

  • Some don’t care that much about the details and want their code to produce the right things instead. they might memorize what worked, and understand things more fully later.

  • Some understand concepts in logical ways and go precisely by their definitions.

  • Some understand things better by coming up with good analogies and metaphors. And yet to simply memorize things and how they get used.

For me, my categories fall on the last bullet, I come up with analogies and metaphors to simply memorize things and how they get used. But does this list defines everyone character in learning? No, it doesn’t.

Therefore there is no one true path or one size fits all approach to learning programming. Try different things, and pay attention to what works well for you, What is the most fun for you, and keeps you motivated.

If you find it hard to keep motivated working through a certain online tutorial, or if you have a hard time fully understanding what an exercise is about, then try to pick a different approach, or talk to someone around you, tweet that problem or better still fight with it until you get the problem solved, not everyone will tell you that but I will, because it’s also an approach, I used it most times, because sometimes the always suggested approach might not work, you might repeatedly not get feedback from people you ask questions, but just try to figure out the best approach that suits your learning curve.

Also, consider joining local programming events, like meetups, hack days, or a conference once in a while. That gives you a broader perspective, even if you might not be able to fully understand everything all the time.

If you can’t put a lot of time into learning programming, then consider spending at least a few minutes on it every day. For example, every morning, before you leave the house, take about 10 minutes to read a page in a programming book, review an exercise, or read some code. Or spend some time with it on the taxi on your way home from work later.

This will keep your subconscious mind busy with programming concepts, and help you pick things up more easily later.

Pattern recognition

Pattern recognition
how our brain works with patterns

The ability of our brain to help us recognize things subconsciously, from just glancing through things.

Imagine you are walking on the road, and there’s a car coming at your back. Even if you only see the car from the corner of your eye your brain will immediately process this information and even assign a meaning to it. You’ll start paying attention and maybe walk slowly immediately.

Often times when you search for something online and look at a couple of websites, your brain will help you recognize things that you are looking for without consciously thinking about the structure of the site.

In the same way, as a programmer, when you look at your code, you will immediately recognize some of its structure and thereby understand it, without reading it thoroughly. This allows you to grasp the overall picture of what you’re looking at, and quickly find something that you’re looking for, in other to then read this particular part of the code more carefully.

As you can imagine, in order for this kind of pattern recognition to kick in, your code needs to be formatted consistently and carefully.

Because of how pattern recognition works, as a programmer, whenever there’s a small issue with the formatting of some code, you will immediately notice it, and distract yourself from other thoughts. You’ll need to re-focus on what you were trying to accomplish, and whenever you come back to the code it will distract you again.

Error messages

reading error messages

reading error messages

As programmers, we want to build things that work. When we do exercises we want to figure out the solution to the given problem. Seeing error messages, therefore, has a negative connotation to it: we haven’t managed to get it right! Right?

Well, yes. But also, no. Errors can also indicate progress. Often error messages indicate that we’ve done the right first step, and now have to figure out the right next step.

Whenever you find an error message printed on your browser console, don’t fret. Instead, appreciate it. Read it carefully. the language error is trying to give you a hand and help. Normally an error message tells you exactly what went wrong in your code, and where. Once you’ve understood what has happened to look at your code and try to understand why it happened, and how you might fix it.

Often, when you fix one thing, you’ll get a different error message. That’s progress. Rinse and repeat until your code does what you want.

If you do not understand an error message and you have the opportunity to ask someone else, then do so. You’ll get better and better at reading error messages over time. And you’ll become friends with them.

Read the full article

Conclusion

being a programmer? Don’t forget that it’s not enough to simply learn how to program you will also solve problems with it.

Okay buckle up and get ready for the adventure, if you feel it’s what you really want to do, keep your head up and keep programming every day, you’ll be better in no time.
Follow me on Twitter :)

Top comments (1)

Collapse
 
abdurrahmaanj profile image
Abdur-Rahmaan Janhangeer

Add tags to article