Skip to main content

How To Think Like a Programmer?

Programming….is it really hard? is it really scary? is it really not everyone’s cup of tea?

You might be asking several questions to yourself before stepping into the programming world. You might be also getting scared when you listen to a lot of jargon words which programmers exchange with each other to communicate about software. Every beginner who enters programming faces the same problem…difficulty while solving the coding question, difficulty in getting the logic of the code…difficulty in approaching a problem, and getting the solution.

When other programmers are good at solving the questions, good at implementing the logic of complex software, and good at building the features of any software most of the beginners start doubting their abilities.


In most cases when beginners start getting frustrated, either they give up on programming or they try to find the solution of a single question “How to think like a programmer and solve coding question quickly?“. You might have received a lot of advice from professionals, you might have read several articles and blogs and you might have followed some tips as well. All this advice written in blogs and given by professionals making you more confused because you are still unable to find out a common hack that every programmer is using while solving the coding questions quickly. So what is the common approach every programmer follows to solve the coding questions to become good at problem-solving skills? In short, here is the answer…

A Common Hack Used By All The Programmers To Build Problem-Solving Skill


You can only solve the problems quickly if you’ve already solved the problem / seen the problem solved before. The challenge is, therefore, ensuring you’ve seen every problem before. Now, this doesn’t mean that you need to have seen every problem before, as that is impossible. In these cases, you have to be able to identify patterns in programming challenges. This comes from ensuring you understand the solutions of a variety of problems deeply so that you can identify when two problems are similar and you can use the principles behind the solution of the solved problem to solve the unsolved problem.
People who are beginners in programming they should firstly start understanding a bunch of core algorithms and data structures. Read the solutions to some more problems until patterns start to become visible to you. Then, you should practice challenges online until you’re fast. In programming solve a lot of problems, and the more you solve, the more you will see patterns from old problems in new ones you are solving, and you will get better over time.
                    Three Things To Keep In Mind While Building a Software

What do you see?? a puzzle…How are you going to solve this puzzle…? Well, this puzzle is divided into smaller chunks, and to find out the complete solution most of the people follow three steps…
  1. Try a solution.
  2. If that doesn’t work, try another one.
  3. If that doesn’t work, repeat step 2 until you get the solution.
Remember that initially, as a programmer you have to face problems most of the time in a block of the program, and you have to fix it doing permutation and combination. If you are a fresher you will feel less interest in resolving bugs/issues because it will take more time to resolve. This time you need to have patience instead of giving up on programming. There is no substitute for deliberate practice. You need to evaluate the problems from different angles. There is a famous quote which most of the programmers have heard before…
“Everyone in this country should learn to program a computer because it teaches you to think.”
— Steve Jobs
Do you understand the real meaning of the quote….??? What exactly it means to think like a programmer??
We are going to explain here and if you understand it then probably you will understand the real meaning of what programming is in reality…
When you encounter a problem…read it carefully. Read the expected outcome. Then think about what steps are necessary to solve that problem. Resist the temptation to go in and blindly try things. Instead, step back and think about what you’re doing. Slow typist is always better programmers why…?? because instead of jumping into the solution quickly and using their hit and trial method they think a whole lot about what needs to be done, then they do it. Now you might have sensed the deep meaning of Steve Jobs’s famous quote.
Now we are going to discuss three major steps that every programmer should follow in industries while building software and becoming a good programmer.
Make it work, make it right, make it fast.
-Kent Beck

1. Make it Work

When you encounter a problem the first step is to make it work. The goal here is only to understand the problem and find solutions. Nothing more. You might be thinking that your program should be also correct and optimal one but doing premature optimization is always a foolish idea. You will end up getting nightmares of your code. Remember that a good solution has to evolve and become better over time… start with just “any” solution.
You can make the code do what it’s supposed to do in whatever ugly, messy manner you want, so long as it works. We are talking about software and there is no cost of materials so instead of trying to find a perfect solution in your first attempt, only find the solution that makes the feature work in your software. Don’t waste your time worrying about whether your approach is ideal, your code elegant, or your design patterns perfect. If you think that there are multiple solutions and you are unable to find the best one then pick one and go with it. Once you’re done make sure it works and works repeatably.

2. Make it Right

From the first step, you have a working solution for your problem and an inexpensive way to ensure it remains working while you modify it. Now your job is to follow the refactoring fundamentals to improve your code’s design. Follow the software principle, check if any design patterns might make your solution more conventional. Refactor; Deduplicate code, clarify interfaces, sole responsibility, SOLID, etc. While doing this make sure that you or somebody else understand and make changes in it without much effort. It becomes easier for you and for other developers to maintain your code.

3. Make it Fast

Now you need to measure the performance of your code which is the third step…code optimization. Well, this is the hardest step in programming but If there are any obvious performance bottlenecks with easy solutions, implement them now. A lot of companies just release the solution to production that works from the ‘make it right’ stage. It’s highly recommended that if you have enough resources and time then always think about the performance of your code. Code optimization is not just about “how can I get this code to run faster”. But it is more than that. Your code should take less time and it should use fewer resources. You should be thinking about how can I make it more testable, how can I make it more extensible, how can I make this code more valuable to the user.

Comments

Popular posts from this blog

VS Code, Installation and Complete Setup

Let`s Install VS Code: Which is the best source code editor available right now? Without no doubt, we can say that it’s Visual Studio code or simply VS code. VS code is an open-source code editor developed by Microsoft. It has built-in support for C++, JavaScript, Node.js and almost all programing language-based plugins are available in VS studio right now.Let`s install the stable version of VS code on our Windows system: Steps: VS code setup file can be downloaded from the official website. Link is given- https://code.visualstudio.com/ . After opening the website, click on the Download for Windows button.This will download the VS code Setup Wizard on our system as an EXE file. So, the VS code Setup Wizard is downloaded successfully, and we need to run it. 1. Click on the setup file, a preview has been shown: -                  2. Agree to the License Agreement,        3. Select the Installation Location,        4. Placing th

Android Automation

Android Automation Automate: Make your Phone or Tablet smarter with Automation This is a perfect platform for Android Automation. From setting the phone on silent during classes to low-level hacking, all can be performed and executed here. Just make flow with drag & drop approach on given blocks and then connecting them. This free app lets you automate various tasks on your smartphone or tablet. Create your automation with flowcharts, make your device automatically change settings like Bluetooth, Wi-Fi, NFC, or perform actions like sending SMS, e-mail, based on your location, the time of day, or any other “event trigger”. You can automate almost everything on your device, Automate even support plug-ins made for Tasker and Locale . Features of the App 1. Logical fun You edit flowcharts, just add blocks and connect the dots to create your automated tasks. 2. Simple, yet powerful Novices can pick from predefined options, while power users may use

Programming Apps For Beginners

ARE YOU A PROGRAMMER OF BEGINNER LEVEL?? Having difficulty with programming or learning new technicla skills. THESE ANDROID APPS ARE FOR YOU… I , as a programmer , would like to suggest you these Apps which help you bring up your programming skills at a whole new level. 1.SoloLearn: Learn to code for Free This not just an Android app , but a large scale platform for enhancing your programming skills. Features *Take lessons of programming languages like C++, C#, Java, CSS, Python 3, JavaScript, PHP, HTML Fundamentals, SQL Fundamentals, jQuery, Ruby and Swift* *Challenge others and take challenges of your known languages to know how much you know.* Get certificates for completion of course. *Badges for your skills.* *Practice questions within the lessons.* Add and verify others’ questions for challenges. *Online Compiler for all languages* *Save progress and sync across devices* Much more. 2.Programming Hub, Learn to code This app has more languag