Comparative Flashcards
What is Object Oriented programming and give 3 examples
Programming style, using objects and classes to define the system
C#, Java and C++
What is procedural programming and name 3 examples
Programming style, structured around procedures/functions
Python, C and FORTRAN
What is functional programming and name 3 examples
Programming style, structured around higher order functions (closures), in a controlled manner
Lisp, Haskell and ML
What is declarative programming and name 3 examples
Strucutred around the things you want to be true
Prolog, ASP, Lisp
What does it mean for a programming language to have no style, and give an example
Unstructured language, so no support
Assembler, machine code
What is a “style” in the context of a programming language, and why are they needed?
An approach to programming or an aspect of the design of a programming language, designed to keep things structured, turning things into “blobs” to abstract finer detail
This is a near necessity with larger programs, especially if teams are working on it
Define what a “family” is in the context of programming and give some examples
A family is a collection of languages that share similar features and often have the same styling e.g. C - Procedural Haskell, Lisp - Functional Prolog, ASP - Logic Python - Procedural and scripting Java - Procedural and OOP
Reminder, they’re rather fuzzy and aren’t strictly defined
What is an unstructured language? Briefly describe it
No structure Used in early CS days Good only for small programs Allowed us to realise that structures are needed Assembly code
What is a procedural language? Briefly describe it
General programming, C, Fortran, Cobol, Pascal, Oberon, Agol, Basic, Maple
Use of functions to provide structure
What is a logic language? Briefly describe it
Prolog, ASP
Don’t describe how to do something, just what you want as an answer
Much less popular, difficult for general usage
Used in early AI
What is a functional language? Briefly describe it
General and symbolic programming
Lisp, Haskell, ML, Erlang, Scala
Use of higher order functions to provide structure and control complexity
Functions are first class (are values in their own right)
Datastructures are treated holistically (add one to all values in this vector, rather than iteratively adding one to each)
More natural way of thinking, if OOP and procedural wasn’t standard.
Better for parallel computing
What is a macro language? Briefly describe it
Improve readability of other code, abstraction and textual manipulation
Cpp, Latex, M4, Macros in Lisp
Usually lexical based
If you see something like this, replace it with that
Used in conjunction with other languages, i.e. C preprocessor to modify code
What is a scripting language? Briefly describe it
Control other elements of a system, program glue
DOS batch, sh, Python, Sed, Perl, ruby, JS
Not good at classical number crunching, but typically string processing
Often interpreted over compiled
What is an event driven language? Briefly describe it
Interactive systems
Visual Basic, Simula, SPICE, swing, Tcl/Tk, Qt, GTK
Typically event driven libraries using existing languages
Based on the concept of things happening off events rather than pre defined orders
Typically can be implemented in normal languges, but some like Simula are designed with it in mind
Gui
What is a simulation language? Briefly describe it
Simulation?
Objects interact by events (e.g. molecules colliding)
Triggers behaviour, change of direction for example
Simula, SPICE etc.