Ndu06 typesof language


Published on

Published in: Technology
1 Like
  • Be the first to comment

No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide

Ndu06 typesof language

  1. 1. Types of Programming LanguageSoftware Design and Development 1
  2. 2. Programming LanguagesProcedural languagesObject-orientated programmingEvent Driven ProgrammingMark-up languagesScripting languages 2
  3. 3. Procedural LanguagesEarly programs used these inc. Windows DOSThe program controls what happens not theuser although they will accept inputProcedural languages work on the basis ofexplicitly telling the computer ‘how to dosomething’ by using a sequence of commandscalled imperatives e.g. do this, then do that etc Examples are C, Fortran, Pascal, and Basic 3
  4. 4. Procedural Languages Tasks are broken into a number of stages known as procedures or subroutines Each procedure carries out a specific taskAn example procedure (using Pascal) which calculates the average of two numbers inputted by the user and displays the result readln(Num1) read first number from keyboard and put value in variable Num1 readln(Num2) read second number from keyboard and put value in variable Num2 Average:=(Num1+Num2)/2 calculate average of Num1 and Num2 and place the result in variable Average writln(Average) Display the value of variable Average on the screen 4
  5. 5. Object-orientated programming (OOP) Is relatively new and not used until the 1990’s when programs got more complex The program is broken down into objects, not lists of instructions Each object can perform tasks and communicate with other objects An object contains related data and procedures (or methods) which together define the behaviour of that object (i.e. how it respond to events) 5
  6. 6. Object-orientated programming (OOP) The object can be thought of as a small machine with a set job An objects provides services in response to messages (events) triggered by other objects or end-users who request these services Event Method request Method Method Object Data Client service Method Method Messages Encapsulation / information hiding 6
  7. 7. Object-orientated programming (OOP) Unlike procedural programming, the programmer does not need to know the code which is ‘behind’ each object making it work They only need to know the attributes and methods of each object and how to make it interact with other objects They then use the objects as ‘building blocks’ to make the program do what they want it to Example OO languages are Java, C# and VB.NET 7
  8. 8. Event Driven ProgrammingThese are used to create software which has agraphical user interface (GUI), such asWindows programsED languages have procedural features butalso have OO capabilities Examples of Event Driven languages are VB.NET, C# and C++ 8
  9. 9. Event Driven ProgrammingEvent driven design has 2stagesFirst the programmer designsthe GUI, placing objects suchas textboxes, buttons andlabels onto a formThen they write the codewhich gives the functionalityto the program 9
  10. 10. Markup LanguagesA markup language is not a true programminglanguage as they do not contain instructions tocontrol the flow of the program.markup languages give instructions to controlthe format and layout of a fileThis information is in the form of tags forstructure or presentationThe programmer can insert tables forstructure, images, hyperlinks and text usingtags 10
  11. 11. Markup LanguagesThe best-known markup example is HypertextMarkup Language (HTML), used on the WorldWide Web Example: <title>Home Page</title> <style type="text/css" media="screen"> @import "stylesheets/public.css"; body { background-color: white }; </style>Another example is XML (Extensible MarkupLanguage) which allows users to write theirown tags 11
  12. 12. Scripting languagesWhere web pages need to carry outprogramming functions the code for this hasto be included within the HTML using ascripting language. An example of this is JavaScript or vbscriptScripting languages can be typed in directlyfrom a keyboard and the language used willbe specific to each application 12
  13. 13. Scripting languagesSome are used to execute a series ofcommands that would otherwise have to betyped in via a keyboard / mouseThese can be used to control the operatingsystem and are known as a shell scriptlanguage e.g. Windows PowershellOthers allow users to writeshort, simple, programs or add functionality toapplications e.g. macros in Access or Excel 13
  14. 14. Which language to use depends on: Organisational policy – your company may be ‘tied’ to Microsoft or Macintosh Will it work on the hardware already used? Does it do what we need it to? Are current staff trained in its use? Is it reliable? Important for safety-critical systems! Costs of developing and maintaining programs Will it be expandable in future? 14