A Chronology of Things I’ve Learnt About Programming: Part 1

The hard part of programming isn’t how you do something, it’s why you do something the way you do.

In practice, most common programming languages are similar in structure. If you can write an if/else statement in C#, chances are that after a quick Google you’ll be able to do the same in JavaScript, PHP, LUA, or InstallShield Script (which sucks big time as a language, by the way). Even fundamentally different languages like those for functional programming or mathematical modelling still share a lot of the concepts.

So when the problem isn’t how you’d go about writing the language of your program, it becomes one of why should I write it like this. This is the kind of thing programming is full of, and there’s no indication when you’re writing something that there might be a reason for doing it in a different way. It’s also very rarely mentioned in programming tutorial books above a basic outline.

To go back to my previous example (and it’s a classic one in learning a language), the if/else statement is used to check a condition and then decide on an action to take. Likewise, the switch statement will check the value of something and then decide on an action to take depending on that value. You’re told early on that if you have many possible conditions, then you’re better off using switch than if/else because a) it’s easier to follow the program flow and b) it’s faster in execution. This is all good stuff.

Another good example is being told to split your classes out into different files. You could put everything in one file (and even one class), but splitting them out makes things easier to navigate and encourages you to think a bit more about the structure of things.

But take a more complex idea, like why should I use dependency injection and inversion of control to pass in objects to my classes rather than instantiating them within the class. These are some big old words we’re throwing around here. Things you won’t be told about in a course or book (at least until the more advanced, technology specific ones). But equally it’s one of the most important practices I use in my day-to-day work. Something which simplifies the code I have to write and maintain, and makes me more productive. It’s understanding concepts like this which are the real achievement in programming, far more than just being able to churn out lines of code. And it’ll come to you with time and practise.

So my suggestion to you is this; don’t ever stop reading. Even when you finish a tutorial book, carry on with another one. Something related. Something completely different. Either one could contain that valuable fragment of knowledge which could save you time, money, or headaches. Look for articles and blogs online about the kind of thing you’re working with and see what they’re doing to solve their code problems. You’ll come across stuff you’ve never seen before, and more often than not you’re going to read it and have a eureka moment when you suddenly realise how it all falls into place. Mess around with that idea in your own projects. Create neat little applications that you can use to practise with it, even if you just stick it in a folder somewhere afterwards and never use it again.

Knowledge is power.

Practise makes perfect.

Remember these two things and you’ll be a more effective programmer in no time.

As a sub-note, I’d like to give a list of concepts which I wish I knew about (even just in name) when I first started coding. However I realise this post is getting long as it is, so I’ll probably follow it later with a more comprehensive one where I can go into a bit of detail on what these things are rather than just name dropping them.

I’m looking for some good programming blogs to follow / interact with and would greatly appreciate any suggestions anyone has. Also if any programmers, new or old, want some help with a problem or to bounce some ideas around, prototype some code, or have a discussion about it, I’d be happy to help. I know how hard and confusing it can seem when you start out.

I’ve been programming for about 17 years now (since I wrote my first fan website for FFVII and hosted it on AOLs member pages). I messed around with it all the way through school, took a degree in Electronic Engineering, and now co-own two software companies in the UK. We’re considering running some local programming classes for anyone that wants to get started learning, and I’d be interested in finding out what problems people have had starting out on their own (and also what they like so much about programming).

I mainly deal with C# and web technologies (HTML, CSS, jQuery, etc.) purely because I like working with those languages and formats, but I dabble a little in everything, like Lego robotics controlled via an Xbox controller over bluetooth, procedural isometric terrain generation for games, I even wrote a pokédex system for a charity event where people could bid on pokémon. Mostly I just like messing around with cool little ideas in code (as you may have seen recently on here when I prototyped a real-time light-speed communication model inspired by science fiction!).

Look forward to any replies you have. I’m hoping to post snippets of stuff I’ve been working on more often on here in the future.

Flew over Silverstone Grand Prix circuit in a real Cessna 152 in the day, then flew over the same route in the same plane on Flight Sim later that night!

orange-plum:

happycontender:

they saw the chance

You’re forgetting the best one

