Presentation is loading. Please wait.

Presentation is loading. Please wait.

ITP © Ron Poet Lecture 1 1 IT Programming Introduction.

Similar presentations


Presentation on theme: "ITP © Ron Poet Lecture 1 1 IT Programming Introduction."— Presentation transcript:

1 ITP © Ron Poet Lecture 1 1 IT Programming Introduction

2 ITP © Ron Poet Lecture 1 2 No Programming Experience  We assume that many students on this course have never programmed.  The course will be geared to these students.  It is hoped that all students will be able to program reasonably well by the end of Further Programming.

3 ITP © Ron Poet Lecture 1 3 If You Have Programmed Before  The initial parts of the programming course will appear straightforward.  But the approach may be different to the one you have taken in the past.  At some point the programming ‘train’ will go past your current ability.  You should be on the train for a smooth transition.  Rather than having to jump onto a moving train.

4 ITP © Ron Poet Lecture 1 4 Keeping Connected  You should attend the lectures even if you have programmed before.  That way you notice new things as they appear.  You should attend the labs and do the labwork.  You can go when you have finished.  You should read ahead in the text book.  And do some of the textbook exercises in the lab.

5 ITP © Ron Poet Lecture 1 5 Initial Programming Labs  You will be part of a lab group, with a tutor and a demonstrator to help with problems.  There will be labwork each week.  There will be regular exercise which you should complete during the lab.  They will be marked by your tutor during the lab.

6 ITP © Ron Poet Lecture 1 6 Further Programming Labs  Later exercises will be assessed.  You will have to hand them in.  The programs will be submitted electronically.  So that we can run them.  You will get written feedback after they are marked.

7 ITP © Ron Poet Lecture 1 7 Talking with Computers  Computers are machines and don't understand anything.  They cannot resolve ambiguities by drawing on experience.  Computers are unbelievably pedantic about grammar.

8 ITP © Ron Poet Lecture 1 8 Machines  Because computers are machines, like DVD players.  They will not ‘understand what you mean’ if you get the instructions slightly wrong.  You need to develop a mental model of how computers work to be able to program them well.

9 ITP © Ron Poet Lecture 1 9 Steep Learning Curve  Programming can be difficult at first.  It requires good problem solving skills.  It will be hard at first, and requires persistence.  Suddenly everything will click and programming will make sense.

10 ITP © Ron Poet Lecture 1 10 Ambiguous?  If you ask a person if they want fries or salad, they may reply  I'll have the salad, I value my health, or  I'm a Glaswegian, so it's fries.  A computer would reply  Yes!  Because it will choose one or the other.

11 ITP © Ron Poet Lecture 1 11 Grammar Freak  I might say "Glasgow is the best university in it's region"  You might reply  Yes, that's why I'm here, or  You would say that wouldn't you.  A computer would reply  Grammatical error!

12 ITP © Ron Poet Lecture 1 12 Does Not Understand  We could state the formula  radius = 10  CircleArea = 4 * radius * radius  A human would say  Where did you learn your maths?  A computer would say  The area of the circle is 400!

13 ITP © Ron Poet Lecture 1 13 Low Level Computer Languages  The Central Processing Unit (CPU) of a computer works with very basic instructions.  Even the simplest of operations involves a large number of very tedious steps.  Fortunately most programmers don't have to program at this level.  Although some do.

14 ITP © Ron Poet Lecture 1 14 High Level Languages  Almost all programming is done in a high level programming language.  A translation program is run to convert this to a low level language that the computer understands.  This low level language program is then run.

15 ITP © Ron Poet Lecture 1 15 Compiler  The translation program is called a compiler.  It will check for grammatical errors, called syntax errors.  Eventually, when the program is free of syntax errors, it produces an executable program.  This can then be run, or executed.

16 ITP © Ron Poet Lecture 1 16 Many Computer Languages  The instructions in a low level language must match the electronics on the chip.  There is not much room for variation.  The high level language has no such restrictions.  Provided a compiler can be written to translate the instructions into a low level language.  Plenty of scope for inventing languages.

17 ITP © Ron Poet Lecture 1 17 Why Java  All computer languages have advantages and disadvantages.  Java has the advantage that it is wide ranging.  Whatever you want to do, there is the Java way of doing it.  Thus there is a consistent way of solving computer problems.

18 ITP © Ron Poet Lecture 1 18 Object Oriented  There are many different styles of programming.  Object Oriented is currently the best.  Java is object oriented.  Object orientation makes it easier to write large programs.  Smaller programs can be more complicated then they need be.

19 ITP © Ron Poet Lecture 1 19 Program Development  Running Java programs needs:  An editor to create the program.  A compiler to produce the executable.  A way of integrating libraries.  A way of launching the program.  Basic System uses separate tools  A general purpose editor like notepad.  General purpose program development tools. Make, javac, java.

20 ITP © Ron Poet Lecture 1 20 Integrated Development Environment  This is a self contained program that provides everything.  The editor understands Java  The compiler can indicate where an error occurred by marking lines in the editor.  Libraries are automatically included.  It keeps track of program files.  We will use the IDE eclipse on this course.

21 ITP © Ron Poet Lecture 1 21 Developing a Program - Syntax  Start by creating the program text in the editor.  Compile the program.  This will normally generate syntax errors.  Keep editing the program until there are no more syntax errors.

22 ITP © Ron Poet Lecture 1 22 Developing a Program - Runtime  Run the program.  This will normally generate run time errors.  The grammar is correct but program will eventually try and do something illegal.  Keep editing the program until there are no more runtime errors.

23 ITP © Ron Poet Lecture 1 23 Developing a Program -Semantic  Test the program.  The program may run and appear to work.  But the logic is wrong.  These logical errors are called semantic errors.  Semantic errors are the hardest to remove.

24 ITP © Ron Poet Lecture 1 24 Finding Semantic Errors  Work out a number of scenarios.  Different ways in which the program can run.  Work out your expected results by hand.  Run the program with each scenarios.  If the results are different, find out why.  Print out intermediate values to locate the errors.  Develop the program bit by bit, checking as you go.

25 ITP © Ron Poet Lecture 1 25 In the Lab This Afternoon  Accessing our system  You will need a user name, which is public.  and a password, keep it secret.  The password we give you will not be very memorable.  Change it when you have time.  Using email  Most course announcements are by email.

26 ITP © Ron Poet Lecture 1 26 Try out eclipse  I will give you some programs to type in and see what happens.  You are not expected to know a single word of Java at this stage.  There will be time for discussion during the tutorial at the end of the day.

27 ITP © Ron Poet Lecture 1 27 Conduct in the Lab  It is good to discuss aspects of the course with other students.  If you want to help a fellow student,  teach them how to do things,  don't do it for them.  You must do the assessed exercises yourself.


Download ppt "ITP © Ron Poet Lecture 1 1 IT Programming Introduction."

Similar presentations


Ads by Google