SlideShare a Scribd company logo
Making a case for Scala :-
 Conciseness1: 40% less code than java without being obscure; not simply due to
boilerplate reduction.
This is beneficial initially but especially more so for maintenance. It offers large
productivity and time to market gains, and makes for happier developers and their C
level executives.
More developers go to work more productive, deliver more business value, and feel
good at the end of the day.
 a clean design is one that supports visual thinking so people can meet their
informational needs with a minimum of conscious effort. (www.visualmess.com)
 A reasonable conjecture would be that the cost of developing and maintaining an
application grows with the size of the application. Adding code without value is
waste.
 Scala has gone mainstream both in Financial Services and Stats communities,
particularly in Big Data Analysis due to functional composability and facilitating
strongly-typed simplified DSLs.
One reason for popularity is that verses an easy to understand DSL implemented in Scala
(without Scalas strong typing) one needs to have good IDE tool support for the DSL, and the
significant development effort for this tooling is avoided by using Scala DSLs at zero
cost. Time to market delays on DSL tool support are also avoided by using Scala.
http://news.efinancialcareers.com/uk-en/100268/smart-java-developers-need-to-skill-up-in-
scala/
 Support for Higher order functions - functions which take functions as arguments.
As a metaphor, higher order functions can be seen as mechanical power tools, into
which different drills or blades can be inserted to perform different operations.
Higher order functions are a powerful abstraction tool to separate concerns at different
levels, for example data structure and processing of data elements embedded in the
data structure.
This is key for analyzing BigData & Geo where large data collections require specific,
highly optimized and, in consequence, complex data structures.
Functional Languages like Scala cleanly implement support for these concepts,
including functional composition/chaining.
Ease of Parallization of data processing is also a major
benefit. http://java.dzone.com/articles/higher-order-functions
 Its not a case of Scala=good vs Java=bad. Scala is not a big leap from Java especially
now lambda support in Java 8 had been added (itself derived from Scala.)
An incremental adoption should be tried e.g. writing some of your test suite in Scala, or one
of your modules in Scala to get a feel for quality and benefit.
1
In Java, it feels very wasteful to keep repeating oneself due to weak abstractions and having
to write heaps of boilerplate code, all those getters, Comparators etc.
 Frameworks matter. Scala leverages all the java stack and frameworks e.g.
Hibernate/JPA/JTA. Compatibility with Java Libraries and visa versa including Java
Generics.
 Traits significantly improve code re-usability over Java. Traits are mix-ins; can be
used to implement strongly-typed compile-time dependency injection. They can also
be mixed-in at runtime. Traits improve design because a Single Responsibility
Principle can be implemented much more cleanly and easily than in Java. (A similar
concert to Dockers file system.)
 Using functions makes code more concise, readable, elegant, and reusable, since
functions are at lower level than objects and their inputs/outputs are easily understand.
Just like data, functions are composable. Functions can also Improve design reuse via
the Single Responsibility Principle.
 Scala has design idioms that reduce coding effort while increasing clarity. e.g.:
