26
© 2019 Adobe. All Rights Reserved. Adobe Confidential. Geek out with the smart language additions in ColdFusion 2018 Rakshith Naresh | Product Manager, Adobe Inc

Rakshith Naresh | Product Manager, Adobe Inc · Agenda for the day – ColdFusion 2018 language improvements You will love these changes! Object oriented adrenaline Asynchronous programming

  • Upload
    others

  • View
    2

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Rakshith Naresh | Product Manager, Adobe Inc · Agenda for the day – ColdFusion 2018 language improvements You will love these changes! Object oriented adrenaline Asynchronous programming

© 2019 Adobe. All Rights Reserved. Adobe Confidential.

Geek out with the smart language additions in ColdFusion 2018Rakshith Naresh | Product Manager, Adobe Inc

Page 2: Rakshith Naresh | Product Manager, Adobe Inc · Agenda for the day – ColdFusion 2018 language improvements You will love these changes! Object oriented adrenaline Asynchronous programming

© 2019 Adobe. All Rights Reserved. Adobe Confidential.

Programming languages introduced in the 90s

2

AMOS BASIC

AMPL

Object Oberon

Haskell

J

EuLisp

Z Shell (zsh)

GNU E

Oberon-2

Python

OzQ

Visual Basic

Borland Pascal

Dylan

Self

Amiga E

Revolution Transcript

AppleScript

K

Lua

R

ZPL

NewtonScript

ClaireANSI Common Lisp

RAPID

Pike

ANS ForthAda 95

Borland Delphi

ColdFusion (CFML)

JavaLiveScript

Mercury

PHP

Ruby

JavaScript

Curl

Lasso

Perl Data Language (PDL)

OCamlNetRexx

Component Pascal

E

Pico

Squeak Smalltalk

ECMAScript

F-Script

ISLISP

Tea

REBOL

Standard C++

M2001

Pikt

PureBasic

UnrealScript

XSLT (+ XPath)

Game Maker Language (GML)

Harbour

Page 3: Rakshith Naresh | Product Manager, Adobe Inc · Agenda for the day – ColdFusion 2018 language improvements You will love these changes! Object oriented adrenaline Asynchronous programming

© 2019 Adobe. All Rights Reserved. Adobe Confidential.

Relevant and well known in 2019

3

AMOS BASIC

AMPL

Object Oberon

Haskell

J

EuLisp

Z Shell (zsh)

GNU E

Oberon-2

Python

OzQ

Visual Basic

Borland Pascal

Dylan

Self

Amiga E

Revolution Transcript

AppleScript

K

Lua

R

ZPL

NewtonScript

ClaireANSI Common Lisp

RAPID

Pike

ANS ForthAda 95

Borland Delphi

ColdFusion (CFML)

JavaLiveScript

Mercury

PHP

Ruby

JavaScript

Curl

Lasso

Perl Data Language (PDL)

OCamlNetRexx

Component Pascal

E

Pico

Squeak Smalltalk

ECMAScript

F-Script

ISLISP

Tea

REBOL

Standard C++

M2001

Pikt

PureBasic

UnrealScript

XSLT (+ XPath)

Game Maker Language (GML)

Harbour

Page 4: Rakshith Naresh | Product Manager, Adobe Inc · Agenda for the day – ColdFusion 2018 language improvements You will love these changes! Object oriented adrenaline Asynchronous programming

© 2019 Adobe. All Rights Reserved. Adobe Confidential.

Agenda for the day – ColdFusion 2018 language improvements

You will love these changes!

Object oriented adrenaline

Asynchronous programming

All about arrays

Some additional goodness

What’s coming up?

4

Page 5: Rakshith Naresh | Product Manager, Adobe Inc · Agenda for the day – ColdFusion 2018 language improvements You will love these changes! Object oriented adrenaline Asynchronous programming

© 2019 Adobe. All Rights Reserved. Adobe Confidential.

You will love these changes!

• Null support

• Datatype preservation

5

Page 6: Rakshith Naresh | Product Manager, Adobe Inc · Agenda for the day – ColdFusion 2018 language improvements You will love these changes! Object oriented adrenaline Asynchronous programming

© 2019 Adobe. All Rights Reserved. Adobe Confidential.

Null support

• JavaScript to ColdFusion

• A null variable is undefined

