1 / 49

PROGRAMMING LANGUAGES

PROGRAMMING LANGUAGES. VB.NET XML JavaScript. Visual Basic.NET. evolved from BASIC (Beginner’s ALL Purpose Symbolic Instruction Code ) developed in the mid-1960’s by Prof. John Kemeny and Thomas Kurtz. Visual Basic.NET. event driven visual programming language

jaegar
Download Presentation

PROGRAMMING LANGUAGES

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. PROGRAMMING LANGUAGES VB.NET XML JavaScript

  2. Visual Basic.NET evolved from BASIC (Beginner’s ALL Purpose Symbolic Instruction Code) developed in the mid-1960’s by Prof. John Kemeny and Thomas Kurtz

  3. Visual Basic.NET event driven visual programming language an object-oriented programming language designed by Microsoft

  4. Visual Basic.NET Encapsulation Allows your program to treat objects as black boxes Polymorphism One object can have different forms depending on the situation Reuse By using containment and delegation

  5. READABILITY Simplicity and Orthogonality

  6. READABILITY Control Structure

  7. READABILITY Data Types and Structure

  8. READABILITY Syntax Design uses special words in forming compound statements primarily in control constructs (such as If/Then/Else)

  9. WRITABILITY Simplicity and Orthogonality Control Structure Dim firstname = "Phil“ If firstname = "Bill" Then MsgBox"firstname is Bill" Else MsgBox"firstname is not Bill“ End If

  10. WRITABILITY Data Types and Structure Syntax Design Dim value As Integer = Integer.Parse(Console.ReadLine()) Select Case value Case 1 Console.WriteLine("You typed one") MsgBox("You typed one") Case 2 Console.WriteLine("You typed two") MsgBox("You typed two") Case 5 Console.WriteLine("You typed five") MsgBox("You typed five") Case Else Console.WriteLine("You typed something else") MsgBox("You typed somethinig else") End Select

  11. WRITABILITY Abstraction Public MaximumSpeed as _ Integer Public ModelName as String Public Sub Accelerate() 'Some code to make the car go End Sub Public Sub Stop() 'Some code to make the car stop End Sub

  12. WRITABILITY Expressivity

  13. RELIABILITY Type Checking Exception Handling Restricted Aliasing

  14. COST Migrating from any other language to Visual Basic .NET could cost companies on the order of $43,000 per developer, research from the Gartner Group

  15. PORTABILITY can only be compiled and run through the .NET framework which only runs on windows

  16. XML • eXtensible Markup Language • Markup: a text-based notation for describing data • A widely supported open technology for describingdata • The standard format for data exchanged betweenapplications over the Internet. • permits document authors to create markupfor virtually any type of information

  17. XML • NOT replace HTML • Foundation for several next-generation Webtechnologies • XHTML, RSS (Blogs), Ajax, Web Services • can be used to create entirely new markup languages that describe specific types of data,including mathematical formulas, chemicalmolecular structures, music and recipes. • describes data in a way that human beingscan understand and computers can process.

  18. XML • http://www.w3schools.com/xml/xml_validator.asp

  19. XML Parser in the Browser • When a user loads an XML document in a browser, a parser parses the document, and the browseruses a style sheet to format the data for display

  20. XML Elements • The root element of an XML document encompasses all its other elements • XML element names can be of any length and cancontain letters, digits, underscores, hyphens andperiods • XML element names must begin with either a letteror an underscore, and they should not begin with “xml” in any combination of uppercase andlowercase letters, as this is reserved for use in theXML standards

  21. DOCUMENT TYPE DEFINITIONS • DTDs and schemas specify documents’ element typesand attributes, and their relationships to one another • DTDs and schemas enable an XML parser to verifywhether an XML document is valid (i.e., its elementscontain the proper attributes and appear in the propersequence) • In a DTD, an ELEMENT element type declaration defines the rules for an element. An ATTLIST attribute-list declaration defines attributes for a particular element

  22. NAMESPACES • XML namespaces provide a means for document authors to prevent naming collisions • Each namespace prefix is bound to a uniform resource identifier (URI) that uniquely identifies thenamespace • We declare a default namespace using keyword xmlns with a URI (Uniform Resource Identifier) asits value

  23. W3C XML SCHEMA DOCUMENTS • which to define your XML document structure andlimitations. • XML schemas provide a set of basic types, such asinteger, byte, string and floating point numbers. • XML schemas provide an Object Oriented approach. • The author of an XML schema can use basic types,along with various operators and modifiers, tocreate complex types of their own.

  24. XSL AND XSLT • XSL is a style sheet language for XML documents. • XSL is more than a style sheet language. XSL consistsof two parts: • XSLT – a language for transforming XML documents • XPath – a language for navigating in XML documents • XSL style sheets can be connected directly to an XMLdocument by adding an xml:stylesheet processinginstruction to the XML document

  25. READBILITY • XML is the first language that makes documents both human-readable and computer-manipulable • It is the language of the intelligent document, a step ahead of conventional methods of document representation that rely on format rather than structure

  26. WRITABILITY • XML declaration: identifies the version of XML used. • XML tags are case sensitive. • Each start tag must have a matching end tag. • Using a white space character in a XML element name is an error. • XML element names should be meaningful to humans and should not use abbreviations.

  27. WELL FORMED vs. VALID XML • Well-formed XML documents • Matching start tag and end tag • Valid XML documents • One that has been tested against a set of rules • These rules are specified as either DTD or XMLschema files

  28. RELIABILITY • XML provides a common syntax for messaging systems for the exchange of information between applications. • If everyone uses the same syntax it makes writing these systems much faster and more reliable.

  29. PORTABILITY • XML is an open standard, there is a wide selection of tools for implementing it • XML can be used on a wide variety of platforms and interpreted with a wide variety of tools.

  30. COST • enables a nonprogrammer to do things that would have previously required extensive knowledge of scripting languages or thousands of dollars worth of custom software • text-based, so anybody can create an XML document with even the most primitive text processing tools.

  31. JavaScript • Scripting language which is used to enhance thefunctionality and appearance of web pages. • All major web browsers contain JavaScript interpreters, which process the commands written in JavaScript.

  32. JavaScript • JavaScript allows for interactivity • Browser/page manipulation • Reacting to user actions • A type of programming language • Easy to learn • Developed by Netscape • Standardized by European Computer Manufacturers Association (ECMA) • www.ecma-international.org/publications/standards/ECMA-262.HTM

  33. How JavaScript works • Embedded within HTML page • View source • Executes on client • Fast, no connection needed once loaded • Simple programming statements combined with HTML tags • Interpreted (not compiled) • No special tools required

  34. JavaScript compared to Java

  35. JavaScript • Often, JavaScripts appear in the <head> section ofthe HTML document. The browser interprets thecontents of the <head> section first • The <script> tag indicates to the browser that thetext that follows is part of a script. Attribute typespecifies the scripting language used in thescript—such as text/javascript

  36. CONTROL STRUCTURES • Sequential execution • Statements execute in the order they are written • Transfer of control • Next statement to execute may not be the next one in sequence • Three control structures • Sequence structure • Selection structure • if • if…else • switch • Repetition structure • while • do…while • for • for…in

  37. JavaScript Keywords

  38. JavaScript Statements <html> <head><title>My Page</title></head> <body> <script language="JavaScript"> document.write('This is my first  JavaScript Page'); </script> </body> </html> Note the symbol for line continuation

  39. HTML written inside JavaScript JavaScript Statements <html> <head><title>My Page</title></head> <body> <script language="JavaScript"> document.write('<h1>This is my first  JavaScript Page</h1>'); </script> </body> </html>

  40. JavaScript Statements <html> <head><title>My Page</title></head> <body> <p> <br /> <a href="myfile.html" onMouseover="window.alert('Hello');"> My Page</A> </p> </body> </html> JavaScript written inside HTML An Event

  41. CHARACTERISTICS • Dynamically typed • Standard operator precedence • Overloaded operators • Reserved words

  42. CHARACTERISTICS • Strings are very common data types • Rich set of methods available • Arrays have dynamic length • Array elements have dynamic type • Arrays are passed by reference • Array elements are passed by value

  43. EXAMPLES • Division with / is not integer division • Modulus (%) is not an integer operator • 5 / 2 yields 2.5 • 5.1 / 2.1 yields 2.4285714285714284 • 5 % 2 yields 1 • 5.1 % 2.1 yields 0.8999999999999995

  44. WRITABILITY • Browser contains a complete set of objects that allow script programmers to access and manipulate every element of an HTML document • Every statement should end with a semicolon (alsoknown as the statement terminator), althoughnone is required by JavaScript • JavaScript is case sensitive • Not using the proper uppercase and lowercaseletters is a syntax error

  45. WRITABILITY • A variable name can be any valid identifier consisting of letters, digits, underscores ( _ ) and dollar signs ($) that does not begin with a digit and is not a reserved JavaScript keyword. • JavaScript does not require variables to have a type before they can be used in a script • A variable in JavaScript can contain a value of any data type, and in many situations, JavaScript automatically converts between values of different types for you • JavaScript is referred to as a loosely typed language

  46. WRITABILITY • Comments in JavaScript • <script> // a single line comment /* a multiline comment */ </script>

  47. RELIABILITY • From a core language standpoint, it is a reliable language for small applications. • From a browser implementation standpoint, it is not so reliable because different browsers behave differently. • Garbage Collection • JavaScript knows when a program no longer needs a variable or object • Automatically cleans up the memory

  48. PORTABILITY • As long as there is support for it, Javascript will work on all browsers and all Operating Systems • window.navigator • Has information about the current browser • Properties include • appName (Netscape or Microsoft Internet Explorer) • appVersion • userAgent • appCodeName (not useful) • platform (operating system) • language (e.g., en or fr)

  49. COST • JavaScript is free and open-source

More Related