o case classes: that simplify domain object data classes by automatically
providing getters and setters, equals(), hashCode() ,toString(),copy().
o avoiding NPE (through 'Option: Some/None')
o avoiding complex nested If not null checks (through 'for comprehensions')
o non-blocking parallel task concurrency without obfuscating code with
exception handling or contingency workflows, timeouts etc. ('for
comprehensions')
o easy creation of functional data pipeline workflows, including error handling
and timeout contingencies ('for comprehensions')
o type aliasing - can be used to clarify primitive values used in maps/lists to
make maintenence easier
o DSL support to change legacy java APIs into simplified type-safe DSLs using
'implicits'
o higher order functions
o tuple datatypes allowing return values of more than one result
o more powerful 'case matching' statement than in Java that makes code simpler
and easier to read
o XML is first class citizen, part of the syntax.
o string parsing without + + + e.g. println(s"$activeTrj $scan")
o can easily enforce immutable state - concurrency friendly
o currying functional inputs - improves functional reuse opportunities, and
reduces bloat making code simpler to read.
 Studies indicate Scala's cognitively-denser language constructs make code
comprehension much simpler than corresponding equivalent Java code.
 With type-driven development you know your code will work as expected when you
compile it so you'll have no surprises at run-time.
These Benefits are documented as visible even amongst programmers with a limited grasp of
Scala. http://infoscience.epfl.ch/record/138586/files/dubochet2009coco.pdf
Moreover developers exposed to Scala describe using Java-like-style as “messy” and
“annoying”.
"Implementing the solution in Java would just be a bad approximation that makes me sad. It
takes 6 times the effort to complete, and is orders of magnitude more to maintain."
 Concurrency implementations can be orders of magnitude simpler to implement in
Scala vs Java, since Scala was designed first and foremost to be a SCALAble
language for the JVM.
Scala can also leverage frameworks that solve concurrency problems that are becoming more
and more important e.g. Actors, STM, shared read-only variable state etc.
The language offers easier to understand DSL syntax than available in Java APIs when the
same 3rd partly libraries are used, even when underlying libraries are written in Java.
 Scala offers a better programming model for concurrent programming. Java
implementations are very complex, very more so when dealing with exceptions
timeouts, and task contingencies are considered.
 Encapsulation is improved: Unlike Java, public interface pollution can be avoided - as
scala methods support definition of inner methods.
 No mixing of static and non-static code: Static objects are separated out into their own
distinct definitions.
 In Scala, the issue of java type erasure does not occur with arrays. For lists there are
workarounds with using TypeTags, or ClassTags or Manifests (deprecated.)
 Abstractions compose when types align. DSLs can model work seamlessly
across asynchronous boundaries. Futures and promises offer a way to design
compositional APIs that make this feasible.
Negatives:
 You need to be clear on the Lang. features that should be used and enforce them via
compiler options and coding standards, because its easier to write baffling code than
in Java.
At the end of the day no framework is immune to bad practice e.g. in Spring: pretending the
Java new operator doesn't exist anymore, and creating 10,000 LO-XML that is not statically
typed.
You also need to avoid non-ascii method names and operators unless developing a math
library.
 Compilation takes longer than Java, but this is mitigated with continuous background
compilation using SBT as best practice.
 As with Java 8 Lambdas, stack traces become bigger but typically you only need look
at the 1st and last elements and ignore the rest. Definitely heaps better than Javascript
traces though.
 Backwards compatibility has been an issue in the past, when one needed to recompile
source to new versions, but less so now.
 Currently Less expertise of FP in marketplace, than OO, although this is changing
with Java 8 Lambdas. FP is easy to adopt across a small team if one person has
learned it already.
 Scala support for Java 8 Lambda is available in v2.12.x, a wrapper function can
facilitate usage also in v2.11.8 as well as a compiler option.
 Performance tuning comes with experience. Ideally one should know what to avoid
doing, just like in Java. Looking at the generated class files can clarify what is
happening at a low level. Familiar tools like JProfiler also support Scala.
Scala a case4

More Related Content

What's hot

Big Data and Hadoop Guide
Big Data and Hadoop GuideBig Data and Hadoop Guide
Big Data and Hadoop GuideSimplilearn
 
Free Hibernate Tutorial | VirtualNuggets
Free Hibernate Tutorial  | VirtualNuggetsFree Hibernate Tutorial  | VirtualNuggets
Free Hibernate Tutorial | VirtualNuggetsVirtual Nuggets
 
Introduction to SAP Gateway and OData
Introduction to SAP Gateway and ODataIntroduction to SAP Gateway and OData
Introduction to SAP Gateway and ODataChris Whealy
 
Spark SQL Tutorial | Spark SQL Using Scala | Apache Spark Tutorial For Beginn...
Spark SQL Tutorial | Spark SQL Using Scala | Apache Spark Tutorial For Beginn...Spark SQL Tutorial | Spark SQL Using Scala | Apache Spark Tutorial For Beginn...
Spark SQL Tutorial | Spark SQL Using Scala | Apache Spark Tutorial For Beginn...Simplilearn
 
Front Range PHP NoSQL Databases
Front Range PHP NoSQL DatabasesFront Range PHP NoSQL Databases
Front Range PHP NoSQL DatabasesJon Meredith
 
A Deep Dive into Structured Streaming: Apache Spark Meetup at Bloomberg 2016
A Deep Dive into Structured Streaming:  Apache Spark Meetup at Bloomberg 2016 A Deep Dive into Structured Streaming:  Apache Spark Meetup at Bloomberg 2016
A Deep Dive into Structured Streaming: Apache Spark Meetup at Bloomberg 2016 Databricks
 
Advanced Excel
Advanced Excel Advanced Excel
Advanced Excel eduCBA
 
ICON UK '13 - Apache Software: The FREE Java toolbox you didn't know you had !!
ICON UK '13 - Apache Software: The FREE Java toolbox you didn't know you had !!ICON UK '13 - Apache Software: The FREE Java toolbox you didn't know you had !!
ICON UK '13 - Apache Software: The FREE Java toolbox you didn't know you had !!panagenda
 
Tcs Technical Question
Tcs Technical QuestionTcs Technical Question
Tcs Technical QuestionVinay Kumar
 
The other Apache Technologies your Big Data solution needs
The other Apache Technologies your Big Data solution needsThe other Apache Technologies your Big Data solution needs
The other Apache Technologies your Big Data solution needsgagravarr
 
Apache MetaModel - unified access to all your data points
Apache MetaModel - unified access to all your data pointsApache MetaModel - unified access to all your data points
Apache MetaModel - unified access to all your data pointsKasper Sørensen
 
Oracle SQL Developer version 4.0 New Features Overview
Oracle SQL Developer version 4.0 New Features OverviewOracle SQL Developer version 4.0 New Features Overview
Oracle SQL Developer version 4.0 New Features OverviewJeff Smith
 
Oracle SQL Developer Data Modeler - Version Control Your Designs
Oracle SQL Developer Data Modeler - Version Control Your DesignsOracle SQL Developer Data Modeler - Version Control Your Designs
Oracle SQL Developer Data Modeler - Version Control Your DesignsJeff Smith
 
Hibernate training at HarshithaTechnologySolutions @ Nizampet
Hibernate training at HarshithaTechnologySolutions @ NizampetHibernate training at HarshithaTechnologySolutions @ Nizampet
Hibernate training at HarshithaTechnologySolutions @ NizampetJayarajus
 
Spark Meetup Amsterdam - Dealing with Bad Actors in ETL, Databricks
Spark Meetup Amsterdam - Dealing with Bad Actors in ETL, DatabricksSpark Meetup Amsterdam - Dealing with Bad Actors in ETL, Databricks
Spark Meetup Amsterdam - Dealing with Bad Actors in ETL, DatabricksGoDataDriven
 
(ATS3-DEV08) Team Development with Accelrys Enterprise Platform
(ATS3-DEV08) Team Development with Accelrys Enterprise Platform(ATS3-DEV08) Team Development with Accelrys Enterprise Platform
(ATS3-DEV08) Team Development with Accelrys Enterprise PlatformBIOVIA
 
Spark SQL | Apache Spark
Spark SQL | Apache SparkSpark SQL | Apache Spark
Spark SQL | Apache SparkEdureka!
 

What's hot (20)

Stay fresh
Stay freshStay fresh
Stay fresh
 
Big Data and Hadoop Guide
Big Data and Hadoop GuideBig Data and Hadoop Guide
Big Data and Hadoop Guide
 
Free Hibernate Tutorial | VirtualNuggets
Free Hibernate Tutorial  | VirtualNuggetsFree Hibernate Tutorial  | VirtualNuggets
Free Hibernate Tutorial | VirtualNuggets
 
Introduction to SAP Gateway and OData
Introduction to SAP Gateway and ODataIntroduction to SAP Gateway and OData
Introduction to SAP Gateway and OData
 
Scala and spark
Scala and sparkScala and spark
Scala and spark
 
Spark SQL Tutorial | Spark SQL Using Scala | Apache Spark Tutorial For Beginn...
Spark SQL Tutorial | Spark SQL Using Scala | Apache Spark Tutorial For Beginn...Spark SQL Tutorial | Spark SQL Using Scala | Apache Spark Tutorial For Beginn...
Spark SQL Tutorial | Spark SQL Using Scala | Apache Spark Tutorial For Beginn...
 
Front Range PHP NoSQL Databases
Front Range PHP NoSQL DatabasesFront Range PHP NoSQL Databases
Front Range PHP NoSQL Databases
 
A Deep Dive into Structured Streaming: Apache Spark Meetup at Bloomberg 2016
A Deep Dive into Structured Streaming:  Apache Spark Meetup at Bloomberg 2016 A Deep Dive into Structured Streaming:  Apache Spark Meetup at Bloomberg 2016
A Deep Dive into Structured Streaming: Apache Spark Meetup at Bloomberg 2016
 
Advanced Excel
Advanced Excel Advanced Excel
Advanced Excel
 
ICON UK '13 - Apache Software: The FREE Java toolbox you didn't know you had !!
ICON UK '13 - Apache Software: The FREE Java toolbox you didn't know you had !!ICON UK '13 - Apache Software: The FREE Java toolbox you didn't know you had !!
ICON UK '13 - Apache Software: The FREE Java toolbox you didn't know you had !!
 
Tcs Technical Question
Tcs Technical QuestionTcs Technical Question
Tcs Technical Question
 
The other Apache Technologies your Big Data solution needs
The other Apache Technologies your Big Data solution needsThe other Apache Technologies your Big Data solution needs
The other Apache Technologies your Big Data solution needs
 
Apache MetaModel - unified access to all your data points
Apache MetaModel - unified access to all your data pointsApache MetaModel - unified access to all your data points
Apache MetaModel - unified access to all your data points
 
Oracle SQL Developer version 4.0 New Features Overview
Oracle SQL Developer version 4.0 New Features OverviewOracle SQL Developer version 4.0 New Features Overview
Oracle SQL Developer version 4.0 New Features Overview
 
Oracle SQL Developer Data Modeler - Version Control Your Designs
Oracle SQL Developer Data Modeler - Version Control Your DesignsOracle SQL Developer Data Modeler - Version Control Your Designs
Oracle SQL Developer Data Modeler - Version Control Your Designs
 
Hibernate training at HarshithaTechnologySolutions @ Nizampet
Hibernate training at HarshithaTechnologySolutions @ NizampetHibernate training at HarshithaTechnologySolutions @ Nizampet
Hibernate training at HarshithaTechnologySolutions @ Nizampet
 
Introduction To MDD
Introduction To MDDIntroduction To MDD
Introduction To MDD
 
Spark Meetup Amsterdam - Dealing with Bad Actors in ETL, Databricks
Spark Meetup Amsterdam - Dealing with Bad Actors in ETL, DatabricksSpark Meetup Amsterdam - Dealing with Bad Actors in ETL, Databricks
Spark Meetup Amsterdam - Dealing with Bad Actors in ETL, Databricks
 
(ATS3-DEV08) Team Development with Accelrys Enterprise Platform
(ATS3-DEV08) Team Development with Accelrys Enterprise Platform(ATS3-DEV08) Team Development with Accelrys Enterprise Platform
(ATS3-DEV08) Team Development with Accelrys Enterprise Platform
 
Spark SQL | Apache Spark
Spark SQL | Apache SparkSpark SQL | Apache Spark
Spark SQL | Apache Spark
 

Viewers also liked

Tech 4 Non-Tech Series @ Stanford GSB
Tech 4 Non-Tech Series @ Stanford GSBTech 4 Non-Tech Series @ Stanford GSB
Tech 4 Non-Tech Series @ Stanford GSBAlex De Simone
 
Making Design Teacher Resource Packet
Making Design Teacher Resource Packet Making Design Teacher Resource Packet
Making Design Teacher Resource Packet Kimberly Cisneros-Gill
 
Washerwoman Philanthropist
Washerwoman PhilanthropistWasherwoman Philanthropist
Washerwoman PhilanthropistKevin Chappell
 
인터랙_워킹 메이트_
인터랙_워킹 메이트_인터랙_워킹 메이트_
인터랙_워킹 메이트_Hye Bin Bae
 
Unsolicited Contribution to Code of Conduct for Jamaican Banking Sector
Unsolicited Contribution to Code of Conduct for Jamaican Banking SectorUnsolicited Contribution to Code of Conduct for Jamaican Banking Sector
Unsolicited Contribution to Code of Conduct for Jamaican Banking SectorHelp Mi Consulting
 
Ald Royal Square Neemrana,8459137252
Ald Royal Square Neemrana,8459137252Ald Royal Square Neemrana,8459137252
Ald Royal Square Neemrana,8459137252sahilkharkara1
 
ENJ-2-305: Presentación Módulo II Curso Procedimientos Penales del Juez de Pa...
ENJ-2-305: Presentación Módulo II Curso Procedimientos Penales del Juez de Pa...ENJ-2-305: Presentación Módulo II Curso Procedimientos Penales del Juez de Pa...
ENJ-2-305: Presentación Módulo II Curso Procedimientos Penales del Juez de Pa...ENJ
 
Benefits of Technology
Benefits of TechnologyBenefits of Technology
Benefits of TechnologyCandy Quintall
 
Toekomst van het station Ivo Bastiaansen
Toekomst van het station Ivo BastiaansenToekomst van het station Ivo Bastiaansen
Toekomst van het station Ivo BastiaansenIvo Bastiaansen
 
Orientation: why you should take ap classes
Orientation: why you should take ap classesOrientation: why you should take ap classes
Orientation: why you should take ap classesJustin McManus
 
Alfaro leyton meza_saenz_satisfaccion_laboral
Alfaro leyton meza_saenz_satisfaccion_laboralAlfaro leyton meza_saenz_satisfaccion_laboral
Alfaro leyton meza_saenz_satisfaccion_laboralElver Lopez Arrobas
 

Viewers also liked (20)

Tech 4 Non-Tech Series @ Stanford GSB
Tech 4 Non-Tech Series @ Stanford GSBTech 4 Non-Tech Series @ Stanford GSB
Tech 4 Non-Tech Series @ Stanford GSB
 
Dance
DanceDance
Dance
 
apanthseis_aepp 2016
apanthseis_aepp 2016apanthseis_aepp 2016
apanthseis_aepp 2016
 
The Mindfulness Project
The Mindfulness ProjectThe Mindfulness Project
The Mindfulness Project
 
Making Design Teacher Resource Packet
Making Design Teacher Resource Packet Making Design Teacher Resource Packet
Making Design Teacher Resource Packet
 
Washerwoman Philanthropist
Washerwoman PhilanthropistWasherwoman Philanthropist
Washerwoman Philanthropist
 
Tipografìa
TipografìaTipografìa
Tipografìa
 
인터랙_워킹 메이트_
인터랙_워킹 메이트_인터랙_워킹 메이트_
인터랙_워킹 메이트_
 
Unsolicited Contribution to Code of Conduct for Jamaican Banking Sector
Unsolicited Contribution to Code of Conduct for Jamaican Banking SectorUnsolicited Contribution to Code of Conduct for Jamaican Banking Sector
Unsolicited Contribution to Code of Conduct for Jamaican Banking Sector
 
Carlos Machado Bitencourt
Carlos Machado Bitencourt Carlos Machado Bitencourt
Carlos Machado Bitencourt
 
Technology Benefits
Technology BenefitsTechnology Benefits
Technology Benefits
 
Ald Royal Square Neemrana,8459137252
Ald Royal Square Neemrana,8459137252Ald Royal Square Neemrana,8459137252
Ald Royal Square Neemrana,8459137252
 
Cap1
Cap1Cap1
Cap1
 
ENJ-2-305: Presentación Módulo II Curso Procedimientos Penales del Juez de Pa...
ENJ-2-305: Presentación Módulo II Curso Procedimientos Penales del Juez de Pa...ENJ-2-305: Presentación Módulo II Curso Procedimientos Penales del Juez de Pa...
ENJ-2-305: Presentación Módulo II Curso Procedimientos Penales del Juez de Pa...
 
Benefits of Technology
Benefits of TechnologyBenefits of Technology
Benefits of Technology
 
Toekomst van het station Ivo Bastiaansen
Toekomst van het station Ivo BastiaansenToekomst van het station Ivo Bastiaansen
Toekomst van het station Ivo Bastiaansen
 
Vanessa Williams
Vanessa WilliamsVanessa Williams
Vanessa Williams
 
Orientation: why you should take ap classes
Orientation: why you should take ap classesOrientation: why you should take ap classes
Orientation: why you should take ap classes
 
Matriz de consistencia 2015 agosto29 (autoguardado)
Matriz de consistencia 2015 agosto29 (autoguardado)Matriz de consistencia 2015 agosto29 (autoguardado)
Matriz de consistencia 2015 agosto29 (autoguardado)
 
Alfaro leyton meza_saenz_satisfaccion_laboral
Alfaro leyton meza_saenz_satisfaccion_laboralAlfaro leyton meza_saenz_satisfaccion_laboral
Alfaro leyton meza_saenz_satisfaccion_laboral
 

Similar to Scala a case4

Algebraic Data Types for Data Oriented Programming - From Haskell and Scala t...
Algebraic Data Types forData Oriented Programming - From Haskell and Scala t...Algebraic Data Types forData Oriented Programming - From Haskell and Scala t...
Algebraic Data Types for Data Oriented Programming - From Haskell and Scala t...Philip Schwarz
 
Why scala - executive overview
Why scala - executive overviewWhy scala - executive overview
Why scala - executive overviewRazvan Cojocaru
 
A Brief, but Dense, Intro to Scala
A Brief, but Dense, Intro to ScalaA Brief, but Dense, Intro to Scala
A Brief, but Dense, Intro to ScalaDerek Chen-Becker
 
Refactoring to Scala DSLs and LiftOff 2009 Recap
Refactoring to Scala DSLs and LiftOff 2009 RecapRefactoring to Scala DSLs and LiftOff 2009 Recap
Refactoring to Scala DSLs and LiftOff 2009 RecapDave Orme
 
Lessons Learned: Scala and its Ecosystem
Lessons Learned: Scala and its EcosystemLessons Learned: Scala and its Ecosystem
Lessons Learned: Scala and its EcosystemPetr Hošek
 
Technology Stack Discussion
Technology Stack DiscussionTechnology Stack Discussion
Technology Stack DiscussionZaiyang Li
 
Ten Compelling Reasons to Go the Scala Development Way - Metadesign Solutions
Ten Compelling Reasons to Go the Scala Development Way - Metadesign SolutionsTen Compelling Reasons to Go the Scala Development Way - Metadesign Solutions
Ten Compelling Reasons to Go the Scala Development Way - Metadesign SolutionsMetaDesign Solutions
 
Assist software awesome scala
Assist software   awesome scalaAssist software   awesome scala
Assist software awesome scalaAssistSoftware
 
J2EE Batch Processing
J2EE Batch ProcessingJ2EE Batch Processing
J2EE Batch ProcessingChris Adkin
 
ModelTalk - When Everything is a Domain Specific Language
ModelTalk - When Everything is a Domain Specific LanguageModelTalk - When Everything is a Domain Specific Language
ModelTalk - When Everything is a Domain Specific LanguageAtzmon Hen-Tov
 
Java Magazine Enterprise September /October2016
Java Magazine Enterprise September /October2016Java Magazine Enterprise September /October2016
Java Magazine Enterprise September /October2016Erik Gur
 
Introduction to Scala
Introduction to ScalaIntroduction to Scala
Introduction to ScalaSynesso
 
Java Magazine March April 2019
Java Magazine March April 2019Java Magazine March April 2019
Java Magazine March April 2019Erik Gur
 
Programming in Spark - Lessons Learned in OpenAire project
Programming in Spark - Lessons Learned in OpenAire projectProgramming in Spark - Lessons Learned in OpenAire project
Programming in Spark - Lessons Learned in OpenAire projectŁukasz Dumiszewski
 
Learn about SPARK tool and it's componemts
Learn about SPARK tool and it's componemtsLearn about SPARK tool and it's componemts
Learn about SPARK tool and it's componemtssiddharth30121
 

Similar to Scala a case4 (20)

Algebraic Data Types for Data Oriented Programming - From Haskell and Scala t...
Algebraic Data Types forData Oriented Programming - From Haskell and Scala t...Algebraic Data Types forData Oriented Programming - From Haskell and Scala t...
Algebraic Data Types for Data Oriented Programming - From Haskell and Scala t...
 
Why scala - executive overview
Why scala - executive overviewWhy scala - executive overview
Why scala - executive overview
 
A Brief, but Dense, Intro to Scala
A Brief, but Dense, Intro to ScalaA Brief, but Dense, Intro to Scala
A Brief, but Dense, Intro to Scala
 
As 400
As 400As 400
As 400
 
Refactoring to Scala DSLs and LiftOff 2009 Recap
Refactoring to Scala DSLs and LiftOff 2009 RecapRefactoring to Scala DSLs and LiftOff 2009 Recap
Refactoring to Scala DSLs and LiftOff 2009 Recap
 
Lessons Learned: Scala and its Ecosystem
Lessons Learned: Scala and its EcosystemLessons Learned: Scala and its Ecosystem
Lessons Learned: Scala and its Ecosystem
 
Technology Stack Discussion
Technology Stack DiscussionTechnology Stack Discussion
Technology Stack Discussion
 
Ten Compelling Reasons to Go the Scala Development Way - Metadesign Solutions
Ten Compelling Reasons to Go the Scala Development Way - Metadesign SolutionsTen Compelling Reasons to Go the Scala Development Way - Metadesign Solutions
Ten Compelling Reasons to Go the Scala Development Way - Metadesign Solutions
 
Assist software awesome scala
Assist software   awesome scalaAssist software   awesome scala
Assist software awesome scala
 
J2EE Batch Processing
J2EE Batch ProcessingJ2EE Batch Processing
J2EE Batch Processing
 
ModelTalk - When Everything is a Domain Specific Language
ModelTalk - When Everything is a Domain Specific LanguageModelTalk - When Everything is a Domain Specific Language
ModelTalk - When Everything is a Domain Specific Language
 
Java Magazine Enterprise September /October2016
Java Magazine Enterprise September /October2016Java Magazine Enterprise September /October2016
Java Magazine Enterprise September /October2016
 
Introduction to Scala
Introduction to ScalaIntroduction to Scala
Introduction to Scala
 
Rails Concept
Rails ConceptRails Concept
Rails Concept
 
Java Magazine March April 2019
Java Magazine March April 2019Java Magazine March April 2019
Java Magazine March April 2019
 
Programming in Spark - Lessons Learned in OpenAire project
Programming in Spark - Lessons Learned in OpenAire projectProgramming in Spark - Lessons Learned in OpenAire project
Programming in Spark - Lessons Learned in OpenAire project
 
ASPgems - kappa architecture
ASPgems - kappa architectureASPgems - kappa architecture
ASPgems - kappa architecture
 
Learn about SPARK tool and it's componemts
Learn about SPARK tool and it's componemtsLearn about SPARK tool and it's componemts
Learn about SPARK tool and it's componemts
 
Introduction to Scala
Introduction to ScalaIntroduction to Scala
Introduction to Scala
 
Pattern -A scoring engine
Pattern -A scoring enginePattern -A scoring engine
Pattern -A scoring engine
 

Recently uploaded

FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Thierry Lestable
 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Frank van Harmelen
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfCheryl Hung
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingThijs Feryn
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...Product School
 
Quantum Computing: Current Landscape and the Future Role of APIs
Quantum Computing: Current Landscape and the Future Role of APIsQuantum Computing: Current Landscape and the Future Role of APIs
Quantum Computing: Current Landscape and the Future Role of APIsVlad Stirbu
 
Exploring UiPath Orchestrator API: updates and limits in 2024 🚀
Exploring UiPath Orchestrator API: updates and limits in 2024 🚀Exploring UiPath Orchestrator API: updates and limits in 2024 🚀
Exploring UiPath Orchestrator API: updates and limits in 2024 🚀DianaGray10
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance
 
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...Product School
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Ramesh Iyer
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...Product School
 
НАДІЯ ФЕДЮШКО БАЦ «Професійне зростання QA спеціаліста»
НАДІЯ ФЕДЮШКО БАЦ  «Професійне зростання QA спеціаліста»НАДІЯ ФЕДЮШКО БАЦ  «Професійне зростання QA спеціаліста»
НАДІЯ ФЕДЮШКО БАЦ «Професійне зростання QA спеціаліста»QADay
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualityInflectra
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesThousandEyes
 
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo DiehlFuture Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo DiehlPeter Udo Diehl
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonDianaGray10
 
"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor TurskyiFwdays
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersSafe Software
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Jeffrey Haguewood
 

Recently uploaded (20)

FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
 
Quantum Computing: Current Landscape and the Future Role of APIs
Quantum Computing: Current Landscape and the Future Role of APIsQuantum Computing: Current Landscape and the Future Role of APIs
Quantum Computing: Current Landscape and the Future Role of APIs
 
Exploring UiPath Orchestrator API: updates and limits in 2024 🚀
Exploring UiPath Orchestrator API: updates and limits in 2024 🚀Exploring UiPath Orchestrator API: updates and limits in 2024 🚀
Exploring UiPath Orchestrator API: updates and limits in 2024 🚀
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
 
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
 
НАДІЯ ФЕДЮШКО БАЦ «Професійне зростання QA спеціаліста»
НАДІЯ ФЕДЮШКО БАЦ  «Професійне зростання QA спеціаліста»НАДІЯ ФЕДЮШКО БАЦ  «Професійне зростання QA спеціаліста»
НАДІЯ ФЕДЮШКО БАЦ «Професійне зростання QA спеціаліста»
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
 
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo DiehlFuture Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
 
"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
 

Scala a case4

  • 1. Making a case for Scala :-  Conciseness1: 40% less code than java without being obscure; not simply due to boilerplate reduction. This is beneficial initially but especially more so for maintenance. It offers large productivity and time to market gains, and makes for happier developers and their C level executives. More developers go to work more productive, deliver more business value, and feel good at the end of the day.  a clean design is one that supports visual thinking so people can meet their informational needs with a minimum of conscious effort. (www.visualmess.com)  A reasonable conjecture would be that the cost of developing and maintaining an application grows with the size of the application. Adding code without value is waste.  Scala has gone mainstream both in Financial Services and Stats communities, particularly in Big Data Analysis due to functional composability and facilitating strongly-typed simplified DSLs. One reason for popularity is that verses an easy to understand DSL implemented in Scala (without Scalas strong typing) one needs to have good IDE tool support for the DSL, and the significant development effort for this tooling is avoided by using Scala DSLs at zero cost. Time to market delays on DSL tool support are also avoided by using Scala. http://news.efinancialcareers.com/uk-en/100268/smart-java-developers-need-to-skill-up-in- scala/  Support for Higher order functions - functions which take functions as arguments. As a metaphor, higher order functions can be seen as mechanical power tools, into which different drills or blades can be inserted to perform different operations. Higher order functions are a powerful abstraction tool to separate concerns at different levels, for example data structure and processing of data elements embedded in the data structure. This is key for analyzing BigData & Geo where large data collections require specific, highly optimized and, in consequence, complex data structures. Functional Languages like Scala cleanly implement support for these concepts, including functional composition/chaining. Ease of Parallization of data processing is also a major benefit. http://java.dzone.com/articles/higher-order-functions  Its not a case of Scala=good vs Java=bad. Scala is not a big leap from Java especially now lambda support in Java 8 had been added (itself derived from Scala.) An incremental adoption should be tried e.g. writing some of your test suite in Scala, or one of your modules in Scala to get a feel for quality and benefit. 1 In Java, it feels very wasteful to keep repeating oneself due to weak abstractions and having to write heaps of boilerplate code, all those getters, Comparators etc.
  • 2.  Frameworks matter. Scala leverages all the java stack and frameworks e.g. Hibernate/JPA/JTA. Compatibility with Java Libraries and visa versa including Java Generics.  Traits significantly improve code re-usability over Java. Traits are mix-ins; can be used to implement strongly-typed compile-time dependency injection. They can also be mixed-in at runtime. Traits improve design because a Single Responsibility Principle can be implemented much more cleanly and easily than in Java. (A similar concert to Dockers file system.)  Using functions makes code more concise, readable, elegant, and reusable, since functions are at lower level than objects and their inputs/outputs are easily understand. Just like data, functions are composable. Functions can also Improve design reuse via the Single Responsibility Principle.  Scala has design idioms that reduce coding effort while increasing clarity. e.g.: o case classes: that simplify domain object data classes by automatically providing getters and setters, equals(), hashCode() ,toString(),copy(). o avoiding NPE (through 'Option: Some/None') o avoiding complex nested If not null checks (through 'for comprehensions') o non-blocking parallel task concurrency without obfuscating code with exception handling or contingency workflows, timeouts etc. ('for comprehensions') o easy creation of functional data pipeline workflows, including error handling and timeout contingencies ('for comprehensions') o type aliasing - can be used to clarify primitive values used in maps/lists to make maintenence easier o DSL support to change legacy java APIs into simplified type-safe DSLs using 'implicits' o higher order functions o tuple datatypes allowing return values of more than one result o more powerful 'case matching' statement than in Java that makes code simpler and easier to read o XML is first class citizen, part of the syntax. o string parsing without + + + e.g. println(s"$activeTrj $scan") o can easily enforce immutable state - concurrency friendly o currying functional inputs - improves functional reuse opportunities, and reduces bloat making code simpler to read.  Studies indicate Scala's cognitively-denser language constructs make code comprehension much simpler than corresponding equivalent Java code.  With type-driven development you know your code will work as expected when you compile it so you'll have no surprises at run-time. These Benefits are documented as visible even amongst programmers with a limited grasp of Scala. http://infoscience.epfl.ch/record/138586/files/dubochet2009coco.pdf Moreover developers exposed to Scala describe using Java-like-style as “messy” and “annoying”. "Implementing the solution in Java would just be a bad approximation that makes me sad. It takes 6 times the effort to complete, and is orders of magnitude more to maintain."
  • 3.  Concurrency implementations can be orders of magnitude simpler to implement in Scala vs Java, since Scala was designed first and foremost to be a SCALAble language for the JVM. Scala can also leverage frameworks that solve concurrency problems that are becoming more and more important e.g. Actors, STM, shared read-only variable state etc. The language offers easier to understand DSL syntax than available in Java APIs when the same 3rd partly libraries are used, even when underlying libraries are written in Java.  Scala offers a better programming model for concurrent programming. Java implementations are very complex, very more so when dealing with exceptions timeouts, and task contingencies are considered.  Encapsulation is improved: Unlike Java, public interface pollution can be avoided - as scala methods support definition of inner methods.  No mixing of static and non-static code: Static objects are separated out into their own distinct definitions.  In Scala, the issue of java type erasure does not occur with arrays. For lists there are workarounds with using TypeTags, or ClassTags or Manifests (deprecated.)  Abstractions compose when types align. DSLs can model work seamlessly across asynchronous boundaries. Futures and promises offer a way to design compositional APIs that make this feasible. Negatives:  You need to be clear on the Lang. features that should be used and enforce them via compiler options and coding standards, because its easier to write baffling code than in Java. At the end of the day no framework is immune to bad practice e.g. in Spring: pretending the Java new operator doesn't exist anymore, and creating 10,000 LO-XML that is not statically typed. You also need to avoid non-ascii method names and operators unless developing a math library.  Compilation takes longer than Java, but this is mitigated with continuous background compilation using SBT as best practice.  As with Java 8 Lambdas, stack traces become bigger but typically you only need look at the 1st and last elements and ignore the rest. Definitely heaps better than Javascript traces though.  Backwards compatibility has been an issue in the past, when one needed to recompile source to new versions, but less so now.  Currently Less expertise of FP in marketplace, than OO, although this is changing with Java 8 Lambdas. FP is easy to adopt across a small team if one person has learned it already.  Scala support for Java 8 Lambda is available in v2.12.x, a wrapper function can facilitate usage also in v2.11.8 as well as a compiler option.  Performance tuning comes with experience. Ideally one should know what to avoid doing, just like in Java. Looking at the generated class files can clarify what is happening at a low level. Familiar tools like JProfiler also support Scala.