Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Introduction to Programming

Introduction to Programming

Types of Software

  • Desktop applications
  • Web applications (via Firefox, Chrome, MS Edge)
  • Mobile applications
  • CLI - Command Line Interface
  • Embedded applications (space shuttle, car, fridge, pacemaker)

Computer Hardware Architecture

connectors

bits and bytes

base 10:        42
base 2:   00101010

 1 bit         0 or 1   (transistor)
 8 bit            256 = 1 byte
16 bit         65,536 = 64 kbyte
32 bit  4,294,967,296 = 4 Gb
64 bit  ~ 10 ** 20    = a lot

Y2K problem

  • Y2K

Y2K problem (time represented as the last two digit of the year.

Instead of 1985 we wrote 85 saved space, looked clear. You also knew that the year 86 was after the year 85 becasue 86 > 85. It worked until 1999, but when 2000 came it was (supposed to be) represented as 00.

Suddenly tomorrow was before yesterday.

Year 2000 problem

Year 2038 problem

Incorrect floating point number representation

e.g. in python:

1.2 - 1.0
0.19999999999999996

Operating Systems

Desktop / Server

Mobile

Embedded

  • VxWorks

  • Other Unix and Linux flavors

  • Routers (and other networking equipment)

  • Cisco IOS

  • What do weapon systems run?

Programming paradigms

  • Programming paradigms

  • imperative (global state, no functions)

  • procedural - imperative (C, Bash)

  • object oriented - imperative (Java, C#, C++)

  • declarative (SQL)

  • functional - declerative (Haskell)

  • logic - declerativ (Prolog)

  • mathematical - declerative (Fortran)

  • ...

Multi-paradigm: (e.g. Python, Perl)

Different OOP systems

  • Java - Hello World needs a class, but numbers and strings by themselves are not objects.
  • Python - Even strings and numbers are objects, but you can just write a single line to print.
print("Hello World")
public class HelloWorld {
    public static void main(String[] args) {
        System.out.println("Hello World");
    }
}
"abc".upper()

Compiled vs Interpreted languages

  • Compiled: C, C++
  • Interpreted: Basic, Shell
  • Python, Perl, ...?
  • Java, C#, ...?

Open Source

Why create Open Source?

Why do people create and maintain them? Why do companies contribute to Open Source and why do they release under OS license?

  • Fun, creative work
  • I wrote this thing, but I don't want to sell it so why not?
  • Get feedback
  • Contribute

Open Source business models

  • Undermine competitors (Google, now even Microsoft does it)

  • Create a huge user-base, a small fraction of it will pay money for hosting (MongoDB, Redis) or extra features (GitLab).

  • Get paied for support (e.g. RedHat)

  • Dual licenses (one version as GPL, other as some corporate-friendly license)

  • Get developer mind-share (VS Code by Microsoft, React by Facebook, ...)

Open Source languages

  • Are there multiple compilers/interpreters for the language?
  • Is the language definition free?
  • Are the compilers/interpreters Open Source?
  • IDEs ?
  • Profilers?

Version Control

  • Fearless experimentations
  • Fearless deletition
  • Easier (smoother) collaboration
  • History
  • git, mercurial; subversion; cvs; rcs

Software testing

  • Is it still working?
  • Fearless changes
  • Fearless upgrades
  • Regression testing!
  • Acceptance testing
  • capacity, load, security etc.

ASCII - Unicode

Complexity

O(n)
O(n^2)
O(n log n)

What is the Internet?

  • Computers
  • Networking equipment (routers, bridges, ...)
  • Cables
  • Wireless transmitters
  • Client-Server applications
  • Web Servers, Database servers, ...
  • ...

What is the Cloud?

  • The computer of some other people.
  • Server where you can rent some processing power.
  • More sofisticated if you can rent the use of an application.
  • Gmail
  • Google docs
  • Dropbox
  • Google Cloud Service, Amazon Web Services (AWS), Microsoft Azure

Software Development methods