Programming Paradigms

From TRCCompSci - AQA Computer Science
Revision as of 12:03, 11 June 2018 by Admin (talk | contribs) (Created page with "=Paradigms= <youtube>https://www.youtube.com/watch?v=_iE5Tga8Jhw&list=PLCiOXwirraUAJPwNTW5gxfJK6Ej18fDP9</youtube> https://www.youtube.com/watch?v=_iE5Tga8Jhw&list=PLCiOXwirr...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Paradigms

https://www.youtube.com/watch?v=_iE5Tga8Jhw&list=PLCiOXwirraUAJPwNTW5gxfJK6Ej18fDP9

Object Oriented

OOP languages are based on the emulation of real world objects and their relationships and interactions with each other. The basis of object oriented programming is situated on the re-usability and conservation of large scale code/programming structures; for example, a video game makes extensive use of object oriented programming by defining complex object hierarchies, such as:

Object
Sprite
PlayableSprite
MainCharacter
EnemySprite
BossMonster
BufferMonster
StaticSprite
Block
TreasureChest

etc...

for more information see Object Orientated Programming

Event Driven

Event driven programs continuously run, the user will need to quit or exit to stop the program. You will have used these for windows form applications.

Events

These are actions by the user or the system

Components

reusable interface elements such as buttons, textbox, or labels etc. Events can happen to individual components.

Event Loop

This is the part that continuously runs, it is designed to listen for the events programmed by the developer. Once this section is run it will be run again, and again, and again. Hence the term event loop.

Trigger Functions

Trigger functions are added to the event loop for each event the program should detect. These trigger functions will be triggered when the specific event is detected.

Event Handler

The trigger function will run the event handler when triggered. The event handler is therefore the code to run when the event is detected.

Procedural

Your experience of C# is procedural, it is the process of replacing often repeating code by giving it a name for the sub routine. Then any time you wish to run the code you can simply call it by name.

Logical

Functional

for more information see Fundamentals of functional programming