Sie sind auf Seite 1von 17

Programming languages and their features

CG1.3, CG 1.4 & CG2.1

Low & High level programming languages

Before we hit the main difference between the two, it is vital to see what a programming language is and what it does. Why do we use them? Anyone? What do they do?

Programming languages

The origins of programming languages go WAY back! The important thing to remember is that EVERYTHING you do on a computer, whether it is a desktop, laptop or even mobile phone.

This will have come from somebody (or in most cases, a team) that have developed this in a programming language. Examples of things coded in a programming language

IS POWERED BY A PROGRAM OF SORTS

Operating systems (e.g. Windows 7/8, Mac OS) Applications such as Microsoft Word, App Inventor Games pretty much any format Custom made programs such as stock inventory systems

So a program does

Perhaps first and foremost - Its a way of automating an activity Its a way of communicating with a device or another application/program Its a way of writing to files, creating new files and accessing other files Do a bit of research yourself as to some other things a program does. Write these down. You have 5 minutes for this

Why do WE use programming languages?

It is obviously on a smaller scale! The time to build an operating system or similar would be incredibly long by yourself (not to mention nearly impossible for one person to do) Think about things you do on a regular basis on a computer (or on paper?). What could be sped up by using a program?

Write down a brief overview and explanation of 2 things where you think a program may be able to make life easier for you. You have 3 minutes for this

Low vs high level programming language

We will come back to this at a later point in the year. But for your coursework you will still need to be able to talk about the simple differences. A low level programming language is an older technique used to program for computers and CPUs. But it can still be very effective. It uses machine code to program instructions. The main problem with this though is that it requires someone of high skill to do that has an in-depth understanding of how a CPU works. Using a low level programming language can also mean that it is hard for others to come in, understand and edit someone elses program

So this is where high level programming languages come in

A high level programming language removes the need to fully understand machine code and instead allows someone to focus on coding in the functions needed by writing in more plain English Even though there are different high level programming languages available, many of them offer very similar features. Research 3 different types of high level programming languages and write down at least 2 advantages and 2 disadvantages for each. Python MUST BE ONE OF THESE. You have 10 minutes to do this

More on high level programming languages


So, you know that one of these high level programming languages is Python. This is what we will be using throughout Year 12 and 13. Why? Its free! Works well with other applications There is a big need in industry for programmers in Python (better for you!) As it is still a relatively young language (20+ years!) it is not going anywhere soon. Many languages have become less popular over time, this hasnt The range of modules, third party support and guidance out there for this is phenomenal. It is well respected by universities, oarticularly those where you are going on to study Computer Science and. It has all the great features that other high level programming languages have

Common features of high level programming languages


You will need to know these! So pay close attention! These will come up in some form time and time again particularly in your coursework, but also in your exams The following are in no particular order of relevance or importance Have a minute to prepare a section in your notes that is one you will retain well for the future.

Use of variables

Youve already used variables in Python They are a storage location and an associated name/identifier that contains either a known or unknown value You may remember that these can be things like

A computer stores a certain amount of space in its memory for the use of a variable. This varies depending on the data type and values contained. What do we mean when say memory? Discuss.. and write down the difference

Numbers (integers, real/float) Text (string values) Boolean values (True/False) etc.

Support of different data types

You should be aware already what these are but it is important to note what they are. Please make sure you have these recorded and written somewhere in your notes

Importing of modules

We discussed last lesson that Python has thousands of modules available for importing in (bringing them in for use) These all add extra features to Python that are additional to the ones built into Python For example, the Pickle module allows you to work with files outside of Python (e.g. write to text files, databases etc.) Quickly research another 3 modules that can be imported into Python. Write down what they do. You have 4 minutes to do this.

Arithmetic, calculations & formulas

This is very similar to what you do in maths based lessons or similar Simple things like adding (+), subtracting (-), division (/) and multiplication (*) are common features used It also supports things like <, >, >=, !=, == etc. Lookup what != and == do in Python. You have 2 minutes to research and record it

Procedures and functions

These are designed to make life easier for programmers They allow you to create a package of sorts that is a set of code you create that can be called upon at any time This saves you writing out the same code over and over again. An example could be a delete record function that is a set of code that can delete a record from a database. Rather than rewriting out the same code each time you want to do it, a function packages it all up and then can be called upon when needed Try and think of 2 or 3 things that a function may be useful for in code on a computer and write them down

Writing to files, reading files and editing files

Its all well and good having a program that can communicate within itself, but a lot of the time people and programs need their program to communicate with something outside of the program High level programming languages commonly allow files to be read, edited and saved through the language itself. Text files are the most basic they work with (and often one of the more common types) but the list goes on with things like CSV files and database files. Find out what an ODBC driver is and how it can be used in Python. Write down its function. You have 4 minutes for this

Ability to develop GUIs (Graphical User Interfaces)

Go back in time to anything before the early 1990s and you wont find pretty front ends on applications and programs. No windows, dialog boxes, buttons etc. All we had then was a good old fashioned command line! Times change though! Now, we are so used to using a mouse, buttons and windows to navigate around things its second nature to us. Behind it all thoughis still a command line High level programming languages allow you to build a GUI yourself which makes it easier for others to use your program. It can be very hard for a newcomer to a program to just use a command line. Find out what Tkinter is in Python and what it does. Then research PyQT. Write down notes from your research

Homework

Find out what the following are and make notes on each of them (a small paragraph for each will be fine). You MUST include the weblinks you have used otherwise the work will be considered invalid

IDEs (Integrated Development Environments) Compilers Interpreters Debugging/debugger Cross-compatability Open source software

Das könnte Ihnen auch gefallen