The job of a software engineer or a coder is very much coveted these days, especially in giants like Google and Facebook. If you do not have a degree in Computer Science or the like, you may be wondering what you should expect when you start learning coding.
Having taught a gamut of IT subjects and dabbled with some personal projects for a decade, I have made lots of observations about what people think learning coding entails. I definitely do not know EVERYTHING (no one does!), but I know what I need to know in order to do the appropriate research and ask the right questions to build a product through coding (and more).
Here’s one of my fun classes from 2015! I taught them object-oriented programming in Java. 🙂
I am personally an advocator of learning coding from a young age, as it builds up one’s ability to solve problems efficiently, but we will discuss it in another post. It’s never too late to learn how to program though, but we first need to clear up the misconceptions and set things straight. Here goes:
- Two-day coding bootcamps (or any coding cram course) do not work.
Are you surprised that big shot programmers and IT guys like Steve Wozniak and Bill Gates did not learn how to code in just 2 days? If you’re expecting to build a revolutionary app after attending a 2-day course without prior knowledge, you need to change your expectations. This could probably work if you are building a simple game that does not store much data. However, building an app requires knowledge of different aspects of a system, not just picking up a programming language; we need to consider stuff like front-end design, database, network, security etc etc. You get the drift. This is why we need 3 to 4 years to get a computer science degree.
So if you see a course promising that you will master app creation within a weekend, perhaps you could have them speak to me. Just kidding. Just watch out for such gimmicks, and/or speak to them about your expectations and whether they can fulfil them with their crash course.
- Learning a programming language is just one aspect of coding.
Adding on to my point above, understanding what goes behind the scenes is essential for you to build an app. For example, suppose you want to build a game like Candy Crush on a mobile app. Besides using a programming language to carve out the logic behind the game, you will need to handle graphics design, using the device memory efficiently and not create memory leaks, storing players’ scores and progress in a database, user data security (hackers are so scary these days!), what to store locally in the device and in the server, large numbers of concurrent connections to the server, etc. Also to prevent such things from happening. Does seem overwhelming, doesn’t it?
This is not to scare anyone off learning IT. Instead, one should be encouraged to know that one single app can create job opportunities for different types of experts, even within the same field. Writing an app like Candy Crush all by yourself is still possible though! Check out these games developed by just one person!
- You should never blindly copy and paste code.
Ok well, so I’m feeling kind of conflicted. On one hand, having such an advanced Internet (as opposed to 20 years ago) is a blessing for many of us doing research. So much information at our fingertips. However, it can also make one lazy. Back when we did not have such awesome search engines like Google, researching for anything involved hours spent in the library, looking through the index to find what we need to know.
Apply that to coding, and we have many people copying and pasting directly from forums like stackoverflow.com. I’m not against the creator of the forum or even the forum itself; it is an awesome source of information where many coders share their knowledge with others who are learning. However, inexperienced coders tend to assume that any approved solution is a good solution, so they simply copy and paste into their programs. You’re going to ask, why is that bad? I’ll tell you why. Some codes are outdated or may pose security risks to your programs. Check out this programmer’s gripe on bad code being propagated in StackOverflow. He makes excellent points on why code should not be copied and pasted just like that.
Besides posing security risks, I often encounter students who blindly copy and paste codes from code samples given in class, without understanding how they work. Students who tended to do that would usually score worse in their exams, because once the problem changes, they find that they are unable to apply the same concepts on a slightly different scenario. Learning how to code is an art!
- Just because your code works, doesn’t mean it is good code.
Sometimes I have the most stubborn students. When they try to verify with me that their codes work, but I try to correct them on code efficiency, they refuse to make the necessary changes, because “it already works”. That’s a dangerous mindset to have about any program, and a poor attitude to say the least. The complacency!
Anyways, there are usually several ways to write code to solve a single problem. Sometimes, each solution is just as good as the next. However, most of the time, there is “the best” code. I will discuss what makes a piece of code good in a separate post because there are many things to consider, but I will talk about code efficiency here.
What is “code efficiency”, you may ask. Essentially, when my code can use as little time and memory as possible to complete a task on average, it is considered efficient. So no bragging rights for you if your code takes one week to solve a problem, when a faster solution exists.
- Testing is important, please cover all test cases.
I find it surprising that many people do not test their programs thoroughly after crafting them. Just because it works for a few obvious test cases, it doesn’t mean that it will work for all. Many of my students do not have the patience to test their codes with different types of input, thinking that as long as their code works for “some” input, it should be correct.
When we learn how to code, we also have to learn how to identify test cases to ensure that our codes are 100% correct. Or for bigger projects, close to 100% (that’s why we have bug fixes). Just like how we test if a new bridge works for all kinds of vehicles, weather and weight limit, we also need to perform a stress test for our program.
- Please do not “memorise code”!
I don’t understand how anyone can expect to master code by memorising it. This clearly will not scale in the long run, because the range of problems any coder will face are far too wide; it is impossible to have a memorised solution for each problem. My students who memorised their codes also tended to fare badly during their exams, which is not surprising. The problems they encounter in class will definitely not appear in their exams.
So a tip for any coder-to-be: Understand the concepts and put them into practice! That’s the best way to learn.
- You don’t have to be good at math to be good at coding.
But if you are good at math, there’s a higher chance you will master it fairly quickly. I personally know of a few excellent programmers who failed math in school. Perhaps it’s due to the way math is taught in Singapore. But if you are good at math and enjoy problem-solving, coding is for you! Coding involves tapping into your problem solving skills, using logic and organised steps.
- Start with a flexible and “easy” programming language like Python.
Well, I know there are two camps when it comes to a programming language like Python. I personally advocate it as the way it is structured makes it easy for beginners to pick it up more quickly. It also encourages good coding habits from the start, like forced indentation to improve readability. (The other camp doesn’t like Python because the indentation may get messed up from one editor (or IDE) to another. But these days, IDEs are designed pretty well to handle indentation issues.)
Python is also very diverse; it can be used for web programming (creating websites but server backend), scripting, object-oriented programming etc etc. Yup, lots of mumbo jumbo here, but you will get used to these terms very soon once you start on your learning journey.
The list is definitely not exhaustive, but these are the least anyone interested to learn coding should be aware of. But I definitely encourage kids to start learning problem solving skills at a younger age with the way our world is evolving! 🙂
(This post is co-posted on Our Little Casa!)