Intro Programming
Top Programming Languages (2018)
https://spectrum.ieee.org/at-work/innovation/the-2018-top-programming-languages
There are 256 programming languages in the world
There are 6,500 spoken languages in the world
Some languages are 'compiled' and some are 'interpreted'
Compiled languages are converted directly into machine code with a compiler that the processor can execute.
Fortran, C, C++
Interpreters will run through a program line by line and execute each command.
Python, JavaScript, Ruby
Say "Hello World" in 4 different languages
Fortran
program hello
print *, "Hello World!"
end program hello
C
#include <stdio.h>
int main()
{
printf("Hello, World!");
return 0;
}
C++
#include <iostream>
using namespace std;
int main()
{
cout << "Hello, World!";
return 0;
}
Python
print("Hello, World!")
Scientific Computing
Start with a simple model (equations)
Program & validate to see if it describes the physical system
Improve the model (add more physics & features)
Program & validate to see if it describes the physical system
Rinse & Repeat
Let's really program!
We will use Trinket, an online Python interactive development environment (IDE)
We will program in Python2 and Python3. Huh?
Languages change over time - new features are added, old features removed to make programming easier or more powerful