1.4
No description yet. This curated deck is ready for daily study.
Card preview (24)
Low Level Languages
• Unique for each CPU Type • Each has it’s own Assembler • Generates one machine code instruction per 1 assembly instruction EG Assembly
Low Level Languages Uses
• Device Drivers • Embedded Systems • Custom Hardware
Low Level Advantage
• Small Storage Requirements (Embedded Systems) • Fast Execution Speed (Fighter Jet Eject System)
High Level Languages
• Uses Human-like commands (English) • Generates many machine code instruction per 1 line of code EG Java
High Level Languages Advantages
• Easier to learn/program • Identifiers can be long and meaningful (classes, variables, methods) • They allow the use of powerful in-built commands that perform quite complex tasks e.g. random( ) • Allows creation of modules that can be re-used and accessed by other parts of the program
High Level Languages Use
General applications EG Payroll
Procedural Programming Paradigms
• The programmer defines how they want the program to run • Based on algorithms • Obey (ordered) instructions • Carrying out actions / calculations etc.
Procedural Paradigm Advatages
• Logical Step-by-step process for solving a problem • Allows the programmer a way to define precisely each step when performing a task • Close control over the operation of hardware • Similar operations may be carried out at varying stages of the program execution
Event Driven Programming Paradigms
• High level programming language • Waits for a user interaction (Button Click, Keyboard Press) • Particularly suitable for developing GUI and Games • Programmer must think of events and triggers
Visual Programming Paradigms
• High level programming language (EG Scratch: Also Event-Driven) • Manipulate program constructs graphically rather than textually (EG Drag and drop blocks of code) • Easier to learn • More intuitive because visual (no syntax) • Very good help systems
Visual Paradigms Disadvantages
• Limited Screen Space • Not ideal for larger programs • Takes longer than typing for experienced programmers
Markup Programming Paradigms
• Includes HTML, XML (Microsoft Word: .docx (Uses XML)) • Used to add meaning to text (link, bold etc) • Changes the format/display of the text • HTML (HyperText Markup Language) – Commands such as <h1> or <href> -- A start tag and end tag <h1>My Heading</h1></href> • XML (eXtensible Markup Language) –Structuring and marking up data for storage, not display –Developer can create own tags • Often combined with languages such as Javascript
Class
• Is a template for creating objects • An object is built from a class • Can have many instances of the same class
Object
• Is an instance of a class • Contains both attributes and methods
Method
• A program routine within an object to carry out a particular task on an object • Can be inherited from a superclass (Parent)
Advantages of OOP
• Improved productivity when developing software due to the flexible and extendable nature of OOP. • Software is easier to maintain as OOP is modular and reusable. • Development is faster due to the reusable code and libraries. • Development is cheaper. • Software can be tested more easily making it more high quality. • Software is easier to design as model the real world.
Disadvantage of OOP
• OOP is difficult and not as ‘logical’ to some developers, it is complex to create applications in. • Software can become larger – more code – than procedural programs. • OOP programs can run slower than PP as there is more code to execute. • OOP cannot be used for all types of software application such as machine learning and AI. • OOP can be difficult to debug.
Inheritance
• A Subclass takes on attributes and methods from a Superclass • Classes are ‘grouped’ by relationships • classes within the same group are defined by differences rather than similarities
+ Public
Can be inherited by any class
Protected Private
Can be inherited by any class within the package
• Private
Can be accessed by only within its own class
Encapsulation
• The technical implication is hidden within the object • The process of keeping data within a class secret • Private variables can only be accessed by public methods
Polymorphism
• Polymorphism allows many similar versions of a method (with the same name) • Multiple versions are then available, still with the same name
Event Driven GUIs
• A listener is attached to a button/key • When detected, the sequence assigned to that listener is executed