SlideShare a Scribd company logo
Luciano Colosio
Good morning, my name is Luciano,
@unlucio
you can google me as unlucio.

I am a nerd and today I’ll be playing the prosecutor in this case
A Class Action
It is my pleasure to represent the people of this language as we’ll discuss a controversial matter dividing opinions in the last years.
ES6
ES2015
class
In 2012 a new keyword was proposed as a new addiction to what it will became better know as the 6th version of the ecma script standard
class
I beg you a moment to contemplate this word.

How can, such a small and simple word, be considered so harmful by many?
Ladies and gentleman of the jury, I will call three witnesses to the stand.
The Function
My first witness will be the Function.

We all here know the function, we are well aware of her meaning and powers.

It’s well known how her been higher order is an empowering feature in our daily job.

Did we really need a shorthand for manually defining a constructor Function?
The Prototype
As my second witness I call to the stand the Prototype.

This gentleman deeply influencing the nature of the language will see his daily job getting even more miss understood and hidden.
The Class
And at last I’d like to call to the stand The newly introduced Class.

Does she really add something new to the language? And most of all: will she simplify the life of everybody use to other languages and to the classical object oriented
programming?
So this was the idea: investigating a new feature through the scene of a trial.

And showing how our “class” character would turn out to be essentially conman.
it’s able to declare a constructor sure, just like the Function is able to do.

Adding properties and methods to the constructor’s prototype, just like we already use to do.

No matter how you look at it, hardly class can be defined as any kind of addiction to the language.
class
No matter how I looked at it but the class case was pretty simple
Sugar. Syntactic sugar.

This is how we quickly cut it off.

Almost as pointing out that is not such a big deal and it doesn’t change much: it’s suppose to make our life sweeter.
and It’s easy to get excited for stuff that seems to make our life sweeter.

Right?
I mean, think about promises.

They’re a great tool, I love them but it’s easy to get carried away.
not always:

I remember reading of promises as the solution to the Xmas tree hell
Yeah, but OOP is good for you… at least that what they say.
Don’t get me wrong: Classical oop is great, except when is not:

- Huge dependency trees can get messy and cause over structuring and over engineering
new GlassOfWater();
and all the sudden you find a reef in you drinking water because some how it ended up depending from the Ocean.
and any way Dispise you can create instances for “class” defined objects only using “new”, Class still doesn’t create a blueprint.

Applying the classical oop, often struggling with the prototypal inheritance, we want familiar instruments.
(it’s better to look at the graph from right to left)

Under the hood this is still happening and Object.create() is a way better and more expressive way to imply this kind of behaviour.

Just think about what’s happening here and what are the side effects: calls traversing the hidden links and going up in the chain to fulfil a request.
What is Prototypal inheritance?
but wait a second: there seems to still be some kind of confusion about prototypal inheritance?

Is it classes?

Is it blueprints?

Is it super?

No, none of these
Code Reuse
Isn’t it all the point? This is what we really care about

Write code once, use in multiple situations

(sometimes the most used way is still copy&paste)

prototypal inheritance makes this easy

don't think about new, super, and extends

don't even think about javascript's prototype property

Prototypal inheritance is about fallbacks
var base = {
firstName:"Luciano",
nickName:"unlucio",
getFullName: function() {
return `${this.firstName} (${this.nickName})`;
},
}; // base is the fallback
var obj = Object.create(base); // where the magic happens
obj.alertName = function() {
alert(this.getFullName());
};
obj.alertName(); // Luciano (unlucio)
// this is code reuse!
console.log(“getFullName" in obj) //true
console.log(obj.getFullName === base.getFullName) //true
it doesn’t seems to be that hard :D
This is pretty nice but actually I don’t remember the last time I used it.

actually i don’t remember the last time I really used inheritance anyway (in javascript).
On the other side as javascript widespread it’s impossible not to note how functional programming gains more and more traction.

Ramda, lodash, the introduction of promises, map, reduce in ES6
Is it classical oop still a thing?
Functional
VS
Object Oriented
So Which one should we use?
Functional -> minimised
Object Oriented -> segregated
It’s about State
Since the beginning as programs got more and more complex the “state” problem rises.

Pure functions shouldn’t deal with state, so we deal with the problem minimising the state.

In Object Oriented we package the state in units called objects.
And if you think about minimising the state and segregating what’s left over is something we do in distributed systems as well since dealing with lots and shared states
goes towards madness.
Functional
VS
Object Oriented
Functional
+
Object Oriented
What about using them together?
do we really need
class?
But…
Does class and classical oop really help in all this?

Well, minimising the state is something only our brains can really do at design time.

What about segregating what’s left?
What about modules?

- they have their own isolated scope

- they’re easily reusable (which is mostly what we care of)

- has its own scope and expose a convenient api (kind of like a service in a soa)

- seems pretty easier than what happens in, let’s say for example java ;P
Let’s just try to not go nuts on modules now ;)

