Principles of Programming Flashcards
Procedural Language
Procedural languages are used in traditional programming based on algorithms or a logical step-by-step process for solving a problem.
A language in which program statements can be grouped into self-contained blocks called procedures and functions.
They obey instructions
They carry out action/ calculations
A procedural programming language provides the programmer with a way to define precisely each step when performing a task.
Allows tight control over the underlying operation of the hardware. Used in large complicated programs where the same procedures are run out at varying stages of the program execution.
Event Driven
Event-driven programs are used when there is a heavy reliance on user interaction.
A program will sit in a loop, waiting for the user to perform an action.
An event, e.g. click a command button, initiates a sequence of code to be executed The event processor will then process the event and send it to the relevant listener. Events tend to take the form of an object or some specialised data. Event-driven programming requires the developer not think of their code in a linear fashion but rather as a set of actions triggered by the user.
Visual Language
Visual Languages make use of user interfaces and images to create programming languages rather than just text.
Mark up Language
Mark-up languages add commands, or mark-up, to a text document to offer meaning to the text. The commands give instructions to the program reading the file on how to interpret/format/and display the text. One of the most common mark-up languages is HTML. The commands in HTML are called tags and are surrounded by chevrons. The developer is free to create their tags and specify their meaning to them. Mark-up languages are commonly combined with other languages, such as JavaScript with HTML.
Object Oriented
Uses objects and classes - include both data and associated processing. Uses encapsulation, inheritance and polymorphism. A class defines the method properties for a group of similar objects. Once an object is created, knowledge of its implementation is not necessary for its use. Objects control how other objects interact with themselves, preventing other kinds of errors. An event, e.g. click a command button, initiates a sequence of code to be executed. Objects created using object-oriented languages can easily be reused in other programs.
+ Public
When you declare a method or an attribute as public, those methods and attributes
can be accessed by: The same class that declared it, the classes that inherit the above declared class and any foreign elements outside this class can also access those things.
Protected
When you declare a method or an attribute as public, those methods and attributes
can be accessed by: The same class that declared it, the classes that inherit the above declared class and outsider members cannot access those variables.
- Private
When you declare a method or an attribute as public, those methods and attributes
can be accessed by: The same class that declared it and outsider members cannot access those variables.