10. Principle Of Programming Flashcards
What is Procedural
Languages that use procedural paradigm work sequentially and are made up of a series of commands intended to be run one after another (e.g. C and Python) They are made up of statements including variable assignemnts,selection,iretation etc.
+ simplest programming
+ written in linear fashion
What is Visual
These makes use if intuitive user interfaces to help build programs rather than solely relying on text. the lack of remembering the syntax of a language helps developers spend more time considering the logic of the probelm. (e.g scratch)
- not ideal for larger or more advanced programs
- not much screen space avaiable
+ great for starting to learn code
What is Event-driven
Event driven highly relies on user interaction. The essential premise is that a program will sit in a loop waiting for the user to perform an action. When an action occurs, a function will run to process that action.
What is mark up?
Mark up langauges add comments or mark-up, to a text document to offer meaning to the text (e.g html,xml)
What is object orientated?
OOPs refers to languages that use objects in programming. Object-oriented programming aims to implement real-world entities in programming (e.g inheritance, polymorphism etc)
What are objects,classes, methods and attributes?
An object is a combination of data and the actions that can operate on that data.
A class is the definition of an object, it embodies all the information to create and manipulate objects of a particular type.
Methods are actions of the object and attributes is a description of the object.
What is inheritance in OOP?
When a child class inherits attributes and methods from a parent class so the code doesn’t have to be repeated. Th child class however will still have specific attributes for itself.
+simplifies/shortens code
+helpful for assigning multiple objects with the same attributes/methods
What is polymorphism?
Polymorphism - The ability of an object to take on many different forms; specifically for a method with the same name to have many different implementations.
High level language
- easier to undertstand, learn and program as commands are more english like
- identifers can be long and meaningful
- they allow the use of powerful commands and perform quite complex tasks
- allows creation of modules that can be reused and accessed by other parts of the program
examples: Python,java,C#
Low level languages
- Ideal when the execution speed is crtical
- more efficient than high level langauge programs
- requires less time for translation into machince code
- allow a programmer to create optimised programs
- when a computer system has limited resources, low level lang allow a programmer to more directly control how the resources are used
- more difficult to write requires understanding of the hardware being used
examples: machine code,assembly code
Encapsulation
The state of an object is private, and other objects can only interact with the object’s public methods.