- Typed vs. untyped languages (just to introduce the concept of a type)
- Static vs. dynamic type-checking
- Implications for how objects are stored in memory (static type-checking implies objects are of a predictable size)
- Duck typing
- Implicit type conversions (JS) vs. strong typing (Ruby, Python)
Programming is about communication. It's communication between a human and a computer, but it's also communication between humans and other humans, and between humans and their own future selves. To program, you have to fully elucidate your ideas and record them so that both computers and humans can understand you.
Languages facilitate this kind of communication. Programming languages have to be designed with the computer in mind, but they should also be designed to accommodate humans.
Of course, using comments and out-of-code documentation, you can and should communicate to humans independently from your code. But the program code also needs to be its own documentation, both because actual code and its documentation frequently disagree and because sometimes program code is itself the most elegant way to express an idea.
Languages themselves are software, and they're made up of specificiations and implementations. Ideally, the specifications d
--- For instance, you'd think addition is dead simple, right? a + b = c. But in machine code, there's no platonic idea of a number; it's all just ones and zeroes in fixed-length slots in memory. Let's say your CPU register is 16 bits, of which the largest unsigned integer you can store is 65535 (2^16-1, the "-1" because of zero). If "a" is 60000 and "b" is 10000, then what is "c"? Ruby is smart enough to recognize that c will be too large for the CPU to handle in one 16-bit word, so it will break the problem up behind the scenes. It will correctly answer 70000. The logic to do all of the work behind the scenes to handle the conversion from one-word to multiple-word numbers and display the result as a single number involves the execution of thousands of lines of machine code. ---
--- There are three big downsides to using compilers as vs. writing machine code yourself:
One, compilers themselves tend to be slow to run, because they're so complex. So every time you change anything in your program,