learn-to-code

Learning to code: Chapter 01

Reading Time: 4 minutes

Introduction

I often get the question ‘How did you get into computer programming and how did you learned everything you know?’.  The first one is easy, it was an accident.  No, it’s not like I tripped and fell, then all of a sudden I was a programmer… but in all honesty it was close.

Back in the day (around 1994), I had a job helping pay my way through school.  At the time this was plan old data entry.  I would combine several sets of printouts from a mainframe into a spreadsheet.  This was manually intensive work and quite possibly error prone.  I was literally typing in numbers from a mainframe green and white print out and transposing them onto a Microsoft Excel worksheet.   This was bad and I knew there could be a better way.

Fortunately for me and the company I worked for, I had some programming experience.  I did some minor Basic (the computer programming language) as a kid on my Commodore 64  and some courses c, c++ along with visual basic 3.0 in college, however I could never see how to apply it anywhere in real life.  I knew how to program some minor sequences onto a chip and make lights flash or create a windows form with buttons that automated flashing light etc but I never saw the bigger picture.  For the most part, it was probably a lack of imagination or the pressure of keeping up in class work.  At the time the courses never seemed to cover useful or practical things.  The light bulbs or eureka moments never arrived. Keep in mind this was 1994 before everything, everywhere was all about programming.

However all of a sudden the problem facing me made me think, I remember reading that Visual Basic was available inside of Microsoft Excel and if that’s true I have an idea!  With a little digging, I quickly found that VBA or Visual Basic for Applications was built into Excel.  This is great, I could write code that would automate this for me.  Ok, where to begin?  Unfortunately back then there wasn’t a google or stackoverflow site.  In fact the web was just getting started and it was all dial-up.  There were online chat rooms and some special message boards you could dial into but in reality the easiest way was to head to the bookstore and buy these mammoth sets of books on programming VBA with MS Office.  So, that’s what I did, I bought some books, convinced by boss that I needed a csv (comma separated value) file of the mainframe data.  If everything went according to plan and I could get my work done via the touch of a button and get error free reports out to each team leader in a fraction of the time.

As it turned out it wasn’t as simple as I thought it would.  First it took time for our request through, then we could only get the data in a fix length format and not comma separated.  I also had to deal with special characters that appeared in the file.  Maybe this wasn’t such a good idea.  After all, this was supposed to be a cool, fun project but this is looking like a lot of headaches.  But then it happened!  As the days went on my code started to do the things it was supposed to.  Even if I hit a stumbling block, it felt like a new piece of the puzzle or a new challenge.  It was almost magical, I was hooked!

In a round about way, the second question was also answered by the first. “How did I learn everything I know”: a lot of practice which simply means a lot of different projects which also equates to a lot of trial and error.  Different problems often lead to different solutions and sometimes different programming languages or back end supporting systems.  Each case was different, but the execution was typically the same.  First you define the problem, then you look for a way to solve it.  How do I get from point A to point B.  What does it take?  Maybe by the end point B is really point F and you have points A through E you’ll need to discover, design and develop to get you there.

My whole point is that learning is a process.  In almost all cases it’s hands on.  Sure, you will read some books or watch a video, which will help with the fundamentals but until you actually do something you won’t really learn it.  In order to retain that knowledge you need to put it to use.  Don’t be afraid, the first few times you do something, you will make simple mistakes that might take you hours to figure out.  The upside is, you will likely remember that for the rest of your life.

What’s Next?

I’m keeping the intro short so we can get into the nitty gritty.   Over the next series blog post (approx 1-2 per month), I’ll get you up to speed with some basic tutorials.  We’ll start out with some small snippets of code to get going.  I’m going to keep it nice and simple and not overwhelm you.  As we progress we’ll gradually put everything together creating a nice simple application.   All the software development tools we’ll use are free, so no need to worry about expenses.