Presentation is loading. Please wait.

Presentation is loading. Please wait.

Programming. Software is made by programmers Computers need all kinds of software, from operating systems to applications People learn how to tell the.

Similar presentations

Presentation on theme: "Programming. Software is made by programmers Computers need all kinds of software, from operating systems to applications People learn how to tell the."— Presentation transcript:

1 Programming

2 Software is made by programmers Computers need all kinds of software, from operating systems to applications People learn how to tell the computers what to do so that the computers do useful things Software on modern computers usually requires many instructions, millions sometimes so programmers work together in teams at software development companies

3 Programming skills Programmers need skills to write good programs Some can be learned, some are innate They need to be good communicators, both with machines and with people They should enjoy logic and mental puzzles Ideally they also have knowledge of the domain where their programs will be used

4 Programming Languages The first computer language was machine language, written in binary (first generation) Humans found it very very tedious Simple actions took hundreds of machine steps Humans had to translate their desired steps into machine instructions and then punch them in or toggle switches to make it happen

5 Assembly languages Soon the computer operators wanted an easier language to use (second generation) Assembly languages look a little like English – STO 4, X – JMP LAB1 – ADD 23, X – OUT X Still lots of steps but a little more understandable

6 Assembly languages But assembly language programs had to be translated back to machine code to be useful Machine code is the only language CPUs know The translating program is called an assembler There are still jobs for people who are good at assembly languages. Assembly is still used in game consoles, appliances, chips controlling machines, etc.

7 Higher Level Languages People still wanted easier languages to use, ones that were closer to how humans think instead of how computers work, more abstract (third generation, high-level languages) FORTRAN was the first commercially successful high-level language (Formula Translator), done in the 1950’s

8 Compilers High-level languages also need translator programs – they are called compilers and interpreters Other high-level languages are COBOL, Basic (all kinds of versions), C, C++, Java, Perl, Python Some have free translators, some translators cost money

9 How to Program Any programmer will have a routine to follow when given an assignment or deciding what they want to program UNDERSTAND THE PROBLEM – first! Sometimes they work through it by hand, sometimes they have to ask the customer / manager / employer questions about the details

10 How to, Part 2 Make a plan! A test plan! – Involves thinking about how to test the program Testing? It does not exist yet! But this early planning can give insights into how to solve the problem Make a design = writing an algorithm in pseudocode Pseudocode is a structured English, with no strict rules It’s a way to write a rough draft of a program before it actually gets put into a programming language

11 Test Plan Test Case Description InputsExpected OutputsActual Outputs Normal score in A range 92A Normal score in B range 84B Normal score in C range 72C Error due to wrong size of score -23Error message about value Error due to wrong type of input Aundetermined

12 Design in pseudocode Open the file for reading Get all the data from the file into a list Close the file Start the total at zero For each item in the list – Add the value of the item to a total – If the value is larger than 75, display a message Display the total

13 Programming Languages Languages (human and computer) have syntax and semantics The rules you learned in grammar school about spelling, punctuation, subject/verbs, parts of speech, etc. were syntax rules for English Programming languages have much stricter rules and will not work if you don’t follow them

14 Semantics The semantics of a human language is the meaning that the statements convey, the idea that you are trying to send from your brain to your listeners’ brains. The semantics of a programming language is what does the computer do when the program is translated to machine code and run by the CPU

15 Syntax to a human is not strictly necessary, we can get meaning from a statement which does not have perfect syntax (things like Twitter messages and text messages, for example) Syntax to a computer is required to be correct, so programmers have to have pretty good memories to remember the rules of the language

16 Errors When an English statement has an error, misspelling, wrong punctuation, wrong word, etc., we can usually figure out what is meant When a program has a syntax error, it cannot be translated, so it’s useless. Programmers get good at fixing syntax errors When a program has a semantics error, it is not doing what the programmer meant it to do (that’s called a bug)

17 Debugging Debugging (fixing mistakes in programs) is an art Programmers have tools to help them do this, but it is difficult. That’s one reason software packages have various versions. Bugs get fixed and the fixes are released to the customers

18 A career as a programmer Many people are employed as programmers – They may create new programs for their boss – They may maintain programs which are already written, debugging, modifying, updating, etc. Some people start their own companies to make the software they think will be useful or popular or profitable Some are self-employed contractors, hiring out to do programming jobs for different companies

Download ppt "Programming. Software is made by programmers Computers need all kinds of software, from operating systems to applications People learn how to tell the."

Similar presentations

Ads by Google