Blog: Keogh Code: And then there was maths

I am not a mathematician. Do I have to be?


I'm not bad at maths. Really, I'm not. I was always pretty good in school, and I continued taking stats in seventh form - or year 13, I suppose - even though I didn't have to. It's just that since I left high school, and went on to complete an English degree followed by a year of Journalism, I haven't exactly had to do a lot of it. And algebra? I haven't done any serious algebra since I was maybe 17.

Anyone who's learned how to program in any in-depth way will understand why this is a problem. While the C++ book I've been working from insists that I don't need to be a mathematician, I know that I'm not going to be able to get away with avoiding the topic altogether for much longer. This become abundantly clear when on Saturday I began to learn about the different variables I could use in C++, and how many bytes of RAM the different variables would use.

Granted, seeing as I'm a complete beginner and everything I'm making at the moment runs in the command prompt, how much RAM a program uses is not going to be of huge importance just now. But at some point, eventually, it might be. And I think that my lack of mathematical prowess might be my biggest hurdle in the weeks to come.

Thankfully, I've recently discovered Khan Academy, a helpful resource with loads of maths help.

For now, though, my problems are simpler - because of my success in making a calculator two weeks ago, when I last wrote a blog, this week I started turning other programs into calculators. The goal was to do it without having to check my old code, and without looking at the book. In other words, I'm teaching myself to code from memory, because while it's a skill I might not need now, it's definitely something I want to be able to do.

While I can now write that 'Hello World' program I struggled with a few weeks ago from memory, I have trouble with things I've learned more recently. It took me an age to change a program that calculated the area of a 10 x 13 rectangle into a calculator that would allow you to input your own numbers to figure out an area. Fortunately, my Assistant hinted that maybe I needed to use a standard other than cout, and eventually I got there. My brain may have come close to exploding in the meantime, but I got there.



Another, more specialised programming book arrived for me this week. From now on, I'll be mixing up my learning switching between my two books, depending on what I think I'm capable of and what's going to be fun to do. This second book gets you started on making basic games in C++, so next week I'm going to have a crack at making my first game.
2 Comments
You ain't seen nothing yet You think that's hard? Wait until you get into your game programming. Remember all that sin/cos/tan stuff you learnt at high school and thought you'd never need? Well I suspect its going to be factoring into your life again soon :-)
Posted by Cleggy at 12:43:07 on May 10, 2012

Flag abuse

You ain't seen nothing yet I'm expecting a call from my high school maths teacher any day now. "See? I TOLD YOU YOU'D NEED IT!" Sorry, Mr. Turner.
Posted by Siobhan Keogh, PCW at 12:45:25 on May 10, 2012

Flag abuse

CURRENT ISSUE
Newsletter & Subscriptions Windows vs. iOS vs. Android:
How to choose the best tablet for you

101 great websites:
You haven't heard of yet

DIY desktops:
We ask the pros for building tips

SIGN UP
PC World's weekly round-up of tech news, gear and game reviews, software selections, and handy How Tos.
Blogs
Hot Products

Hot Products || PC World editors iPhone 4S launch pics and unboxing
The iPhone 4S launched at midnight through both Vodafone and Telecom. ... READ MORE

Tux Love

Tux Love || Geoff Palmer Google : Starting to be evil?
Google recently deleted AdBlock Plus from its Android Play Store. This is ... READ MORE

Tech Guy

Tech Guy || Juha Saarinen Small balls of solder
The idea that desktops might change forever is enough to send geeks into a ... READ MORE

In a Nutshell

In a Nutshell || Zara Baxter Logging, not login
At an event in Singapore yesterday, Seamus Byrne, the editor of CNet ... READ MORE

Harley O'Gyver

Harley O'Gyver || Harley Ogier Pay for internet by-device? Not on my watch.
So as those of you who follow my twitterstream will know, I'm currently in ... READ MORE

The Arcade

The Arcade || PC World editors New Year, new games
You'er going to laugh. Or at the very least, you're going to scoff and ... READ MORE

Dumb Terminal Live!

Dumb Terminal Live! || PC World editors New Zealand memes: We think we're real funny
We New Zealanders love the internet, and we have a pretty good sense of ... READ MORE