Archive

Missing logic in life? Learn programming

June 5, 2020   ·   3 Comments

By Hemant Sangwan

Programming is an art of writing a set of instructions (or codes) that computers can understand and perform certain tasks.

For example, if the car you drive has an automatic climate control, then it is based on a set of instructions given to the car computer which could be similar to, for example, “if outside temperature is above 22C→ run AC; if between 7-22C → run mild heating, and below 7C , run intense heating”. 

But why should you care to learn programming, unless you are a computer professional or an engineer, or working in a related field? The short answer – you can use programming skills to make your day-to-day life easier. For example, you can organize your small business activities better or automate some of the processes; parents can use it for better organizing household activities, teaching kids, etc. Programming can be used for simpler tasks and not just limited to designing video games, apps, or fancy and cool stuff you see in movies. 

Programming makes you creative and improves your critical thinking. You also learn the ability to find gaps in a set of arguments, to balance competing objectives in decision-making, and to look for multiple solutions to a given problem, as opposed to solutions on the top of your mind. These are some of the “high-demand” skills in the job market – for now and in the future. Overall, programming can turn you into a better decision maker in personal, social, and professional life.  How? 

In programming, giving instructions to computers is no different, in many ways, from how you activate your brain to perform a variety of simple to complex tasks. For example, suppose you have to find the sum of numbers 1 to 4, i.e., 1+2+3+4 = 10, which you can do quickly. Now think consciously the steps your brain took to perform this task or how would you explain it to someone who is new to adding numbers

The instructions could be 

Step 1: add the first 2 numbers and collect their sum, i.e.,  1+2=3 

Step 2: add the next number to the sum from step 1, i.e.,   3+3=6

Step 3: add the next number to the sum from step 2 i.e.,    6+4=10 

Step 4: check if there are more numbers to be added. If not, the final answer is the sum from step 3

In steps 1-4, what you wrote is a simple program to add numbers 1-4 and writing programs in a computer language is no different. All you need is a computer with a few software which can be easily (and legally) downloaded from the internet FREE. In addition, of course, you need familiarity with the language in which you are writing codes. 

In the code above, you would notice that we first broke down the task into smaller steps or chunks and wrote instructions for each “chunk” in a way which was explicit and consistent, and instructions across “chunks” were logically connected. Why? This is because computers do not have brains and cannot understand what we imply when interpreting codes.  Computers do what we ask them to do, not what we imply or “kind of” suggest to them. If the only thing specified to the car computer is “if outside temperature is above 22C→ run AC”, the heat will not turn on if the temperature falls below 22C. This is because the computer does not have instructions for temperature below 22C and it certainly cannot sense your discomfort in cold. 

The approach to “breaking down” and “connecting” the chunks in an explicit and consistent manner is fundamental to the programming and the one that helps you in sharpening skills as highlighted above.  

You may be wondering who is or can be eligible to learn programming? Everyone! Initially, it could be overwhelming as you try to set up a learning environment and those hurdles are similar to the initial challenges you encountered while learning baking, biking, music, or any other skill. There are great resources available on programming, FREE, in many formats (videos, books, blogs, software, etc.), and at all levels – beginners to advanced, from kids as young as 4-6 years old to computer professionals. 

Remember, you learn biking, baking, music not necessarily because you want to compete in the Olympics or professionally, the same goes with programming – learn it to improve your overall digital literacy, to have fun, and to add logic to your life!

Hemant Sangwan is a full-time professor at School of Marketing, Seneca College.


Readers Comments (3)

  1. Yashna says:

    A refreshing take on programming!

     Reply
  2. Bhuwan says:

    Prof. Sangwan, Thank you for your crisp, Simple, and to-the-point explanation.

     Reply
    • Fabiana Sciolla says:

      Thank you for this interesting and encouraging article!

       Reply




Please note: Comment moderation is enabled and may delay your comment. There is no need to resubmit your comment.