I mean, the mind blowing growth of the javascript ecosystem is well known and very positive, but sometimes the frenzy for pushing and using the latest module can be
potentially harmful.

unpublishGate? Do we really need an pm module for 15 lines of code?
A D V I S O R Y
Controversial
Content
any way:

You might strongly disagree from this point on.

Let’s talk about coffee for an instant.
The espresso, as we enjoy it in Italy.

When coffee is good you don’t need sugar…
Some others might actually like it sugared.

I use to, until I tried and learned how more enjoyable coffee without sugar can be.

In the same way I understand why “class” was an highly requested feature, for years I used the classical oop and I still do in those languages where it makes sense.
And really, to me “class” seems really more like aspartame more than sugar.

The difference is that aspartame can kill you.
@sandropaganotti
4 years ago a friend come back form a conference in london telling me:

“Hey, you know what? Objects are just a side effect of functional programming” and he blew my mind starting my journey away form the classical OOP.
So by the end it’s always important to understand our tools, their meanings and how they work.
It’s not always easy, nor it’s quick and there are a million variable all around.

I changed many languages in my professional life. I was taught that the good computer science professional should learn at least 1 language per year.
But in case of javascript I always felt more like the general approach, rather than proving the necessary paradigm shift, it’s more about turning it in something more and
more familiar because for one reason or another more and more people need to deal with it and it’s easier to stay in our comfort zone.
In our career we all build up a pretty significant baggage of experiences
dedicated to @cirpo
But sometimes is good to let go, exit out confort zone and let it go.

Re-mesh all what we learned and what we know.

(please tweet to @cirpo the frozen song in your native language)
Because the real building blocks are simply all our experiences, and the real reusability comes from our ability to turn and compose around all what we know.
Thank you very much for
listening,
and happy coding.

More Related Content

Viewers also liked

Formulario completo
Formulario completoFormulario completo
Formulario completo
ChEli TOo
 
Maria Lasala
Maria LasalaMaria Lasala
Maria Lasala
Maria Lasala
 
function and skills of public relation by solomon shiwabaw
function and skills of public relation by solomon shiwabawfunction and skills of public relation by solomon shiwabaw
function and skills of public relation by solomon shiwabaw
Solomun Shiwabaw
 
DAFTAR RIWAYAT HIDUP
DAFTAR  RIWAYAT  HIDUPDAFTAR  RIWAYAT  HIDUP
DAFTAR RIWAYAT HIDUP
Devina Januarti
 
Cервисный центр «Экоконд групп» - Салон климатической техники
Cервисный центр «Экоконд групп» - Салон климатической техникиCервисный центр «Экоконд групп» - Салон климатической техники
Cервисный центр «Экоконд групп» - Салон климатической техники
Экоконд групп
 
Comparison Between Canadian And Us Class Actions Law And Practice
Comparison Between Canadian And Us Class Actions Law And PracticeComparison Between Canadian And Us Class Actions Law And Practice
Comparison Between Canadian And Us Class Actions Law And Practice
jyatesdahlgren
 
Fazendo videos com máquina fotográfica e celulares
Fazendo videos com máquina fotográfica e celularesFazendo videos com máquina fotográfica e celulares
Fazendo videos com máquina fotográfica e celulares
Marli Godoi
 
MLHEP Lectures - day 1, basic track
MLHEP Lectures - day 1, basic trackMLHEP Lectures - day 1, basic track
MLHEP Lectures - day 1, basic track
arogozhnikov
 
Amos
AmosAmos
Amos
Prason S
 
Class action suits
Class action suitsClass action suits
Class action suits
Altacit Global
 
Class Action Lawsuits Explained
Class Action Lawsuits ExplainedClass Action Lawsuits Explained
Class Action Lawsuits Explained
John Poulos (Sacramento)
 
Multidisciplinary analysis and optimization under uncertainty
Multidisciplinary analysis and optimization under uncertaintyMultidisciplinary analysis and optimization under uncertainty
Multidisciplinary analysis and optimization under uncertainty
Chen Liang
 
COMPANY PRESENTATION NOV-2014-EN-Eng & manuf. Process - Export
COMPANY PRESENTATION NOV-2014-EN-Eng & manuf. Process - ExportCOMPANY PRESENTATION NOV-2014-EN-Eng & manuf. Process - Export
COMPANY PRESENTATION NOV-2014-EN-Eng & manuf. Process - Export
Arie den Boer
 
Final Year Project Report
Final Year Project ReportFinal Year Project Report
Final Year Project Report
Daniel Howard
 
