Machine Whispering P1: Getting Started With Programming
Welcome! First question is, what are you looking to build?
switch(You.Interests) {
case Web Pages/Web Applications/Front-end/Visuals:
You.startWith(HTML/CSS/JavaScript)
case Data manipulation/Stats/Math work/Algorithms/Research and science:
You.startWith(Python)
case Operations/Managing machines/System administration/Database work:
You.startWith(Bash/C/SQL)
case Backend/Server side/Core logic and functionality/Algos/Infrastructure:
You.startWith(C/Go)
case iOS:
You.startWith(ObjectiveC/Swift)
case Android:
You.startWith(Java)
case Windows:
You.startWith(C#)
case macOS:
You.startWith(Swift)
case VideoGames/PerformanceProgramming:
You.startWith(C/C++)
}
*Default: if you’re really not sure what you want to do, just want to get started, try Python.
Code, or a programming language, is a way of talking to a computer. Usually, when we talk to the computer it is to describe a problem we have or what to do to solve it. Right now, you and I are communicating using English. Similarly, you can give instructions to a machine with C, Python, Lisp or Java, for example. Each language has it’s own rules that keep its structure and make meaning more distinct. These rules are a combination of syntax and semantics.
You’re going to hear a lot about “abstractions” and “high/low” levels. This is just a way of describing how close you are to what’s physically happening. The lowest level is the hardware! The chips and electricity powering the machine. Something very high level could be a line of code such as “Application.start()” that, alone, launches an extremely complex system. However, all of those details and implementation have been “abstracted” away. The significance of this is that if you’re building something at a higher level, you’re trusting all the lower level stuff has been implemented optimally and is doing what you need/expect it to. Where as, if you’re working at the low level, it can be more work, but you’re designing every detail and exactly how it’ll work. Here’s a summary of some popular, good to know languages.
Python: Generally regarded as a “scripting” language. Scripting is automating things, one off tasks, smaller jobs and operational tasks. Python is extremely quick to write which makes it good for this. However, you can definitely still write plenty of cool applications with it. It’s very good for manipulating data and math based work. Personally, I believe Python’s best selling point is its intuitive syntax. Everything you write will be fairly close to the English language making it very readable. Great starting point if you would like to get an idea of what programming is about and want to get started quick.
Java: Good for enterprise applications. All Android development is done in Java as well. All-around solid language that’s very versatile. Lots of community support, can build almost anything you want with it.
Go: Often referred to as GoLang, Google’s language! Not as wordy as Java, but more large-scale ready than python. It’s a smaller language (less provided in the included library) and is also very fast.
C: The Godfather of languages. Gives you the ability to do everything down to assigning memory for data, and has the potential to be an extremely fast application. It’s fairly compact in the sense that there’s not much extra included and you have to implement most things yourself. Lots of higher-level languages were actually written in C.
C++: A bit higher level than C, still very similar. A larger standard library and functions/data structures included for you to play with.
The style, syntax or way of communicating at the start of this article is a common way of expressing “switching” actions based on the “case.” This is pseudo-code. So, not actual valid code but a rough outline or imitation. I’m a big fan of using pseudo-code to sketch out your thought process and getting an idea of what needs to be done. At the beginning it’ll be tough to even form sentences. You naturally struggle with describing the steps to solve a problem, so here are my steps to taking steps.
Break it into pieces. You’re not taking steps, you’re lifting your leg, extending, push, land and repeating.
Once you have an idea of what needs to happen, try to find something that sounds similar in the documentation. Don’t ignore docs. They’re your best friend. They have all the actual A+ on the test answers. And, ALWAYS read the docs from whoever made the language/tool/library, first.
Think in terms of data and data structures. Most of the things you want to do involve you taking some data/info and either transforming it or putting it somewhere else. Like transferring money from one bank account to another. To describe this to the computer keep in mind the basic building blocks, like arrays, lists, maps or what are often referenced as “containers” in documentation. Once you have stored or structured your data then you know how you can interact with it to do whatever you need to.
Just type. The most important thing is just to start typing. There will be times when you get frustrated, but the biggest key is just to start. It doesn’t have to be correct from the beginning. It’s better to have something broken and wrong than nothing.
An important thing to remember is that what language you start with isn’t a huge deal! Once you get going, you’ll learn more languages and it’ll be much easier to pick them up. Don’t stress the decision too much and just get writing.
Here’s some good resources for starting with different languages.
codeacademy.com - Great all around
https://turtleacademy.com/ - Teaching language, good for learning structure and how things work
https://learnpythonthehardway.org/
http://python-guide-pt-br.readthedocs.io/en/latest/
http://blog.udacity.com/2015/03/write-your-first-python-application.html
https://www.apple.com/ca/swift/playgrounds/ - Very fun intro
BigNerdRanch books - (ObjC)
codeacademy.com
http://www.htmlgoodies.com/
https://www.amazon.com/Programming-Language-Brian-W-Kernighan/dp/0131103628 - The classic of all classic textbooks
https://www.amazon.ca/Your-First-C-Program/dp/0782114148
https://tour.golang.org/welcome/1
Functional programming is a different style, paradigm, or way of thinking. You can still accomplish all the same things, but your thought process might be more suited for languages designed for communicating using message passing and functions as opposed to data structures and objects that object oriented languages like Java and Go are often used for. Please do some more research to understand the difference between these two styles.
Scheme - good intro functional language, can be learned in this book (Also used in CS135 at Waterloo for intro)
http://www.htdp.org/2003-09-26/Book/curriculum.html - Lots of general explanation, conceptual grasp that eases you in
Erlang - one of my personal favourite languages, just really fun to write.
http://learnyousomeerlang.com/introduction - Awesome, fun-ly written book
Also, here’s some more general tips:
If you’re not developing for Windows, try getting a Unix-based operating system (macos or Ubuntu probably). They come with popular terminals or command lines that are used to control your computer/operating system more finely. They will almost always use a language called Bash. Windows has recently released support for this on their system, but I haven’t given it a try myself. https://msdn.microsoft.com/en-us/commandline/wsl/about
Understand how the internet works. Understanding networks will make the steps for building an application more intuitive. Generally, any specific knowledge is useful and I encourage researching anything you come across but the internet is a fundamental block. https://www.destroyallsoftware.com/compendium/network-protocols?share_key=97d3ba4c24d21147
If you’re not sure what to do to keep practicing, just search for tutorials! Projects are a great way to practice and also give you direction and focus. Search for a tutorial to make a blog, a banking system, tic-tac-toe or whatever else comes to mind in the language you want to use.
Create a GitHub! This is like your Instagram for coding. Or where you can show off all your work. It’s also tremendously useful to manage your projects. As you make progress you “commit” checkpoints so you can revert changes, look back to see what you’ve done, or just to upload things online so you don’t lose progress and you can continue working somewhere else. Great community with lots of useful code hosted on there. Big sharing and open-source-work-contribute-to-others vibe on there.
If you’re not too hot about the language you started, or a framework/library you’re using, then switch it up. Different languages were designed in drastically different ways. Some of them might just make more sense to you personally or are a more intuitive way to approaching problems. Two major contrasting paradigms are object-oriented programming vs. Functional programming.
Have fun! Feel free to message me with any questions you have.