1/28
Looks like no tags are added yet.
welke generation programming languages zijn er
first gen
seconde gen
third gen
first generation programming languages
machine level language
no translator to compile of assemble
made of binary numbers represented by 1s and 0s
instructions are execueted directly by the central processing unit

second generation programming language : assembler
uses a mnemonic to represent each low level machine instruction or opcode;
load: LD instead of 1
add integer: ADDI insted of 5
store ST instead of 3
also use if variables instead of memory locations
“price” instead of memory location ‘6c ‘
“shipcharge” instead of memory location “6d”
one to one relationship between machine instructions and assemler instructions :
programmer still has to think in funcyion of machine instruction s
inherently machine specific (mnemonic name for each machine instruction)
conversion of program in assembler language into machine language by mean of an assembler program
the first assembly language was developed in 1947 by kathleen booth

wat is een assembler
Een assembler is een programma dat verantwoordelijk is voor het vertalen van assemblytaal, een laag-niveau programmeertaal, naar machinecode die door een computer kan worden uitgevoerd.
third generation programming language
generational way to cathegorize high level computer programming languages (ex: if, for, while, )
cosidered high level because the are closer to human languages
are much more machine independent and more programmer friendly
each primitive corresponds to multiple machine instructions
first introduction in late 1950s
coversion from program to machine language using a compiler/ interpreter
all modern programming languages are 3rd generation
bij 3de gen zijn de vertaling naar machinetaal gevormd door
compilers : who will fully translate the program into machine code. (PASCAL, COBOL, MODULA) in a first phase, the compiler will checj whether there are no syntax errors in the program. These are errors against the rule of the language. The translation will begin only if no syntax errors are present
interpreters : where every instruction is executed immediatly after it has been translated. (python)
welke soorten datatypes bestaan er
single predifined types (enkelvoudige voorafgedefinieerde types)
self built single types (enkelvoudige zelfgedefinieerde types)
self built multiple types (array type, aggregated type, file type)

data type : single predefined type (enkelvoudige voorgedefinieerde types) (vb)
integer : whole numebrs (pos, neg)
float (real) : with numbers after the comma
boolean : true/ false
character : symbol (e.g a letter ) / string in python
data type : single predefined type (enkelvoudige voorgedefinieerde types) (remarks)
pseudo code had no type declaration
some programming languages (ex python) also do not
=> untypes languages, variales do not receive a type declaration
in non typed languages, the compiler/ interpreter will determine the type of each variable befor converting into machine instructions
data type : self built single types
1 enumerated types or list or vector
in older languages : identical data units
in modern languages (python) : mixed types
always one dimentional (but a list of list is possible)
numbr of elements can grow or shrink
in python : see also “tuple” and “set”
2 interval types ;
twenties = 20..29 (interval van integer)
workday = monday .. friday (interva van WeekdayList)

self built multiple types welke soorten
array types
aggregated data type (record type)
file type
self built multiple types : array types
block of identical data units
with a fixed number of dimensions (1= row, 2= matrix, >2 = tensor)
with a fixed number of elements in each dimension

self built multiple types : aggregated type (record type)
=> block of mixed data units
=> in python ; dictionary
combinatie van meervoudige types

self built multiple types : file type
unlimited data units
=> bestanden worden bewaard in het extern geheugen, alle andere variabele types in het intern geheugen
elementen van de file een per een inlezen en stockeren in het intern geheugen
records worden een per een uit de bestand in de RAL ingelezen tot EOF
speciaal geval is de text file
werken met EOF (end of file) en EOLN (end of line)
=> plaats winst omdat je niet op voorrand de grootte dient aan te duiden (externe geheugen = gegevens worden bewaart)

primitieven
elementaire, fundamentele gegevenstypen die rechtstreeks worden ondersteund door de programmeertaal zelf. Primitieve gegevenstypen vormen de bouwstenen waarmee complexere gegevensstructuren worden opgebouwd. De exacte set van primitieven kan variëren tussen programmeertalen, maar hier zijn enkele veelvoorkomende voorbeelden:
all GPL3 have very similar primitives, sometimes with slightly different syntax
these also correspond to the primitives introduced for pseudo-code
in pyhton ;
z= x+y

calculation rules in expressions
uitgevoerd van links naar rechts
voorrangsregels : haakjes, functies, macht, */, +-, vergelijkingsoperatoren = > <>
resultaat van vergelijkingsoperatoren is steeds boolean
operatoren en voorrangen bij boolean

primitives : 2.1) controle statement GOTO

primitives : 2.2) controle statement if

primitives : 2.3 ) controle statement while

primitives: 2.5) controle statelent

primitives : 3) comment/ annotations
explanation wtitten between instructions
very helpful for a person to better understand what a program or piece of code does
is ignored by the compiler
in python : # this is a comment
primitives : 4) procedures en of functions
in python word alles function genoemd
maar in andere talen w er een onderscheid gemaakt tussen functie en procedure
functie : levert een waarde op
procedure is een sequentie van acties binnen het hoofdprogramma maar die appart staan
= modules = mini programma’s
def FunctionNAme(part1[par2..])
call in python : FunctionName (arg1 [, arg 2..])
voorgedefiieerd efuncties in python

wat is de nut van een parameter bij procedures en functies
op welke manieren gebeurt dat
= methode om waarden aan een procedure/ functie te geven
pass by value : een kopie van de waarde/ variabele wordt doorgegeven, deze lokale kopie w daarna gewist
pass by reference : is een referentie naar de waarde/ variabele => zelfde register => veranderingen zijn permanent