Cop %col lerning
Cop %col lerningCop %col lerning
Cop %col lerning
Jyøthish Us
 

Viewers also liked (15)

Formulario completo
Formulario completoFormulario completo
Formulario completo
 
Maria Lasala
Maria LasalaMaria Lasala
Maria Lasala
 
function and skills of public relation by solomon shiwabaw
function and skills of public relation by solomon shiwabawfunction and skills of public relation by solomon shiwabaw
function and skills of public relation by solomon shiwabaw
 
DAFTAR RIWAYAT HIDUP
DAFTAR  RIWAYAT  HIDUPDAFTAR  RIWAYAT  HIDUP
DAFTAR RIWAYAT HIDUP
 
Cервисный центр «Экоконд групп» - Салон климатической техники
Cервисный центр «Экоконд групп» - Салон климатической техникиCервисный центр «Экоконд групп» - Салон климатической техники
Cервисный центр «Экоконд групп» - Салон климатической техники
 
Comparison Between Canadian And Us Class Actions Law And Practice
Comparison Between Canadian And Us Class Actions Law And PracticeComparison Between Canadian And Us Class Actions Law And Practice
Comparison Between Canadian And Us Class Actions Law And Practice
 
Fazendo videos com máquina fotográfica e celulares
Fazendo videos com máquina fotográfica e celularesFazendo videos com máquina fotográfica e celulares
Fazendo videos com máquina fotográfica e celulares
 
MLHEP Lectures - day 1, basic track
MLHEP Lectures - day 1, basic trackMLHEP Lectures - day 1, basic track
MLHEP Lectures - day 1, basic track
 
Amos
AmosAmos
Amos
 
Class action suits
Class action suitsClass action suits
Class action suits
 
Class Action Lawsuits Explained
Class Action Lawsuits ExplainedClass Action Lawsuits Explained
Class Action Lawsuits Explained
 
Multidisciplinary analysis and optimization under uncertainty
Multidisciplinary analysis and optimization under uncertaintyMultidisciplinary analysis and optimization under uncertainty
Multidisciplinary analysis and optimization under uncertainty
 
COMPANY PRESENTATION NOV-2014-EN-Eng & manuf. Process - Export
COMPANY PRESENTATION NOV-2014-EN-Eng & manuf. Process - ExportCOMPANY PRESENTATION NOV-2014-EN-Eng & manuf. Process - Export
COMPANY PRESENTATION NOV-2014-EN-Eng & manuf. Process - Export
 
Final Year Project Report
Final Year Project ReportFinal Year Project Report
Final Year Project Report
 
Cop %col lerning
Cop %col lerningCop %col lerning
Cop %col lerning
 

Similar to A class action

Naming Things (with notes)
Naming Things (with notes)Naming Things (with notes)
Naming Things (with notes)
Pete Nicholls
 
Naming Things
Naming ThingsNaming Things
Naming Things
Pete Nicholls
 
Scottish Ruby Conference 2014
Scottish Ruby Conference  2014Scottish Ruby Conference  2014
Scottish Ruby Conference 2014
michaelag1971
 
Technology So Easy Your Lawyer Could Do It (OSCON 5/18)
Technology So Easy Your Lawyer Could Do It (OSCON 5/18)Technology So Easy Your Lawyer Could Do It (OSCON 5/18)
Technology So Easy Your Lawyer Could Do It (OSCON 5/18)
Zoe Landon
 
On Readability of Code
On Readability of CodeOn Readability of Code
On Readability of Code
Arun Saha
 
Don't demo facts. Demo stories! (handouts)
Don't demo facts. Demo stories! (handouts)Don't demo facts. Demo stories! (handouts)
Don't demo facts. Demo stories! (handouts)
Tudor Girba
 
What We Talk About When We Talk About Coding (Open Source Bridge 6/21)
What We Talk About When We Talk About Coding (Open Source Bridge 6/21)What We Talk About When We Talk About Coding (Open Source Bridge 6/21)
What We Talk About When We Talk About Coding (Open Source Bridge 6/21)
Zoe Landon
 
Tensorflow go
Tensorflow goTensorflow go
Tensorflow go
Patrick Walker
 
Monad Fact #6
Monad Fact #6Monad Fact #6
Monad Fact #6
Philip Schwarz
 
Oop concept
Oop conceptOop concept
Oop concept
Waseem Mehmood
 
