But enough about you…

a writer's blog

So you want to learn to program

without comments

So, you want to learn a programming language.

It makes a big difference whether or not you already code in any other programming language. If you don’t, I would recommend you start by learning Javascript. There are a thousand online resources for learning it, and you can get the instant satisfaction of seeing how it works right in any web browser. It will teach you basic program structure and all the different flow-of-control mechanisms, like if/else/endif, different kinds of loops, case conditions, and all that stuff.

Javascript will also get you familiar with the fact that in today’s programming world, you rarely get to live entirely in your language of choice. Javascript is typically embedded in HTML, and very often is used to generate HTML, as well as dynamically creating stylesheets in CSS, or generating and running SQL statements against data sources. You’ll want to learn a language that plays well with other languages, and Javascript does that as well as or better than anything. On my last contract I wrote a Javascript system using NodeJS that read Cobol programs and translated them to Python. This is typical of anything you’d want to do that rises to the level of being more than a toy.

Once you have a bit of Javascript under your belt you’ll have a sense of whether you want to dig deeper. You could then learn Node JS, which is an excellent, enterprise strength version of Javascript that runs on a server instead of in a client – a web browser is a ‘client’; a ‘server’ is something like your own machine, or a remote Linux box that hosts a database, and that ‘serves’ pages to your browser. The great thing about Javascript is that it will run on virtually any machine, will do function as – or with- a server system, and will function as – or with – a client. Even a tiny bit of Javascript knowledge will let you do something useful, and if you find yourself ready for the deep end, there is almost no limit to what you can accomplish with Javascript, up to and including enterprise level product development.

Utility languages

Note that professional programmers will usually have the language they’re working in for their client, their employer or their product – it might be Swift, it might be Java, Cobol, C# – it might be any of a host of things. They will also have a “utility” language. This will typically be a language that they can execute on their own local machine at the command line, a language in which they can read files off the hard drive and write some translated version of the file back to a hard drive. Your utility language is your go-to language when you’re supposed to be a PHP programmer (for instance) but the client hits you with some old version of a spreadsheet that nobody can open – you need to read it as raw lines of text, parse out the interesting stuff and throw away the old formatting. You turn to your utility language for these things. Popular utility languages are Perl, Python, Javascript, C, Linux scripting language, Windows scripting language… your utility language might well be the language you use to earn your keep, but it might not. The important thing about your utility language is that you need it to be always close at hand, so it should be something you can run on your own machine but can also install easily on a client machine; no matter where you are, you’re never without it. This is another factor in favor of Javascript: it makes an excellent utility language.

Bi-Lingual by default

So let’s say you’ve got one utility language under your belt; you can either start to pick up a second language, just to get a feel for how different some of them are – in which case I’d strongly recommend Python, because there’s an excellent job market for Python. But there are also excellent job markets for C#, Swift, PHP, Perl, R, Go, Java and hundreds of others. In the end it won’t matter which you choose because you can do interesting programming on anything: But I started this post as an answer to a question on a Swift / IOS forum, so everyone there buys into, to some extent, the Apple ecosystem. Swift is an excellent language, and it has the added benefit of being one of the many languages that is converging on roughly the same syntax – C# is so similar that if you know one language you pretty much know the other!.

As you move along, you will need to absorb the concepts of Object Oriented programming (OO) because it underpins so much of what’s out there in the world. OO tends to follow a programming model called Model-View-Controller (MVC). BUT, you should not dive deep on OO programming but learn instead Functional Programming (FP) which tends to follow a model called Model-View-View-Model (MVVM). You’ll want to learn what these models are and what they each have to offer.

Functional programming lets you step over a lot of historical detritus and get right into the kind of programming that will probably dominate for the next decade or more. Swift is an excellent language to concentrate on once you have some basics under your belt, and the course you’ll want to take is CS193P at Stanford University. It is available for free on YouTube, and you can start watching online. Most other online resources for Swift are slightly or badly out of date, but the Stanford course is nearly up-to-the-minute (as I write this, in September, 2020). Accept nothing less, but take this one: https://cs193p.sites.stanford.edu/

Written by Alan

September 10th, 2020 at 4:05 pm

Posted in Writing