We Write Programs Using Programming Languages

First Let's Talk About Natural Languages

A Programming Language…

QUESTION - (header) What are some characteristics of programming languages?

This Makes Reading and Writing Programs Much Different From Natural Languages

Reading a Programming Language

Writing a Program

Sooo Many Programming Languages…

These Are 20 of the Most Used Languages Today

  1. Java
  2. C
  3. C++
  4. C#
  5. Python
  6. PHP
  1. JavaScript
  2. Visual Basic .NET
  3. Perl
  4. Assembly
  5. Delphi
  6. Ruby
  7. VisualBasic
  1. Swift
  2. Objective-C
  3. Groovy
  4. R
  5. MATLAB
  6. PL/SQL
  7. Go

That's a Lot!

QUESTION - (header) why so many?

Here Are Some Ways That We Can Describe Programming Languages

INFO - a lot of material, some not in readings… but most important parts are reinforced in readings, of course

Some Characteristics of Programming Languages Include:

  1. high-level and low-level
  2. interpreted and compiled
  3. by paradigm
  4. esoteric and mainstream

High-Level
and Low-Level
Languages

Low-Level Language

A programming language designed for execution by a computer. (Not so friendly.)

Low-Level Languages Look Like:

Assembly

MOV AL, 1h        ; Load AL with immediate value 1
MOV CL, 2h        ; Load CL with immediate value 2
MOV DL, 3h        ; Load DL with immediate value 3

Machine Code

10110000 01100001

High-Level Language

A programming language that is designed to be easy for humans to read and write.

Examples of Some High-Level Languages:

Ruby

100.times do |i|
	puts i if i % 2 == 0
end

PHP

<?php
$count = 0;
while($count < 100) {
	print($count);
	$count = $count + 2;
} ?>

High-Level vs Low-Level

Compiled and Interpreted

Two Ways to Execute a Program

Before a program can be executed, the source code of a high-level language must be translated into something that the computer can understand. You can:

Compiling a Program

Compiling a Program… Continued

General Workflow

  1. Write code
  2. Compile
  3. Execute program
  4. Go back to step #1

Examples of Compiled Languages

Interpreting a Program

Interpreting a Program… Continued

General Workflow

  1. Write code
  2. Execute program
  3. Go back to step #1

Examples of Interpreted Languages

Compiled vs Interpreted

And What Does This Mean for Us?

Despite the pros and cons of compiled and interpreted languages, for our purposes, the main difference between a compiled and interpreted language is:

Some Important Caveats

Programming Paradigms

Some Programming Paradigms

For This Class…

We'll mostly be concerned with imperative and procedural programming. (So don't worry about the others).

The tools that we use may include bits of object oriented programming.

And, Lastly… Is it Practical?

Esoteric vs Mainstream

Let's Use Python