We're going over how to teach yourself programming, how to make it easy to get into working with code. There's nothing wrong with looking to search engines, stackoverflow or asking an LLM (large language model) for help. In fact, experienced engineers do this and we'll go over how to do these things.
We'll cover two programming languages. Beginners often worry about making the wrong time investment and here I hope to demonstrate that languages have similar constructs and paradigms in common and the more important thing to learn is those, which can then be looked up in the language you need to work in. Once you know a few programming languages, it becomes easy to learn new ones.
For this class, we will do a quick overview of two popular languages, JavaScript and Python. Both are interpreted languages that you can start playing with right now from your browser without installing anything. We will cover how to do that and also how to develop in these languages on your computer. We will talk about the strengths of popular uses of these two languages and where they differ in syntax.
In each language, we will go over:
- Syntax and style
- Comments
- Hello, World
- Variables
- data types
- scope
- coercion
- const vs mutable
- Operators and order of operations
- Functions and methods
- Classes
We will begin with JavaScript, then move on to Python. We will focus on how using a REPL (read-eval-print-loop) to explore the features of a language, quickly test code, and even play around with website DOMs.
We'll introduce the following environments:
- JavaScript
- Browser (ALT+CTRL+I in Windows and Linux or ALT+APPLE+I in Mac)
- node interpreter
- Editing JavaScript files, then running them (introducing vscode).
- Websites for playing around in JavaScript such as jsfiddle, mdn playground and playcode.
- Python
- Python interpreter
- Jupyter notebooks
- Google's hosted, AI-powered Jupyter, Colab
Examples:
In js/developer console:
// Make all visible images transparent
for (let img of document.getElementsByTagName('img')) {
img.style.opacity = "0.5"
}
// Make default text color purple
document.body.style.color = "#ff00ff"
// Make that pesky source code disappear!
for (let pre of document.getElementsByTagName('pre')) pre.hidden = true
In jupyter or Google colab:
import matplotlib.pyplot as plt
# Simple equation
a = list(range(-10, 11))
b = [i ** 2 for i in a]
plt.plot(a, b)
# Let's plot a sin wave
import numpy as np
import math
a = np.arange(-6 * math.pi, 6 * math.pi, 0.1)
b = [math.sin(i) for i in a]
plt.plot(a, b)
We will then talk about different kinds of differences between programming languages, frameworks and even subcultures. Languages differ in syntax, by they also differ in conventions. Python relies heavily on conventions and people respecting them as opposed to having the interpreter or compiler enforce data access.
We will then talk briefly about other programming languages out there and where JavaScript and Python find themselves in the family tree, how to start teaching yourself a new programming language or framework.
π Sign up for one-on-one sessions or more free workshops from my CourseCareers Profile. You can also leave a review if you wish!
π Leave any feedback you have on this form. It helps me adjust what I include in my workshops.
π After I conclude this series in April, I will upload a version of this talk on this youtube channel.
π I do live open source development on this twitch channel.
π Here is a good resource on differences between Python and JavaScript