Chapter 12: Common Programming Challenges
The excitement about programming can fizzle out fast and turn into a nightmare.
There are unexpected challenges that might make life difficult for you, especially as a beginner programmer.
However, these challenges should not set you back or kill your resolve.
They are common challenges that a lot of people have experienced before, and they overcame them, as you will too. 
If you want to succeed in programming, you should be aware of the fact that mistakes do happen, and you will probably make many of them.
The downside of mistakes is that you can feel you are not good enough.
Everyone else seems to be doing fine, but not you.
On the flip side, mistakes are an opportunity for you to learn and advance. 
No one was born as good as they are today.
What we are is the sum of mistakes and learning from those mistakes and experiences.
Feel free to reach out to mentors whenever you feel stuck.
Deadlines and bug reports might overwhelm you, but once you get the hang of it, you will do great. 
The following are some common challenges that you might experience as a beginner programmer.  
Debugging
You feel content with a project, satisfied that it will run without a hitch and perform the desired duties.
However, when you arrive at your desk in the morning, your quality assurance team has other ideas.
They point out what seems like endless issues with the project.
Perhaps the OK button is not responsive, the error messages are not displaying correctly and so forth. 
All these are issues that eventually leave a negative impact on the user experience.
You must get back to the drawing board and figure out where the problem lies.
Debugging will be part of your life as a programmer.
It is not enjoyable, but it is reality. 
Debugging is one of the most exhausting things you have to do.
If you are lucky, you will encounter bugs that can be fixed easily.
Debugging costs you hours, and lots of coffee.
However, you should not feel downtrodden yet.
Bugs are all over the place in programming.
Even the best code you will ever come across needs debugging at some point. 
Solution
How do you handle the debugging process and make your life easier?
The first step is to document your work.
Documentation might seem like a lot of work for you, but it helps you trace your steps in the event of an error.
That way, you can easily trace the source and fix it, saving you from inspecting hundreds or thousands of code. 
Another way of doing light work of debugging is to recreate the problem.
You must understand what the problem is before you try to solve it.
If you recreate the problem, you isolate it from the rest of the code and get a better perspective of it. 
Talk to someone.
You might not always have all the answers.
Do not fear anyone, especially if you work in a team.
Beginner programmers often feel some people are out of reach, perhaps because of the positions they hold.
However, if you do not ask for help, you will never really know whether the person will be helpful or not.
The best person to ask for help, for example, is the quality tester who identified the problem, especially if you are unable to recreate the problem. 
Working smart
As a programmer, one thing you must be aware of is that you will be sitting down for hours on end working on some code.
This becomes your normal routine.
You, however, are aware of the risks this poses to your health.
Neck sprains, numb legs, back pain, pain in your palms and fingers from typing away all day.
For a beginner, you might not be ready for the challenge yet.
However, you must still dig in daily to meet your deliverables. 
Solution
The first thing you must consider is regular exercise.
If you work a desk job, it is possible to lose motivation and feel exhausted even before your workday is over.
You can tackle this by keeping a workout routine.
Jog before you go to work every morning, take a brisk half-hour walk and so forth.
There are many simple routines that you can initiate, which will help you handle the situation better. 
While at work, take some time off and walk around–without looking like you are wasting time.
This helps to relieve your body of the pain and pressure, and more importantly, allows for proper blood circulation.
Other than that, you do not have to keep typing while seated.
Stand up from time to time.
Some companies have invested in height-adjustable desks, which help with this. 
User experience
One of the most common challenges you will experience as a programmer is managing user experiences.
You will come across a lot of clients in the course of your programming career.
However, not all clients know how to communicate their needs.
As a result, you will be involved in a lot of back and forth on project details and deliverables. 
Most users have a good idea of what they need the project you are developing to do.
However, this is not always the same as what your development team believes.
Given that most beginner programmers never interact directly with the clients, especially in a team project, it might be difficult for you to understand them. 
Solution
The best way around this is to figure out the best features of the project.
Your client already knows what they want the project to do.
Ask the right questions, especially to members of your team who are in direct contact with the client or the end-user.
The best responses will often come from designers and user experience experts.
Their insight comes from interacting with users most of the time. 
Another option is to test the product you are designing.
You have probably used test versions of some products in the past.
Most major players in the tech industry release beta versions of their products before the final.
This way, users try it out, share their views, ideas, and challenges they encounter.
This information is collected and used to refine the beta product before the final one is released.  
Testing your product allows you to identify and fix bugs before you release the product to the end-user.
It also allows you to interact with the user and gauge the level of acceptance for your project. 
Estimates
A lot of beginner programmers struggle with scheduling.
Perhaps you gave an estimate for a task and are unable to meet it.
You are now a professional.
Never delude yourself that you are not, perhaps because you are a beginner.
This industry focuses on deadlines a lot.
In software development, estimates are crucial.
They are often used to plan bigger schedules for projects, and in some cases, agree on the project quotes.
Delays end up in problems that might, in the long run, affect trust between the parties involved.  
Solution
The first step towards getting your estimates right is to apportion time properly.
Time management is key.
Set out a schedule within which you can complete a given task.
Within that schedule, allow yourself ample buffer time for any inconvenience, but not too much time.
For example, allow yourself 30-40 minutes for an assignment that should take 20 minutes. 
Another way of improving your scheduling challenges is to break down assignments into micro milestones.
A series of small tasks is easier to manage.
Besides, when you complete these micro assignments, you are more psyched about getting onto the next one, and so on.
You end up with a lighter workload, which is also a good way to prevent burnout. 
Constant updates
The tech industry keeps expanding in leaps and bounds.
You can barely go a month before you learn about some groundbreaking work.
Everything keeps upgrading or updating to better, more efficient versions. Libraries, tools, and frameworks are not left behind, either.
Updates are awesome.
Most updates improve user experiences and bolster the platform security.
However, updates come with undue pressure, even for the most experienced programmers out there. 
Solution
Stay abreast of the latest developments in your field of expertise.
You cannot know everything, but catching up on trends from time to time will help you learn some new tools and tips available, which can also help you improve on your skills and develop cutting edge products. 
Another option is to learn.
The beauty of the world of IT is that things are always changing.
It is one of the most dynamic industries today.
Carve out half an hour daily to learn something new.
You will be intrigued by how much you will have mastered after a few weeks.
In your spare time, challenge yourself to build something simple, solve a problem, and so forth.
There are lots of challenge websites available today where you can have a go at real-world problems. 
Problems communicating
Beginner programmers face communication challenges all the time.
You are new to the workplace, so you do not really know anyone.
Most of the team members and managers are alien to you, and as a result, you often feel out of place. At some point in time, every programmer goes through this.
You feel like a baby among giants.
Eventually, the pressure gets to you, and you make a grave mistake, which could have been avoided if you reached out to someone to assist. 
Solution
Dealing with communication problems is more than just a social interaction concern.
First, you must learn to be proactive.
If something bugs you, ask for help.
The worst that can happen is people might laugh, especially if it is a rookie question, but someone will go out of their way and help you.
If they don’t and something goes awry, the department shoulders the blame for their ignorance.
Before you know it, people will keep checking in on you to make sure you are getting it right, and you might also make some good friends in the process. 
Consistency is another way to handle the communication challenge.
For a beginner, you might not always get everything right.
These are moments you can learn from.
With practice, you grow bolder and learn to express yourself better over time. 
Security concerns
Data is the new gold.
This is the reality of the world right now.
Data is precious and is one of the reasons why tech giants are facing lawsuits all over the place.
Huawei recently found themselves in a spat with the US government that ended up in a host of severed ties.
There are so many reasons behind the hard stance that the US government took against Huawei, and most of them circle back to data. 
People are willing to pay a great deal of money to access specific data that can benefit them in one way or the other.
Some companies play the short-term game; others are in it for the long-term.
Competitors also use nefarious ways to gain access to their competitors’ databases and see what they are working on, and how they do it. 
As a programmer, one thing your clients expect from you is that their data is safe, and the data their clients share with them through your project.
Beginner programmers are fairly aware of all the security risks involved.
This should not worry you so much, especially if you are part of a team of able developers.
They will always have contingency measures in place.
However, you must not be ignorant of security loopholes, especially in your code. 
Solution
Hackers are always trying to gain access to some code.
You cannot stop them from trying.
You can, however, make it difficult for them to penetrate your code.
Give them a challenge.
The single biggest threat to any secure platform is human interaction.
At times your code will not be compromised by someone from outside, but someone you know.
In most cases, they compromise your code without knowing they do–unless they did it intentionally. 
Make sure your workstation is safe.
Every time you step away from your workstation, ensure your screen is locked, and if you are going away for a long time, shut down your devices. 
In your programming language, it is also advisable that you use parameterized queries, especially for SQL injections.
This is important because most hackers use SQL injections to gain access and steal information.  
Relying on foreign code 
You have written some code for a few years and believe in your ability.
You are confident you are good enough, hence being hired by the company.
However, make peace with the fact that you will have to work on projects that were written by someone else.
Working with another person’s code is not always an easy thing, especially if their code seems outdated.
There is a reason why the company insists on using that particular code. 
The worst possible situation would be company politics–they occur everywhere.
Someone wrote some code which the entire company relies on, but you cannot change or question it because the original coder has some connection with the company hierarchy.
Often this raises a problem where you are unable to figure out the code. 
Solution
Since there is not much you can do about the code, why not try to learn it?
If you can, talk to the developer who wrote it and understand their reasoning behind it.
This way, it is easier for you to embrace their style, and you will also have a smooth time handling your projects.
You never know, you might just show them something new and help them rethink their code. 
Another option is to embrace this code.
It is not yours, but it is what you have and will be using for a very long time.
Change your attitude about that code.
Take responsibility for the code and work with it.
This way, your hesitation will slowly fade away. 
Lack of planning
While you have a burning desire to impress in your new place of work, you must have a plan.
Many beginner programmers do not.
Many programmers jump into writing code before stopping in their tracks to determine the direction they want to steer the code.
The problem with this approach is that you will fail to make sense.
The code might sound right in your head, but on paper, nothing works. 
Solution
Conceptualize an idea.
Everything starts with an idea.
Say you want to write a program that allows users to share important calendar dates and milestones with their loved ones.
Focusing on this idea helps you remember why you are writing that code. 
Once you have an idea, how do you connect it with real problems?
What are the problems you are trying to solve?
How are they connected to your idea?
This also begs the question–why do people need your program? 
Planning will help you save time when writing a program, and at the same time, help you stay on track. 
Finally
In programming, everyone starts somewhere.
Being the new person in the company should not scare you.
Communicate with your peers and seniors, be willing to learn from them, and all the things that might seem overwhelming will somehow become easier as time goes by.