Lesson Objectives Aims You should be able to
Lesson Objectives Aims You should be able to: 1. Identify points in a solution where a decision must be made 2. Determine logical conditions that affect the outcome of a decision 3. Determine how decisions affect flow through a program 4. Determine parts of a problem that can be tackled at the same time 5. Outline the benefits and trade offs that might result from concurrent processing in a solution
Note • Before we start: • You should’ve realised before now that this entire section is based on concepts that will make you a better programmer • There is no easy way to learn these techniques and “thinking logically” and the like will only come with practise • Some of these specification objectives are only possible to learn when you are coding a solution and solving the unique problems that arise • There is an expectation in 6 th form that you care about the subjects you take and are motivated, without us telling you, to study outside of school • Studying programming shouldn’t be seen as a hassle, it should be something that you’re interested in, motivated to do and want to learn by yourself • If you are not programming now, you are already falling behind.
Thinking Logically • This whole course is about thinking logically • It is the process of being able to: – Identify a problem – Break it down (decomposition) – Removing unnecessary complications and focussing on the true problem (abstraction) – Identifying concurrency, algorithms, efficiency savings etc – Designing the solution
Logic • Thinking logically mainly focusses on the ability to solve a given problem • You are only using a small set of rules or syntax to enable you to do this – What are the steps that must be taken? – In what order? – What is the eventual goal? – What decisions must be made?
Problem • The problem with “teaching” logical thought is that…. You either can or can’t! • You will only get better through practise and by solving problems by creating code • And inevitably debugging that code • So the coding challenges are incredibly important
Concurrency • Concurrency is the idea of doing multiple things at the same time • Some problems are very sequential in their nature- things must happen in order and each step relies on the previous • Some are much more parallel: – Whilst the kettle is boiling… – Go and get a cup and put a tea bag in it – Get the milk and pour in to the cup
Concurrency • This is made possible in modern machines through multi core processors • But concurrency does not only apply to computers – we can use it to: – Model projects – Suggest time savings in existing processes – Manage human resources
Benefits and Trade-offs of Concurrency • Faster processing – More things can happen during the same time window • Energy efficiencies – As more is being done each cycle, we use less energy • Efficient use of resources – Less idle processor time, more time available for other tasks – Less apparent lag when running a program
• Increased complexity – Programs must be specifically designed to work concurrently (threading) – Compilers need to be able to explicitly target multi-core architectures • Not suitable for all tasks – It is not possible to make all problems concurrent • Does not provide a doubling of speed – Some tasks may be more/less concurrent than others – Some threads may have to wait for the outcome of others to proceed
Practice paper – 1 b • A flight simulator is being developed to help train pilots…
- Slides: 11