Cognitive Shortcuts: Models, Visualizations, Metaphors, and Other Lies (Casca...
Cognitive Shortcuts: Models, Visualizations, Metaphors, and Other Lies (Casca...Cognitive Shortcuts: Models, Visualizations, Metaphors, and Other Lies (Casca...
Cognitive Shortcuts: Models, Visualizations, Metaphors, and Other Lies (Casca...
Sam Livingston-Gray
 
RubyConf 2022 - From beginner to expert, and back again
RubyConf 2022 - From beginner to expert, and back againRubyConf 2022 - From beginner to expert, and back again
RubyConf 2022 - From beginner to expert, and back again
mtoppa
 
Outline For Essay.pdf
Outline For Essay.pdfOutline For Essay.pdf
Outline For Essay.pdf
Michelle Green
 
Digital Rhetoric and Writing for April 23
Digital Rhetoric and Writing for April 23Digital Rhetoric and Writing for April 23
Digital Rhetoric and Writing for April 23
Miami University
 
Learning Basics for Course Developers
Learning Basics for Course DevelopersLearning Basics for Course Developers
Learning Basics for Course Developers
Jenny O'Donnell
 
Keynote talk: How to stay in love with programming (with notes)
Keynote talk: How to stay in love with programming (with notes)Keynote talk: How to stay in love with programming (with notes)
Keynote talk: How to stay in love with programming (with notes)
Camille Fournier
 
5.1 12 Rules to Learn to Code eBook [Updated 26.11.18].pdf.pdf
5.1 12 Rules to Learn to Code eBook [Updated 26.11.18].pdf.pdf5.1 12 Rules to Learn to Code eBook [Updated 26.11.18].pdf.pdf
5.1 12 Rules to Learn to Code eBook [Updated 26.11.18].pdf.pdf
BdBangladesh
 
Keeping Eloquent Eloquent
Keeping Eloquent EloquentKeeping Eloquent Eloquent
Keeping Eloquent Eloquent
Colin DeCarlo
 
Writing Clip Art Animated Free Clipa
Writing Clip Art Animated Free ClipaWriting Clip Art Animated Free Clipa
Writing Clip Art Animated Free Clipa
Jeff Nelson
 
C# o basico
C#   o basicoC#   o basico
C# o basico
Tiago
 

Similar to A class action (20)

Naming Things (with notes)
Naming Things (with notes)Naming Things (with notes)
Naming Things (with notes)
 
Naming Things
Naming ThingsNaming Things
Naming Things
 
Scottish Ruby Conference 2014
Scottish Ruby Conference  2014Scottish Ruby Conference  2014
Scottish Ruby Conference 2014
 
Technology So Easy Your Lawyer Could Do It (OSCON 5/18)
Technology So Easy Your Lawyer Could Do It (OSCON 5/18)Technology So Easy Your Lawyer Could Do It (OSCON 5/18)
Technology So Easy Your Lawyer Could Do It (OSCON 5/18)
 
On Readability of Code
On Readability of CodeOn Readability of Code
On Readability of Code
 
Don't demo facts. Demo stories! (handouts)
Don't demo facts. Demo stories! (handouts)Don't demo facts. Demo stories! (handouts)
Don't demo facts. Demo stories! (handouts)
 
What We Talk About When We Talk About Coding (Open Source Bridge 6/21)
What We Talk About When We Talk About Coding (Open Source Bridge 6/21)What We Talk About When We Talk About Coding (Open Source Bridge 6/21)
What We Talk About When We Talk About Coding (Open Source Bridge 6/21)
 
Tensorflow go
Tensorflow goTensorflow go
Tensorflow go
 
Monad Fact #6
Monad Fact #6Monad Fact #6
Monad Fact #6
 
Oop concept
Oop conceptOop concept
Oop concept
 
Cognitive Shortcuts: Models, Visualizations, Metaphors, and Other Lies (Casca...
Cognitive Shortcuts: Models, Visualizations, Metaphors, and Other Lies (Casca...Cognitive Shortcuts: Models, Visualizations, Metaphors, and Other Lies (Casca...
Cognitive Shortcuts: Models, Visualizations, Metaphors, and Other Lies (Casca...
 
RubyConf 2022 - From beginner to expert, and back again
RubyConf 2022 - From beginner to expert, and back againRubyConf 2022 - From beginner to expert, and back again
RubyConf 2022 - From beginner to expert, and back again
 
Outline For Essay.pdf
Outline For Essay.pdfOutline For Essay.pdf
Outline For Essay.pdf
 
Digital Rhetoric and Writing for April 23
Digital Rhetoric and Writing for April 23Digital Rhetoric and Writing for April 23
Digital Rhetoric and Writing for April 23
 
Learning Basics for Course Developers
Learning Basics for Course DevelopersLearning Basics for Course Developers
Learning Basics for Course Developers
 
Keynote talk: How to stay in love with programming (with notes)
Keynote talk: How to stay in love with programming (with notes)Keynote talk: How to stay in love with programming (with notes)
Keynote talk: How to stay in love with programming (with notes)
 
5.1 12 Rules to Learn to Code eBook [Updated 26.11.18].pdf.pdf
5.1 12 Rules to Learn to Code eBook [Updated 26.11.18].pdf.pdf5.1 12 Rules to Learn to Code eBook [Updated 26.11.18].pdf.pdf
5.1 12 Rules to Learn to Code eBook [Updated 26.11.18].pdf.pdf
 
Keeping Eloquent Eloquent
Keeping Eloquent EloquentKeeping Eloquent Eloquent
Keeping Eloquent Eloquent
 
Writing Clip Art Animated Free Clipa
Writing Clip Art Animated Free ClipaWriting Clip Art Animated Free Clipa
Writing Clip Art Animated Free Clipa
 
C# o basico
C#   o basicoC#   o basico
C# o basico
 

Recently uploaded

一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理
一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理
一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理
dakas1
 
E-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian Companies
E-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian CompaniesE-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian Companies
E-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian Companies
Quickdice ERP
 
A Comprehensive Guide on Implementing Real-World Mobile Testing Strategies fo...
A Comprehensive Guide on Implementing Real-World Mobile Testing Strategies fo...A Comprehensive Guide on Implementing Real-World Mobile Testing Strategies fo...
A Comprehensive Guide on Implementing Real-World Mobile Testing Strategies fo...
kalichargn70th171
 
Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...
Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...
Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...
XfilesPro
 
Preparing Non - Technical Founders for Engaging a Tech Agency
Preparing Non - Technical Founders for Engaging  a  Tech AgencyPreparing Non - Technical Founders for Engaging  a  Tech Agency
Preparing Non - Technical Founders for Engaging a Tech Agency
ISH Technologies
 
Top Benefits of Using Salesforce Healthcare CRM for Patient Management.pdf
Top Benefits of Using Salesforce Healthcare CRM for Patient Management.pdfTop Benefits of Using Salesforce Healthcare CRM for Patient Management.pdf
Top Benefits of Using Salesforce Healthcare CRM for Patient Management.pdf
VALiNTRY360
 
Kubernetes at Scale: Going Multi-Cluster with Istio
Kubernetes at Scale:  Going Multi-Cluster  with IstioKubernetes at Scale:  Going Multi-Cluster  with Istio
Kubernetes at Scale: Going Multi-Cluster with Istio
Severalnines
 
8 Best Automated Android App Testing Tool and Framework in 2024.pdf
8 Best Automated Android App Testing Tool and Framework in 2024.pdf8 Best Automated Android App Testing Tool and Framework in 2024.pdf
8 Best Automated Android App Testing Tool and Framework in 2024.pdf
kalichargn70th171
 
UI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
UI5con 2024 - Boost Your Development Experience with UI5 Tooling ExtensionsUI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
UI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
Peter Muessig
 
What’s New in Odoo 17 – A Complete Roadmap
What’s New in Odoo 17 – A Complete RoadmapWhat’s New in Odoo 17 – A Complete Roadmap
What’s New in Odoo 17 – A Complete Roadmap
Envertis Software Solutions
 
一比一原版(sdsu毕业证书)圣地亚哥州立大学毕业证如何办理
一比一原版(sdsu毕业证书)圣地亚哥州立大学毕业证如何办理一比一原版(sdsu毕业证书)圣地亚哥州立大学毕业证如何办理
一比一原版(sdsu毕业证书)圣地亚哥州立大学毕业证如何办理
kgyxske
 
ALGIT - Assembly Line for Green IT - Numbers, Data, Facts
ALGIT - Assembly Line for Green IT - Numbers, Data, FactsALGIT - Assembly Line for Green IT - Numbers, Data, Facts
ALGIT - Assembly Line for Green IT - Numbers, Data, Facts
Green Software Development
 
WWDC 2024 Keynote Review: For CocoaCoders Austin
WWDC 2024 Keynote Review: For CocoaCoders AustinWWDC 2024 Keynote Review: For CocoaCoders Austin
WWDC 2024 Keynote Review: For CocoaCoders Austin
Patrick Weigel
 
Why Apache Kafka Clusters Are Like Galaxies (And Other Cosmic Kafka Quandarie...
Why Apache Kafka Clusters Are Like Galaxies (And Other Cosmic Kafka Quandarie...Why Apache Kafka Clusters Are Like Galaxies (And Other Cosmic Kafka Quandarie...
Why Apache Kafka Clusters Are Like Galaxies (And Other Cosmic Kafka Quandarie...
Paul Brebner
 
Baha Majid WCA4Z IBM Z Customer Council Boston June 2024.pdf
Baha Majid WCA4Z IBM Z Customer Council Boston June 2024.pdfBaha Majid WCA4Z IBM Z Customer Council Boston June 2024.pdf
Baha Majid WCA4Z IBM Z Customer Council Boston June 2024.pdf
Baha Majid
 
INTRODUCTION TO AI CLASSICAL THEORY TARGETED EXAMPLES
INTRODUCTION TO AI CLASSICAL THEORY TARGETED EXAMPLESINTRODUCTION TO AI CLASSICAL THEORY TARGETED EXAMPLES
INTRODUCTION TO AI CLASSICAL THEORY TARGETED EXAMPLES
anfaltahir1010
 
Oracle Database 19c New Features for DBAs and Developers.pptx
Oracle Database 19c New Features for DBAs and Developers.pptxOracle Database 19c New Features for DBAs and Developers.pptx
Oracle Database 19c New Features for DBAs and Developers.pptx
Remote DBA Services
 
一比一原版(USF毕业证)旧金山大学毕业证如何办理
一比一原版(USF毕业证)旧金山大学毕业证如何办理一比一原版(USF毕业证)旧金山大学毕业证如何办理
一比一原版(USF毕业证)旧金山大学毕业证如何办理
dakas1
 
DECODING JAVA THREAD DUMPS: MASTER THE ART OF ANALYSIS
DECODING JAVA THREAD DUMPS: MASTER THE ART OF ANALYSISDECODING JAVA THREAD DUMPS: MASTER THE ART OF ANALYSIS
DECODING JAVA THREAD DUMPS: MASTER THE ART OF ANALYSIS
Tier1 app
 
GreenCode-A-VSCode-Plugin--Dario-Jurisic
GreenCode-A-VSCode-Plugin--Dario-JurisicGreenCode-A-VSCode-Plugin--Dario-Jurisic
GreenCode-A-VSCode-Plugin--Dario-Jurisic
Green Software Development
 

Recently uploaded (20)

一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理
一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理
一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理
 
E-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian Companies
E-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian CompaniesE-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian Companies
E-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian Companies
 
A Comprehensive Guide on Implementing Real-World Mobile Testing Strategies fo...
A Comprehensive Guide on Implementing Real-World Mobile Testing Strategies fo...A Comprehensive Guide on Implementing Real-World Mobile Testing Strategies fo...
A Comprehensive Guide on Implementing Real-World Mobile Testing Strategies fo...
 
Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...
Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...
Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...
 
Preparing Non - Technical Founders for Engaging a Tech Agency
Preparing Non - Technical Founders for Engaging  a  Tech AgencyPreparing Non - Technical Founders for Engaging  a  Tech Agency
Preparing Non - Technical Founders for Engaging a Tech Agency
 
Top Benefits of Using Salesforce Healthcare CRM for Patient Management.pdf
Top Benefits of Using Salesforce Healthcare CRM for Patient Management.pdfTop Benefits of Using Salesforce Healthcare CRM for Patient Management.pdf
Top Benefits of Using Salesforce Healthcare CRM for Patient Management.pdf
 
Kubernetes at Scale: Going Multi-Cluster with Istio
Kubernetes at Scale:  Going Multi-Cluster  with IstioKubernetes at Scale:  Going Multi-Cluster  with Istio
Kubernetes at Scale: Going Multi-Cluster with Istio
 
8 Best Automated Android App Testing Tool and Framework in 2024.pdf
8 Best Automated Android App Testing Tool and Framework in 2024.pdf8 Best Automated Android App Testing Tool and Framework in 2024.pdf
8 Best Automated Android App Testing Tool and Framework in 2024.pdf
 
UI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
UI5con 2024 - Boost Your Development Experience with UI5 Tooling ExtensionsUI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
UI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
 
What’s New in Odoo 17 – A Complete Roadmap
What’s New in Odoo 17 – A Complete RoadmapWhat’s New in Odoo 17 – A Complete Roadmap
What’s New in Odoo 17 – A Complete Roadmap
 
一比一原版(sdsu毕业证书)圣地亚哥州立大学毕业证如何办理
一比一原版(sdsu毕业证书)圣地亚哥州立大学毕业证如何办理一比一原版(sdsu毕业证书)圣地亚哥州立大学毕业证如何办理
一比一原版(sdsu毕业证书)圣地亚哥州立大学毕业证如何办理
 
ALGIT - Assembly Line for Green IT - Numbers, Data, Facts
ALGIT - Assembly Line for Green IT - Numbers, Data, FactsALGIT - Assembly Line for Green IT - Numbers, Data, Facts
ALGIT - Assembly Line for Green IT - Numbers, Data, Facts
 
WWDC 2024 Keynote Review: For CocoaCoders Austin
WWDC 2024 Keynote Review: For CocoaCoders AustinWWDC 2024 Keynote Review: For CocoaCoders Austin
WWDC 2024 Keynote Review: For CocoaCoders Austin
 
Why Apache Kafka Clusters Are Like Galaxies (And Other Cosmic Kafka Quandarie...
Why Apache Kafka Clusters Are Like Galaxies (And Other Cosmic Kafka Quandarie...Why Apache Kafka Clusters Are Like Galaxies (And Other Cosmic Kafka Quandarie...
Why Apache Kafka Clusters Are Like Galaxies (And Other Cosmic Kafka Quandarie...
 
Baha Majid WCA4Z IBM Z Customer Council Boston June 2024.pdf
Baha Majid WCA4Z IBM Z Customer Council Boston June 2024.pdfBaha Majid WCA4Z IBM Z Customer Council Boston June 2024.pdf
Baha Majid WCA4Z IBM Z Customer Council Boston June 2024.pdf
 
INTRODUCTION TO AI CLASSICAL THEORY TARGETED EXAMPLES
INTRODUCTION TO AI CLASSICAL THEORY TARGETED EXAMPLESINTRODUCTION TO AI CLASSICAL THEORY TARGETED EXAMPLES
INTRODUCTION TO AI CLASSICAL THEORY TARGETED EXAMPLES
 
Oracle Database 19c New Features for DBAs and Developers.pptx
Oracle Database 19c New Features for DBAs and Developers.pptxOracle Database 19c New Features for DBAs and Developers.pptx
Oracle Database 19c New Features for DBAs and Developers.pptx
 
一比一原版(USF毕业证)旧金山大学毕业证如何办理
一比一原版(USF毕业证)旧金山大学毕业证如何办理一比一原版(USF毕业证)旧金山大学毕业证如何办理
一比一原版(USF毕业证)旧金山大学毕业证如何办理
 
DECODING JAVA THREAD DUMPS: MASTER THE ART OF ANALYSIS
DECODING JAVA THREAD DUMPS: MASTER THE ART OF ANALYSISDECODING JAVA THREAD DUMPS: MASTER THE ART OF ANALYSIS
DECODING JAVA THREAD DUMPS: MASTER THE ART OF ANALYSIS
 
GreenCode-A-VSCode-Plugin--Dario-Jurisic
GreenCode-A-VSCode-Plugin--Dario-JurisicGreenCode-A-VSCode-Plugin--Dario-Jurisic
GreenCode-A-VSCode-Plugin--Dario-Jurisic
 

A class action

  • 1.
  • 2. Luciano Colosio Good morning, my name is Luciano,
  • 3. @unlucio you can google me as unlucio. I am a nerd and today I’ll be playing the prosecutor in this case
  • 4. A Class Action It is my pleasure to represent the people of this language as we’ll discuss a controversial matter dividing opinions in the last years.
  • 5. ES6 ES2015 class In 2012 a new keyword was proposed as a new addiction to what it will became better know as the 6th version of the ecma script standard
  • 6. class I beg you a moment to contemplate this word. How can, such a small and simple word, be considered so harmful by many?
  • 7. Ladies and gentleman of the jury, I will call three witnesses to the stand.
  • 8. The Function My first witness will be the Function. We all here know the function, we are well aware of her meaning and powers. It’s well known how her been higher order is an empowering feature in our daily job. Did we really need a shorthand for manually defining a constructor Function?
  • 9. The Prototype As my second witness I call to the stand the Prototype. This gentleman deeply influencing the nature of the language will see his daily job getting even more miss understood and hidden.
  • 10. The Class And at last I’d like to call to the stand The newly introduced Class. Does she really add something new to the language? And most of all: will she simplify the life of everybody use to other languages and to the classical object oriented programming?
  • 11. So this was the idea: investigating a new feature through the scene of a trial. And showing how our “class” character would turn out to be essentially conman.
  • 12. it’s able to declare a constructor sure, just like the Function is able to do. Adding properties and methods to the constructor’s prototype, just like we already use to do. No matter how you look at it, hardly class can be defined as any kind of addiction to the language.
  • 13. class No matter how I looked at it but the class case was pretty simple
  • 14. Sugar. Syntactic sugar. This is how we quickly cut it off. Almost as pointing out that is not such a big deal and it doesn’t change much: it’s suppose to make our life sweeter.
  • 15. and It’s easy to get excited for stuff that seems to make our life sweeter. Right?
  • 16. I mean, think about promises. They’re a great tool, I love them but it’s easy to get carried away.
  • 17. not always: I remember reading of promises as the solution to the Xmas tree hell
  • 18. Yeah, but OOP is good for you… at least that what they say.
  • 19. Don’t get me wrong: Classical oop is great, except when is not: - Huge dependency trees can get messy and cause over structuring and over engineering
  • 20. new GlassOfWater(); and all the sudden you find a reef in you drinking water because some how it ended up depending from the Ocean.
  • 21. and any way Dispise you can create instances for “class” defined objects only using “new”, Class still doesn’t create a blueprint. Applying the classical oop, often struggling with the prototypal inheritance, we want familiar instruments.
  • 22. (it’s better to look at the graph from right to left) Under the hood this is still happening and Object.create() is a way better and more expressive way to imply this kind of behaviour. Just think about what’s happening here and what are the side effects: calls traversing the hidden links and going up in the chain to fulfil a request.
  • 23. What is Prototypal inheritance? but wait a second: there seems to still be some kind of confusion about prototypal inheritance? Is it classes? Is it blueprints? Is it super? No, none of these
  • 24. Code Reuse Isn’t it all the point? This is what we really care about Write code once, use in multiple situations (sometimes the most used way is still copy&paste) prototypal inheritance makes this easy don't think about new, super, and extends don't even think about javascript's prototype property Prototypal inheritance is about fallbacks
  • 25. var base = { firstName:"Luciano", nickName:"unlucio", getFullName: function() { return `${this.firstName} (${this.nickName})`; }, }; // base is the fallback var obj = Object.create(base); // where the magic happens obj.alertName = function() { alert(this.getFullName()); }; obj.alertName(); // Luciano (unlucio) // this is code reuse! console.log(“getFullName" in obj) //true console.log(obj.getFullName === base.getFullName) //true
  • 26. it doesn’t seems to be that hard :D
  • 27. This is pretty nice but actually I don’t remember the last time I used it. actually i don’t remember the last time I really used inheritance anyway (in javascript).
  • 28. On the other side as javascript widespread it’s impossible not to note how functional programming gains more and more traction. Ramda, lodash, the introduction of promises, map, reduce in ES6
  • 29. Is it classical oop still a thing?
  • 31. Functional -> minimised Object Oriented -> segregated It’s about State Since the beginning as programs got more and more complex the “state” problem rises. Pure functions shouldn’t deal with state, so we deal with the problem minimising the state. In Object Oriented we package the state in units called objects.
  • 32. And if you think about minimising the state and segregating what’s left over is something we do in distributed systems as well since dealing with lots and shared states goes towards madness.
  • 35. do we really need class? But… Does class and classical oop really help in all this? Well, minimising the state is something only our brains can really do at design time. What about segregating what’s left?
  • 36. What about modules? - they have their own isolated scope - they’re easily reusable (which is mostly what we care of) - has its own scope and expose a convenient api (kind of like a service in a soa) - seems pretty easier than what happens in, let’s say for example java ;P
  • 37. Let’s just try to not go nuts on modules now ;) I mean, the mind blowing growth of the javascript ecosystem is well known and very positive, but sometimes the frenzy for pushing and using the latest module can be potentially harmful. unpublishGate? Do we really need an pm module for 15 lines of code?
  • 38. A D V I S O R Y Controversial Content any way: You might strongly disagree from this point on. Let’s talk about coffee for an instant.
  • 39. The espresso, as we enjoy it in Italy. When coffee is good you don’t need sugar…
  • 40. Some others might actually like it sugared. I use to, until I tried and learned how more enjoyable coffee without sugar can be. In the same way I understand why “class” was an highly requested feature, for years I used the classical oop and I still do in those languages where it makes sense.
  • 41. And really, to me “class” seems really more like aspartame more than sugar. The difference is that aspartame can kill you.
  • 42. @sandropaganotti 4 years ago a friend come back form a conference in london telling me: “Hey, you know what? Objects are just a side effect of functional programming” and he blew my mind starting my journey away form the classical OOP.
  • 43. So by the end it’s always important to understand our tools, their meanings and how they work.
  • 44. It’s not always easy, nor it’s quick and there are a million variable all around. I changed many languages in my professional life. I was taught that the good computer science professional should learn at least 1 language per year.
  • 45. But in case of javascript I always felt more like the general approach, rather than proving the necessary paradigm shift, it’s more about turning it in something more and more familiar because for one reason or another more and more people need to deal with it and it’s easier to stay in our comfort zone.
  • 46. In our career we all build up a pretty significant baggage of experiences
  • 47. dedicated to @cirpo But sometimes is good to let go, exit out confort zone and let it go. Re-mesh all what we learned and what we know. (please tweet to @cirpo the frozen song in your native language)
  • 48. Because the real building blocks are simply all our experiences, and the real reusability comes from our ability to turn and compose around all what we know.
  • 49. Thank you very much for listening, and happy coding.