I’m sorry fasterphil I can’t hear you over the sound of this glorious sunshine.

I’m sorry fasterphil I can’t hear you over the sound of this glorious sunshine.

Best. Review. Ever.

Best. Review. Ever.

dunderpatrullen - Keygeneration

I’ve just finished reading Dauntless, the first novel in The Lost Fleet series. It wasn’t a bad read, and there’s enough potential at the end of it for me to give the second book a chance, but personally I found the characters a little one dimensional and the plot wasn’t very complex (Iain M. Banks has spoiled all other sci-fi for me!). The main concentration is on three separate fleet engagements that occur as the Alliance ships are trying to escape hostile territory. The battles themselves are nothing special, but what interested me about them is that this is set in a Universe where faster than light communication isn’t possible, and so when combat occurs across the scale of a solar system, there are significant delays between telling a squadron of ships to execute an order, and them actually receiving that order and performing it.
This isn’t something I’ve seen in a sci-fi book before, and it makes for a nice mechanic. So much so that I wondered how this would play out if you were controlling ships in a game and had to plan ahead the orders you wanted your subordinates to execute and transmit that order in time for them to act on it.
The other idea the author uses, again based around the rule that information is only transmitted at a limited speed, is that you would only be able to see what an enemy (or friendly) ship was doing at a time relative to their distance and the speed of light. So for example, a ship 10 light-minutes away may execute a manoeuvre, but you wouldn’t know about it until the image (i.e. light) of it doing so reached you ten minutes later. So youmight have issued an order assuming it was going to still be there or following a particular course, but since then it’s changed direction or performed some other action.
I’ve been messing about with a prototype console app which models the order transmission idea. It can transmit a message to all ships, and then each one reports the time at which it receives it. Those ships further out get it later than those closer in.
I can feel some more tinkering in game programming coming on!

I’ve just finished reading Dauntless, the first novel in The Lost Fleet series. It wasn’t a bad read, and there’s enough potential at the end of it for me to give the second book a chance, but personally I found the characters a little one dimensional and the plot wasn’t very complex (Iain M. Banks has spoiled all other sci-fi for me!). The main concentration is on three separate fleet engagements that occur as the Alliance ships are trying to escape hostile territory. The battles themselves are nothing special, but what interested me about them is that this is set in a Universe where faster than light communication isn’t possible, and so when combat occurs across the scale of a solar system, there are significant delays between telling a squadron of ships to execute an order, and them actually receiving that order and performing it.

This isn’t something I’ve seen in a sci-fi book before, and it makes for a nice mechanic. So much so that I wondered how this would play out if you were controlling ships in a game and had to plan ahead the orders you wanted your subordinates to execute and transmit that order in time for them to act on it.

The other idea the author uses, again based around the rule that information is only transmitted at a limited speed, is that you would only be able to see what an enemy (or friendly) ship was doing at a time relative to their distance and the speed of light. So for example, a ship 10 light-minutes away may execute a manoeuvre, but you wouldn’t know about it until the image (i.e. light) of it doing so reached you ten minutes later. So youmight have issued an order assuming it was going to still be there or following a particular course, but since then it’s changed direction or performed some other action.

I’ve been messing about with a prototype console app which models the order transmission idea. It can transmit a message to all ships, and then each one reports the time at which it receives it. Those ships further out get it later than those closer in.

I can feel some more tinkering in game programming coming on!

pleatedjeans:

via

Pop It - Anamanaguchi

Wheel
Of
Ingots!

Wheel

Of

Ingots!

stateofgraces:

nothing lasts forever (except the WinRAR free trial)

theslumberchamber:

Nabbed all of the images from yesterday to document the belated (or elongated) birthday celebration of friend, bassandchip. If you hadn’t guessed it was a day out on the tracks and it was FABULOUS! You should check his blog out, it’s pretty swiggy swoo.

Had an awesome time last night karting with all my friends. Obviously my Dad took first place, he does have a professional history of racing after all! I got third, and they gave out medals for first to third and for the fastest lap. Rounded off my Birthday weekender perfectly.

New _ensnare_ album released which perfectly rounds off the end to my Birthday weekend! So much awesomeness.