• Database to ColdFusion

• A null value becomes “”

6

Page 7: Rakshith Naresh | Product Manager, Adobe Inc · Agenda for the day – ColdFusion 2018 language improvements You will love these changes! Object oriented adrenaline Asynchronous programming

© 2019 Adobe. All Rights Reserved. Adobe Confidential.

Datatype preservation

• CF used to interpret:

• “1234” as 1234

• “005678” as 5678

• “true” or “yes” to Boolean true

Now, CF preserves the type. Let’s take a look at CFFiddle!

7

Page 8: Rakshith Naresh | Product Manager, Adobe Inc · Agenda for the day – ColdFusion 2018 language improvements You will love these changes! Object oriented adrenaline Asynchronous programming

© 2019 Adobe. All Rights Reserved. Adobe Confidential.

Object oriented adrenaline

• Abstract

• Default functions in interface

• Final

8

Page 9: Rakshith Naresh | Product Manager, Adobe Inc · Agenda for the day – ColdFusion 2018 language improvements You will love these changes! Object oriented adrenaline Asynchronous programming

© 2019 Adobe. All Rights Reserved. Adobe Confidential.

ColdFusion Developers

• Code

• Meet deadlines

• Respond to urgent emails

• Be available on calls

9

Page 10: Rakshith Naresh | Product Manager, Adobe Inc · Agenda for the day – ColdFusion 2018 language improvements You will love these changes! Object oriented adrenaline Asynchronous programming

© 2019 Adobe. All Rights Reserved. Adobe Confidential.

ColdFusion Developers at CFSummit East

• Learn best practices

• Network with CF Devs

10

Page 11: Rakshith Naresh | Product Manager, Adobe Inc · Agenda for the day – ColdFusion 2018 language improvements You will love these changes! Object oriented adrenaline Asynchronous programming

© 2019 Adobe. All Rights Reserved. Adobe Confidential.

Asynchronous programming - The dilemma of conference travel

11

Work Conference

Page 12: Rakshith Naresh | Product Manager, Adobe Inc · Agenda for the day – ColdFusion 2018 language improvements You will love these changes! Object oriented adrenaline Asynchronous programming

© 2019 Adobe. All Rights Reserved. Adobe Confidential.

Tasks associated with the dilemma

12

Work

• RespondToUrgentEmails• MeetDeadlines• BeAvailableOnCalls Conference

• Promise to Boss to show ROI• Implement at least

three best practices learnt at the conference

• Promise to self – have good time• Network with other

ColdFusion developers

Page 13: Rakshith Naresh | Product Manager, Adobe Inc · Agenda for the day – ColdFusion 2018 language improvements You will love these changes! Object oriented adrenaline Asynchronous programming

© 2019 Adobe. All Rights Reserved. Adobe Confidential.

Pseudo code

while (your business trip does not end)

{

checkUrgentEmails();

workToMeetDeadlines();

checkForImportantCalls();

}

13

Page 14: Rakshith Naresh | Product Manager, Adobe Inc · Agenda for the day – ColdFusion 2018 language improvements You will love these changes! Object oriented adrenaline Asynchronous programming

© 2019 Adobe. All Rights Reserved. Adobe Confidential.

The runasync magic

runAsync(learnBestPractices);

while (your business trip does not end)

{

checkUrgentEmails();

workToMeetDeadlines();

checkForImportantCalls();

}

14

Page 15: Rakshith Naresh | Product Manager, Adobe Inc · Agenda for the day – ColdFusion 2018 language improvements You will love these changes! Object oriented adrenaline Asynchronous programming

© 2019 Adobe. All Rights Reserved. Adobe Confidential.

The runAsync Magic with a future

var future = runAsync(learnBestPractices);

while (your business trip does not end)

{

checkUrgentEmails();

workToMeetDeadlines();

checkForImportantCalls();

}

15

Page 16: Rakshith Naresh | Product Manager, Adobe Inc · Agenda for the day – ColdFusion 2018 language improvements You will love these changes! Object oriented adrenaline Asynchronous programming

© 2019 Adobe. All Rights Reserved. Adobe Confidential.

The runAsync Magic - chaining

var future = runAsync(learnBestPractices).then(networkWithCFDevs);

while (your business trip does not end)

{

checkUrgentEmails();

workToMeetDeadlines();

checkForImportantCalls();

}

