In a perfect world, you would know all that there is to know about software, but that’s not the case in reality, where you are likely to find yourself stuck many times. For instance, you cannot possibly know 100% of the syntax or implementation of a specific language. Consider learning multiple languages in your career and you would realise that, at some point, you will need to rely on the experience of others to help you out.
Programming is learning how the computer reads your codes and implements it. Therefore, programming is a skill that you can apply in any language. In this age, programmers are increasingly Googling code that they have to use in their work. But is that the right way to go about it? Let us find out.
Why Look Up Code
It’s perfectly normal to use Google, and in fact, can be a very crucial tool especially for beginners. The compiler/interpreter will tell you when you are going wrong and will usually hint at how to fix it. According to most developers, a solid understanding of the foundations of your programming languages is more important. This is because if the documentation is not enough – especially open-source ones – it is almost not useful at all. In these cases, collaborating with others and looking for niche solutions will demand good Google search abilities.
To know more about this, we interacted with Agnis Liukis, Lead software architect at Tieto and also Kaggle Grandmaster.
“From my experience – I’m using StackOverflow to search for questions which are common and specific enough so that many people have already encountered exactly the same problem and have found a good solution. Like ‘regular expression for checking email addresses’ or which python code to calculate the area of a circle, etc,” Agnis said.
According to Agnis, developers use Google or StackOverflow as much as you need to while keeping in mind the source, they only use it for complex problems and never type any code into your program unless you fully understand what it does.
“Of course I could implement those myself. But I don’t think it is an effective way, because I could spend quite a lot of time re-implementing a solution, which is already implemented by someone, and is most likely already checked and tested by many other StackOverflow users. Checked and tested by many users is a very important point here to avoid bugs,” Agnis explained.
What About Memorising Code
Programming languages are a bit like spoken languages. If you had to look everything up, you won’t be able to have a conversation. So for useful bits of code, it is helpful to memorise them. It would be best if you remembered the basic syntax, logic structures, and core functions in the language you use, as well as a couple of methods in the most used libraries, along with basic algorithms that you end up frequently using, etc.
If you are continually Googling basic syntax questions, you should think about practising problems that will help you get those skills into muscle memory. That way, you will not need to Google basic syntax questions about working with Strings, Arrays, or Loops, and only look up things you don’t know about.
According to experts, the important thing is learning and (even memorising after understanding) concepts, data structures, and algorithms. What is more, learning individual language/frameworks also allows you to work in different environments and accomplish tasks more efficiently. Modern code editors can help a lot in generating some starting/template code and showing names of available functions, this way significantly reducing the amount of information needed to memorize. But still the basic concepts and structures will have to be remembered. I would say that’s the very minimum to remember to be able to write a program.
Agnis Liukis said, “First, there are some basic things, which a programmer must know/learn/memorize regarding each programming language to use it effectively – like some basic concepts, structures, keywords. Because it would be quite slow to write a program, searching on StackOverflow questions like ‘How to write loops in Python’ or ‘How to define a variable in Python’ every time.”
The more you code, the more you memorise, and thereby, google less. The concepts are most valuable, but one can question your understanding of the idea if you cannot even memorise the basic syntax. Also, you can run into issues as a programmer if every few days you’re searching for syntax details rather than finishing your tasks. Learning a programming language is a matter of practice and habit, and so is program design, debugging skills, and many other things programmers need.
“If you want to be a good programmer. Depending on programming language, there are some known “good practices”, how to write code – these also would be necessary to memorize. A programmer might even not remember exact syntax for specific language (and use documentation/StackOverflow to find it), but he must remember that there ARE some best practices and special syntax to use for a given specific case. Because things can be written in several ways and there are cases when one way is better than the other,” according to Agnis Liukis.
Such memorisation not only increases your speed in more complex tasks, but also promotes a more thorough understanding of the basic principles.
Final Thoughts: Googling Vs Memorising Code
Googling or searching for answers on StackOverflow isn’t cheating, and it is like using a resource. We no longer live in an age where you are expected to memorise everything because it exists on the internet. Instead, it may be safe to say that those who are better at finding solutions will do better than those who have a good memory.
Coding is like practising law in that it is more about knowing the right avenue to take to find the answer, rather than memorising all the answers. Take the example of lawyers – they have tons of reference materials, but they still have the foundation to know where to look and what to look for.
Even at an advanced stage of a career, you may still refer to API documentation and search on the web for methods whose syntax/arguments you don’t’ remember fully. Being a good programmer doesn’t mean knowing every nook and crevice of every API or library; it means being able to complete the task at hand effectively and efficiently. As you become well-versed with a programming language, you will stop googling such broad issues, and begin to google things like structures and internals.
Becoming proficient in a programming language is having the core of it learned and memorised so that you can apply it and think about problems in it as quickly as an everyday spoken language. But like a spoken language, there is still a requirement for a dictionary and thesaurus from time to time. But the most important thing is learning how to learn. Any person can look up a code snippet and script, paste it into something to finish a task. Understand what a piece of code is what you’re using, and that is where the real learning comes in.
Memorising the syntax and various modules that help you write code faster is good, but it’s okay to look up things if you can’t remember how to do something. The most crucial thing to learn about programming is conceptual anyway. But, you may still find yourself Googling obscure language features, which may be true for pretty much all languages you will learn.
Instead of trying to find a forum post from another beginner, parsing your results for source code and development mailing lists is what makes the difference. The goal is to try and use web search less and only for more and more obscure and difficult things. Eventually, you will stop Googling such broad issues, and begin to look for things like structures and internals. The better you get at coding, the more specific your search becomes.
Join Our Discord Server. Be part of an engaging online community. Join Here.
Subscribe to our NewsletterGet the latest updates and relevant offers by sharing your email.
Vishal Chawla is a senior tech journalist at Analytics India Magazine and writes about AI, data analytics, cybersecurity, cloud computing, and blockchain. Vishal also hosts AIM's video podcast called Simulated Reality- featuring tech leaders, AI experts, and innovative startups of India.