December 29, 2014 Alexander Swensen

Why everyone should learn how to code.

I will warn you, this is a very long article about my history in coding, and why I have come to realize it is something everyone should learn how to do. So this is not an article to read if you only have 5 minutes. Sit down when you have a fair chunk of time and are feeling like exploring a new area. I don’t care if you are 8 or 80 years old, this is something that you can still benefit from. And now, on to the story.

When I was in elementary school, I never paid any attention in class. I found it really boring. Not to diss my teachers, they were great, but i just didn’t find much to be challenging or worth while. That, combined with my short attention span and ADHD, really didn’t make for a great mix in my early academic experience. I ended up spending most of my time in class on my laptop doing things that were interesting to me. Stuff that I found cool and challenging. No, not videogames. I couldn’t get away with that in class… most of the time.

Instead I was teaching myself how to build websites, and write programs in Visual Studio. Mind you, I was in grades 5 through 8 while I was doing this. Now mind you, I wasn’t anything amazing. I built basic websites, and very simple applications. Sadly none of these are still around, as they weren’t maintained and have since died an ancient death. Little did I know, however, that these skills would become incredibly useful 10 years later.

After going through school majoring in Media, I have since taken up a job in Tennessee working for a production company. But we don’t just do production. We also do web design, and recently have been throwing around the idea of app development. Well during the winter months when there isn’t any real production work going on, guess where the money comes from? Web design. And there is a huge pressure for app development. In order to pay my own bills, i decided to brush off some old skills and take a leap into these areas. (my boss may have pushed me in that direction a little bit)

Since then, I am working along side our full time programmer working on building websites and Web-Apps in HTML5, and doing App development for iOS and Android.

So why is this important?

Sir/Madam, this is probably one of the most important things to learn in the modern age. How to code. It is everything from the coffee/tea you make in the morning, to the alarm you set at night. The emails you receive, to the system that runs your car on your way to work. We are running code in every aspect of our lives every single day. We are so reliant upon it, but must of us don’t even understand how it works. We sit there, and take for granted that it works day after day… well until it doesn’t work. And then we have no idea what to do. So we pay people tons of money to do things so simple like build a website.

Now, don’t get me wrong. We need people like you to pay people like us, or we would be out of a job. But everyone can benefit from a bit of background knowledge in coding, and basic formatting of code. Let me give you an example.

Just the other day I was helping a client make some changes to their website. They use a CMS (content management system) that makes it much easier for them to modify content on their page, but it doesn’t allow you to do everything. Sometimes you need to delve into the code to be able to make some specific changes to a site. But this fine gentlemen didn’t know anything about HTML, and wanted everything to be simply drag and drop. Well that isn’t really how it works. There are some things that you can’t do with drag and drop. Now this process would have been a lot simpler if they had a little background in HTML. They would have been able to make the changes themselves, and I probably wouldn’t have been interrupted from my other tasks. Overall, everyone is happier. Don’t get me wrong, I love helping people, but the point is I would like people to be able to help themselves.

Now before I move on, there is a very important distinction I should make. Web Coding language, aka HTML, is actually not a coding language, but a markup language. HyperText Markup Language. Built around HTML are real coding languages like JavaScript, and styling languages like CSS. Most programmers won’t define CSS or HTML as coding languages, but for the purposes of this blog post, I will refer to them all as one in the same to make things simpler. And in truth, they are one thing. This one thing is known as HTML5.

So lets take a blank website. Nothing on it. Nothing at all. You go to the page and there is nothing. There is still HTML involved in making that website.

Thats about 10 lines of code right there, just to make a blank website. Most of that is just the skeleton of the site, telling your web browser what the site actually is.

So say I wanted to add some text and a video to that website. Lets take one of the short films made by the Blender Foundation and The Open Movie Project.

Here is what the code might look like.

Now, that in itself isn’t very difficult, but we don’t have a very good looking page. Here is what the page might look like.

We could go even furthur, and add a button that, when clicked, displayed the video. For that we would need to start using  <script>, some javascript commands, and a  <button>. Lets begin.

First, we would remove the video we just added. We will then create a button that will run a portion of javascript, that will create the video frame once the button has been clicked.

Overall this is a very simple, and wrong way to do it. Its the wrong way, because every time you click the button, it will add another instance of the video, but for simple examples it works just fine.

Now I didn’t write this to teach you to code. There are some amazing resources over at w3schools.com that will teach you everything you need to know to get started building your own websites, or even modifying content on an existing web page.

Here is where things get really interesting. You have heard of an App right? Of course you have! You probably have a smart phone or a tablet of some kind. Apps are the programs you can run on those to do everything from checking your email to video-chatting with your friends. They keep us connected with whats important, and make it convenient. The problem with apps is you end up having to write a different version of the app for every platform. That means one written specifically for Android, one just for iPhone, one for Windows Phone, one for Nokia, the list goes on and on, and that is very impractical.

There is one thing that all these devices have in common, however, and that is a web browser engine. Using modern technology, there is a project called PhoneGap that allows you to write one app using HTML5, and compile a native application for each of these platforms.  This is what I have chosen to write my apps on, as it is much easier than learning Objective-C or Swift for iOS, and Java for Android. Its so simple, in fact, that I can write my own app and put it up on the Android app store absolutely free. (Apple App store makes you pay a yearly fee to have an app on the store)

These are just some things i have learned in the past few months that have become essential to my daily routine at work. By mastering them, I am instantly worth more, and that means a higher income for me. There are also many other languages out there like C++, Python, Ruby, etc, that you can use to create fully functional programs on your PC, Mac, or Linux box. You can program micro-controllers that run a robot vacuum cleaner around your house, or program a rocket fly into the upper atmosphere. The possibilities are endless. (I like to use a little device called a RaspberryPi for many of my micro-projects. Arduino’s are also fun to fool with.)

Cool! But this is kinda a lot. Where do I start?

I’m glad you asked. There are three places I recommend starting. The first two are free, the second is not. I like to use the metaphor “you get what you pay for” to compare these though.

The first place you can go to is w3schools.com. They have information and reference guides for everything you could need to get started in HTML5. I use this regularly as a reference to look up different things, as there is too much out there to have it all memorized.

Second is The Hour of Code. Hour of Code is a global movement to make coding easy to learn for everyone in the world. Its a great place to start.

The third is a video-course from Lynda.com called Foundations of Programming: Fundamentals. Its a great video-lecture I went through when I was re-learning how to program, and it is extremely useful. The best part is it actually teaches you how to code in JavaScript, so if you are looking to do web-coding, its perfect. Don’t worry though, the concepts you learn in this video will apply to most other Object Oriented Languages.

 

Anyway, I hope this extremely long article was worth it to you to read. I know it was an interesting task to write. Let me know in the comments below, or send me an email. Also, if you know anyone who wants to get started in programming, send them my way. It really helps me out!

See you all later!

– Alexander G. Swensen