16

Page 17: Rakshith Naresh | Product Manager, Adobe Inc · Agenda for the day – ColdFusion 2018 language improvements You will love these changes! Object oriented adrenaline Asynchronous programming

© 2019 Adobe. All Rights Reserved. Adobe Confidential.

The runAsync Magic - timeout

var future = runAsync(learnBestPractices, 0.5 day).then(networkWithCFDevs);

while (your business trip does not end)

{

checkUrgentEmails();

workToMeetDeadlines();

checkForImportantCalls();

}

17

Page 18: Rakshith Naresh | Product Manager, Adobe Inc · Agenda for the day – ColdFusion 2018 language improvements You will love these changes! Object oriented adrenaline Asynchronous programming

© 2019 Adobe. All Rights Reserved. Adobe Confidential.

The runAsync Magic – error handler

18

var future = runAsync(learnBestPractices).then(networkWithCFDevs).error(getStuckInDCTraffic);

while (your business trip does not end)

{

checkUrgentEmails();

workToMeetDeadlines();

checkForImportantCalls();

}

Page 19: Rakshith Naresh | Product Manager, Adobe Inc · Agenda for the day – ColdFusion 2018 language improvements You will love these changes! Object oriented adrenaline Asynchronous programming

© 2019 Adobe. All Rights Reserved. Adobe Confidential.

The runAsync Magic – time for result

19

var future = runAsync(learnBestPractices).then(networkwithCFDevs).error(getStuckInDCTraffic);

while (your business trip does not end)

{

checkUrgentEmails();

workToMeetDeadlines();

checkForImportantCalls();

}

future.get();

Page 20: Rakshith Naresh | Product Manager, Adobe Inc · Agenda for the day – ColdFusion 2018 language improvements You will love these changes! Object oriented adrenaline Asynchronous programming

© 2019 Adobe. All Rights Reserved. Adobe Confidential.

Syntax

future = runAsync(func,1).then(thenFunc).error(errorHandler);

Set of APIs on future

get()

get(timeout)

get(timeout, timeUnit)

isDone()

cancel(mayInterruptIfRunning)

isCancelled()

then(UDFMethod)

then(UDFMethod, timeout)

error(UDFMethod)

error(UDFMethod, timeout)

Page 21: Rakshith Naresh | Product Manager, Adobe Inc · Agenda for the day – ColdFusion 2018 language improvements You will love these changes! Object oriented adrenaline Asynchronous programming

© 2019 Adobe. All Rights Reserved. Adobe Confidential.

All about Arrays

• Typed Array

• Negative index

• Slicing

21

Page 22: Rakshith Naresh | Product Manager, Adobe Inc · Agenda for the day – ColdFusion 2018 language improvements You will love these changes! Object oriented adrenaline Asynchronous programming

© 2019 Adobe. All Rights Reserved. Adobe Confidential.

Some additional goodness

Optional semi colon

22

Page 23: Rakshith Naresh | Product Manager, Adobe Inc · Agenda for the day – ColdFusion 2018 language improvements You will love these changes! Object oriented adrenaline Asynchronous programming

© 2019 Adobe. All Rights Reserved. Adobe Confidential.

What’s coming up?

Support for Lambda

Array functions – pop,push,shift,unshift,splice

Query functions –

Updated querynew, queryappend, queryprepend, queryrowswap, queryslice, queryclear

Some, Every – array, struct, query

23

Page 24: Rakshith Naresh | Product Manager, Adobe Inc · Agenda for the day – ColdFusion 2018 language improvements You will love these changes! Object oriented adrenaline Asynchronous programming

© 2019 Adobe. All Rights Reserved. Adobe Confidential.

Here is a trick question before we wrap up!

24

Page 25: Rakshith Naresh | Product Manager, Adobe Inc · Agenda for the day – ColdFusion 2018 language improvements You will love these changes! Object oriented adrenaline Asynchronous programming

© 2019 Adobe. All Rights Reserved. Adobe Confidential.

All code samples are on CFFiddle

Make sure to login to fiddle to view the code samples.

Here is the link for all the code

Page 26: Rakshith Naresh | Product Manager, Adobe Inc · Agenda for the day – ColdFusion 2018 language improvements You will love these changes! Object oriented adrenaline Asynchronous programming