On learning to code.

Posted on Posted in Uncategorized

On the value of learning to code

I've noticed recently there have been a lot of articles on learning how to code. As someone who's already deeply involved in the IT industry as a professional developer I admit to being torn on this subject in some ways. I'm always glad to see my field gaining more interest and exposure, and there's definitely plenty of work out there for people who are competent. On the other hand, there are also plenty of unemployed programmers out there. I'm not sure what it's like in other fields (carpentry, construction, etc..) , but the level of experience where you can really "take off" and see the high pay and flexible lifestyles that you often hear about is several years of experience after graduation from your degree. This is already assuming you're driven enough to seek constant training and additional experience for those years. Software development is also a field where you have to seek continual training in order to keep up, often in your personal time. 

Does this mean I want to dissuade people from starting a career in Software Development? No, but I do want to see the people who start prepare themselves to put in the effort until they succeed. It's misleading to think that you'll get a degree and then immediately bounce into a great job. The difference though is that once you have the experience it's much easier to turn that degree into a fulfilling career. Of course this is my only career so take my words with a grain of salt. It's possible I'm way off and this is really the worst career ever.

Still, some of you may be interested in what worked for me.

I'm not dissuaded, what should I study?

You're not thrown off? Great. Persistence is key in this field. I'm assuming that you need to choose both a first language to start with as well as trying to figure out which languages to specialize in more deeply once you've gained some experience. Firstly I've heard it said that you can tell a great programmer because they specialize in the more obscure languages. After having worked with people skilled in the less common languages I disagree that learning obscure tools is the mark of greatness. Something like "Lua" or "rust" might be great for their one unique use case, but it will be far harder to find assistance, technical support, libraries and additional staff. If you're on a team and the one programmer that codes in "Scala" quits, who's going to replace them on the team to fix bugs as they come up? You'd better hope this one off genius programmer left excellent comments and documentation (ha,ha..).

No, stick to the classics, they're classic for a reason. 

As a first programming language I'd recommend "Python" or "Javascript". They're both completely different languages that focus on completely different things, but they're powerful, flexible and easy to pick up for beginners as well as having loads of training materials. Python is generally a server side language (it runs on your computer directly) and Javascript is generally a client side language (it runs inside a browser when a user visits your web-page), but only generally. Javascript can run on your computer with Node.js (a library) and Python can render web-pages for a web browser with (web.py). It can't run inside a browser itself though, only Javascript can do that. If I was forced to choose I'd choose Python though, as finding errors in Python code is easier as well as it being much better suited for most things you'd want to learn programming to start doing. You can be productive and start solving problems almost immediately.

One of the main reasons to pick a popular programming language is the availability of "libraries". These are pre-prepared code chunks that can fulfill a certain function. For example PHP has a library called "Carbon" that's really good for date conversion, with Carbon you can turn anything a user types into a date, turn a date from computer time into almost any string format and do math between dates while also taking into account different time-zones (how many hours between 8AM in Sydney on Friday the 11th of May 2016 and 2PM in Singapore on the 10th of February in 2017). Web.py is another python library that will run a web server for you and generate web pages when people go to various URLs. Because the server is in python it can easily and quickly integrate with other Python libraries, for example "socket" and "hexlify" to generate a binary packet and send it to an embedded system (think robot arms) when an authorized user clicks buttons on a web-page.

By the way, if you decide to learn Javascript then you absolutely must learn jQuery as well. It's a Javascript library that's practically a language by itself and removes a lot of Javascript's bad points. For example Javascript runs differently on every browser and the implementation differs between different browser versions; for example IE 11, 10, 9, Edge, Chrome and Firefox all do Javascript slightly differently. jQuery checks the browser that's being used and provides different code depending on that to guarantee you get the expected result. You can still do this by hand but given how many possible browsers there are the amount of complexity will be hard to handle for any project that isn't completely trivial. It also provides a lot of functionality that replaces paragraphs of Javascript in a single line, so don't go without jQuery.

This post is already getting on a bit so let's end it here for now.