javascript for abap programmers - 1/7 introduction

11
JavaScript for ABAP Programmers Introduction Chris Whealy / The RIG

Upload: chris-whealy

Post on 10-May-2015

2.217 views

Category:

Technology


3 download

DESCRIPTION

JavaScript for ABAP Programmers Chapter 1 - Introduction to JavaScript

TRANSCRIPT

Page 1: JavaScript for ABAP Programmers - 1/7 Introduction

JavaScript for ABAP Programmers Introduction Chris Whealy / The RIG

Page 2: JavaScript for ABAP Programmers - 1/7 Introduction

© 2013 SAP AG. All rights reserved. 2

JavaScript’s Name – And the Resulting Confusion…

JavaScript was first developed by Brendan Eich at Netscape in 1995 (in 10 days). Originally this new

scripting language was called “Mocha”.

When Netscape Navigator 2.0 was shipped in September 1995, the language was renamed to

“LiveScript”.

However, when Netscape Navigator 2.0B3 was released on December 4th, 1995, Netscape made a

joint announcement with Sun Microsystems to the effect that Netscape’s new scripting language would

complement Sun Microsystem’s new Web application language Java; therefore, the new scripting

language would be called “JavaScript” – and this has caused no end of confusion ever since…

The bottom line is simply this…

JavaScript is NOT Java!

Page 3: JavaScript for ABAP Programmers - 1/7 Introduction

© 2013 SAP AG. All rights reserved. 3

JavaScript’s Linguistic Heritage

Over the course of the language’s development, various conceptual elements have been borrowed

from other languages to form what is now called JavaScript.

JavaScript

Page 4: JavaScript for ABAP Programmers - 1/7 Introduction

© 2013 SAP AG. All rights reserved. 4

JavaScript’s Linguistic Heritage

Over the course of the language’s development, various conceptual elements have been borrowed

from other languages to form what is now called JavaScript.

JavaScript

Page 5: JavaScript for ABAP Programmers - 1/7 Introduction

© 2013 SAP AG. All rights reserved. 5

JavaScript’s Linguistic Heritage

Over the course of the language’s development, various conceptual elements have been borrowed

from other languages to form what is now called JavaScript.

JavaScript

Scheme

Page 6: JavaScript for ABAP Programmers - 1/7 Introduction

© 2013 SAP AG. All rights reserved. 6

JavaScript’s Linguistic Heritage

Over the course of the language’s development, various conceptual elements have been borrowed

from other languages to form what is now called JavaScript.

JavaScript

Scheme

Perl

Page 7: JavaScript for ABAP Programmers - 1/7 Introduction

© 2013 SAP AG. All rights reserved. 7

JavaScript Standards

JavaScript was standardised by the European Computer Manufacturer’s Association (ECMA) in 1997.

JavaScript used in browsers is now considered to be only one implementation of the ECMA-262

specification.

Edition Date

1 June 1997

2 June 1998

3 December 1999

4 Abandoned

5 December 2009

5.1 June 2011

6 (Harmony) Work in progress

7 Work in progress

Page 8: JavaScript for ABAP Programmers - 1/7 Introduction

© 2013 SAP AG. All rights reserved. 8

JavaScript Runtime Engines

In order to execute a JavaScript program, a JavaScript Engine is needed.

Multiple implementations of JavaScript engines are available, with the most widely used being:

Chakra (Microsoft)

V8 (Google)

Nitro (Apple)

JavaScript Engine

SpiderMonkey (Mozilla) Rhino (Mozilla)

Page 9: JavaScript for ABAP Programmers - 1/7 Introduction

© 2013 SAP AG. All rights reserved. 9

JavaScript Runtime: Client Side Implementations

Modern JavaScript engines have been designed to run either from within a web browser or as stand

alone, server-side execution engines.

Browser

Google Chrome

Mozilla Firefox

Apple Safari

Microsoft Internet Explorer Chakra (Microsoft)

V8 (Google)

Nitro (Apple)

JavaScript Engine

SpiderMonkey (Mozilla)

Page 10: JavaScript for ABAP Programmers - 1/7 Introduction

© 2013 SAP AG. All rights reserved. 10

JavaScript Runtime: Server Side Implementations

There are multiple server-side implementations of JavaScript, many of which are based on Mozilla

Rhino (Java based). When speed is required however, Mozilla SpiderMonkey or the Google V8

engine are used instead.

Server Side Implementation

Chakra (Microsoft)

V8 (Google)

Nitro (Apple)

JavaScript Engine

SpiderMonkey (Mozilla) HANA XSJS

Accessible via

Page 11: JavaScript for ABAP Programmers - 1/7 Introduction

© 2013 SAP AG. All rights reserved. 11

In A Nutshell – The Main Differences Between ABAP & JavaScript

Understanding the differences between ABAP and JavaScript is fundamental to transferring your

existing programming skills into JavaScript. Some of the main differences are as follows:

ABAP JavaScript

Strongly typed Weakly typed

Syntax similar to COBOL Syntax derived from Java (and C)

Block scope Lexical scope

No equivalent concept Functions are 1st class citizens

OO using class based inheritance OO using referential inheritance

Imperative programming Imperative or Functional programming