Learning to code when you struggled with maths: an honest answer
You can code without being good at secondary school maths. Web development, mobile apps, and automation use logic, not calculus. The maths that matters is pattern recognition and breaking problems into steps. If you can follow a recipe, you can learn to code. Machine learning and graphics need serious maths, but those are specialisations you choose later.
The maths you actually use when coding
Here is what practical, everyday programming uses:
- Basic arithmetic. Addition, subtraction, multiplication, division. Calculating totals, percentages, averages. Primary school level.
- Boolean logic. True or false. If this AND that, then do something. If this OR that, then do something else. This is the core of programming, and it has nothing to do with the maths you struggled with in Form 3.
- Counting and loops. Do this ten times. Go through each item in a list. Again, not calculus.
That is it for building websites, mobile apps, automations, and business tools. The maths that made you sweat in secondary school (quadratic equations, trigonometry, integration) does not appear in these areas of programming.
Where maths does matter in tech
Some specialisations use serious maths. If you want to go into these, you will need to strengthen your maths:
- Machine learning and AI: linear algebra, calculus, probability, statistics.
- Computer graphics and game development: trigonometry, linear algebra, matrix transformations.
- Cryptography and security: number theory, modular arithmetic.
- Algorithm design (competitive programming): combinatorics, graph theory, dynamic programming proofs.
These are directions you choose in second or third year, not requirements for learning to code in first year. You can start coding now and decide later whether to move toward maths-heavy specialisations.
What to do if maths is a barrier in your CS degree
If you are studying computer science, your degree includes mandatory maths units (discrete maths, calculus, statistics). You cannot avoid them. But you can approach them differently:
Separate "maths I need to pass" from "maths I need for coding." Study for the exam to pass the unit. Study coding separately. They are different skills with different goals. Failing calculus does not mean you cannot code.
Use visual and practical resources. Khan Academy, 3Blue1Brown (YouTube), and Professor Leonard explain maths more clearly than many lecture notes. If your lecturer's approach does not click, find one that does.
Form a maths study group. The same study group format that works for coding works for maths. Three people working through problems together learn faster than one person staring at a textbook alone.
The students who struggle with maths and still succeed in tech are the ones who refuse to let one difficult unit define their whole direction. Browse the coding cluster for practical paths that start with logic, not equations.
What to do this week
- Write down the specific maths topics you struggle with (not "maths" in general, but which topics).
- Search YouTube for one of those topics (try Khan Academy or 3Blue1Brown) and watch one video.
- Start a coding tutorial (freeCodeCamp or Grasshopper) and notice how little of it involves the maths you feared.
Frequently Asked Questions
- Do I need to be good at maths to learn Python?
- No. Python for web development, automation, and scripting uses basic arithmetic and logic. Python for data science and machine learning uses statistics and linear algebra. Start with the first category. Move to the second if and when you choose to.
- Will employers test me on maths in a tech interview?
- Most tech interviews in Kenya test coding, problem-solving, and system understanding. You may face logic puzzles or algorithm questions, but these test structured thinking, not textbook maths. The interview preparation is about practice, not memorising formulas.
- Should I avoid computer science if I am bad at maths?
- Not necessarily. The maths units are challenging, but they are passable with effort and the right resources. If you want to build software, the maths units are a temporary hurdle, not a permanent wall. Many working developers were not strong maths students.
Related articles
Should you learn to code in first year if your course is not computer science?
Whether to learn coding in first year if you are studying a non-CS course at a Kenyan university. A clear verdict with a practical starting point.
How much maths a computer science degree actually needs
How much maths you need for a computer science degree in Kenya. Which units are required, which are hard, and how to pass them if maths is not your strength.
Which programming language should a Kenyan first-year learn first? One answer, not a list
Which programming language to learn first as a Kenyan first-year student. One clear answer based on your course, your semester, and what you have access to.
