SlideShare una empresa de Scribd logo
1 de 30
Scala 
The good, the bad and the very ugly
Vanity slide 
● Senior software engineer @ TomTom 
● Using scala for more than a year 
● Stackoverflow (couldn’t miss that) 
● http://techblog.bozho.net 
● @bozhobg 
● (Yes, I’m making presentations about programming 
languages in PowerPoint with screenshots of code)
The good 
● functional and object-oriented 
● JVM-based 
● val, type inference 
● expressive 
● DSL-friendly
The good 
● case classes - immutable, value classes 
● embrace immutability - immutable collections 
by default 
● automatic conversion from and to Java 
collections
The good 
● no null - Option[Foo] 
● Reusing java instruments (e.g. guava, slf4j, 
even spring and hibernate) 
● goodies – e.g. instantiating collections 
without unnecessary brackets or type 
declarations
Partially applied functions
Traits 
Multiple inheritance done right
The bad 
● tools 
o The compiler is too slow 
o IDE-s (Eclipse and IntelliJ) break 
o sbt (build tool) is buggy 
● ecosystem 
o Many java libraries cannot/should not be used 
o Most frameworks and libraries and in early phase 
o binary incompatible => one artifact for each scala version 
● lambdas are slower than in Java 8
The bad 
● Heavy in terms of concepts and keywords: 
implicits, for comprehensions, lazy, case 
class, case object, currying, partially applied 
functions vs partial functions => 
● Steep learning curve 
● Syntactic diabetes
Syntactic diabetes
Implicits 
implicit val, implicit def, implicitly, 
(implicit argument) 
If anywhere in the execution context there is an implicit 
definition, any function can read it with(implicit foo: 
String) => the horror! 
Saves initialization (e.g. of some tool)
The bad 
One thing can be written in many ways and 
there is no “right” way.
The bad 
“Concise” doesn’t necessarily mean fast to 
write or easy to read
The bad 
Productivity – do we gain or lose?
The very ugly 
cryptic
scala> List(1,2,3).toSet()
res0: Boolean = false 
List(1,2,3).toSet 
res0: s.c.immutable.Set[Int] = Set(1, 2, 3)
Philosophy 
● Should the language stop us from shooting 
ourselves in the foot? 
● Should this be at the expense of its 
expressiveness? 
● Where is the balance? 
● Who is scala suitable for?
Optimistic 
● IDEs are getting better 
● Frameworks are getting mature 
● Twitter and the language author are 
releasing guidelines and best practices 
(scala – the good parts) 
● invokeDynamic (SI-8359)
Conclusion 
● I wouldn’t recommend scala for a general-purpose new 
project 
● In an actual project most of the defficiencies are 
relatively easy to overcome 
● I would recommend scala for a small, side module 
● It’s interesting to work with, due to the functional aspect 
● Don’t give the users of your language, API or product all 
of the possible options – they will misuse them.
Questions? 
def ? = ???

Más contenido relacionado

Destacado

Destacado (19)

Design Pattern Architetturali - Dependency Injection
Design Pattern Architetturali - Dependency InjectionDesign Pattern Architetturali - Dependency Injection
Design Pattern Architetturali - Dependency Injection
 
Java Graphics Programming
Java Graphics ProgrammingJava Graphics Programming
Java Graphics Programming
 
Java - Processing input and output
Java - Processing input and outputJava - Processing input and output
Java - Processing input and output
 
Design Pattern Strutturali
Design Pattern StrutturaliDesign Pattern Strutturali
Design Pattern Strutturali
 
Java- Concurrent programming - Synchronization (part 1)
Java- Concurrent programming - Synchronization (part 1)Java- Concurrent programming - Synchronization (part 1)
Java- Concurrent programming - Synchronization (part 1)
 
Java- Concurrent programming - Synchronization (part 2)
Java- Concurrent programming - Synchronization (part 2)Java- Concurrent programming - Synchronization (part 2)
Java- Concurrent programming - Synchronization (part 2)
 
Java Exception Handling, Assertions and Logging
Java Exception Handling, Assertions and LoggingJava Exception Handling, Assertions and Logging
Java Exception Handling, Assertions and Logging
 
Java - Concurrent programming - Thread's advanced concepts
Java - Concurrent programming - Thread's advanced conceptsJava - Concurrent programming - Thread's advanced concepts
Java - Concurrent programming - Thread's advanced concepts
 
Diagrammi di Sequenza
Diagrammi di SequenzaDiagrammi di Sequenza
Diagrammi di Sequenza
 
A (too) Short Introduction to Scala
A (too) Short Introduction to ScalaA (too) Short Introduction to Scala
A (too) Short Introduction to Scala
 
Java - Remote method invocation
Java - Remote method invocationJava - Remote method invocation
Java - Remote method invocation
 
SOLID - Principles of Object Oriented Design
SOLID - Principles of Object Oriented DesignSOLID - Principles of Object Oriented Design
SOLID - Principles of Object Oriented Design
 
Scala For Java Programmers
Scala For Java ProgrammersScala For Java Programmers
Scala For Java Programmers
 
Software architecture patterns
Software architecture patternsSoftware architecture patterns
Software architecture patterns
 
Errori comuni nei documenti di Analisi dei Requisiti
Errori comuni nei documenti di Analisi dei RequisitiErrori comuni nei documenti di Analisi dei Requisiti
Errori comuni nei documenti di Analisi dei Requisiti
 
Presto updates to 0.178
Presto updates to 0.178Presto updates to 0.178
Presto updates to 0.178
 
Diagrammi delle Classi
Diagrammi delle ClassiDiagrammi delle Classi
Diagrammi delle Classi
 
Introduzione ai Design Pattern
Introduzione ai Design PatternIntroduzione ai Design Pattern
Introduzione ai Design Pattern
 
Java - Concurrent programming - Thread's basics
Java - Concurrent programming - Thread's basicsJava - Concurrent programming - Thread's basics
Java - Concurrent programming - Thread's basics
 

Similar a Scala - the good, the bad and the very ugly

Cassandra: Not Just NoSQL, It's MoSQL
Cassandra: Not Just NoSQL, It's MoSQLCassandra: Not Just NoSQL, It's MoSQL
Cassandra: Not Just NoSQL, It's MoSQL
Eric Evans
 
An Introduction to Scala - Blending OO and Functional Paradigms
An Introduction to Scala - Blending OO and Functional ParadigmsAn Introduction to Scala - Blending OO and Functional Paradigms
An Introduction to Scala - Blending OO and Functional Paradigms
Miles Sabin
 
Got bored by the relational database? Switch to a RDF store!
Got bored by the relational database? Switch to a RDF store!Got bored by the relational database? Switch to a RDF store!
Got bored by the relational database? Switch to a RDF store!
benfante
 

Similar a Scala - the good, the bad and the very ugly (20)

Scala the-good-parts
Scala the-good-partsScala the-good-parts
Scala the-good-parts
 
Java Closures
Java ClosuresJava Closures
Java Closures
 
Dart the Better JavaScript
Dart the Better JavaScriptDart the Better JavaScript
Dart the Better JavaScript
 
Ruby, the language of devops
Ruby, the language of devopsRuby, the language of devops
Ruby, the language of devops
 
Cassandra: Not Just NoSQL, It's MoSQL
Cassandra: Not Just NoSQL, It's MoSQLCassandra: Not Just NoSQL, It's MoSQL
Cassandra: Not Just NoSQL, It's MoSQL
 
Scala.js
Scala.js Scala.js
Scala.js
 
2009 Eclipse Con
2009 Eclipse Con2009 Eclipse Con
2009 Eclipse Con
 
Ruby
RubyRuby
Ruby
 
Basics java programing
Basics java programingBasics java programing
Basics java programing
 
An Introduction to Scala - Blending OO and Functional Paradigms
An Introduction to Scala - Blending OO and Functional ParadigmsAn Introduction to Scala - Blending OO and Functional Paradigms
An Introduction to Scala - Blending OO and Functional Paradigms
 
Grooming with Groovy
Grooming with GroovyGrooming with Groovy
Grooming with Groovy
 
Golang workshop - Mindbowser
Golang workshop - MindbowserGolang workshop - Mindbowser
Golang workshop - Mindbowser
 
Modern_2.pptx for java
Modern_2.pptx for java Modern_2.pptx for java
Modern_2.pptx for java
 
Scala for C# Developers
Scala for C# DevelopersScala for C# Developers
Scala for C# Developers
 
Java programming language
Java programming languageJava programming language
Java programming language
 
Java notes | All Basics |
Java notes | All Basics |Java notes | All Basics |
Java notes | All Basics |
 
Go/Ruby/Java: What's next?
Go/Ruby/Java: What's next?Go/Ruby/Java: What's next?
Go/Ruby/Java: What's next?
 
Develop realtime web with Scala and Xitrum
Develop realtime web with Scala and XitrumDevelop realtime web with Scala and Xitrum
Develop realtime web with Scala and Xitrum
 
(3) c sharp introduction_basics_part_ii
(3) c sharp introduction_basics_part_ii(3) c sharp introduction_basics_part_ii
(3) c sharp introduction_basics_part_ii
 
Got bored by the relational database? Switch to a RDF store!
Got bored by the relational database? Switch to a RDF store!Got bored by the relational database? Switch to a RDF store!
Got bored by the relational database? Switch to a RDF store!
 

Más de Bozhidar Bozhanov

Más de Bozhidar Bozhanov (20)

Антикорупционен софтуер
Антикорупционен софтуерАнтикорупционен софтуер
Антикорупционен софтуер
 
Nothing is secure.pdf
Nothing is secure.pdfNothing is secure.pdf
Nothing is secure.pdf
 
Elasticsearch - Scalability and Multitenancy
Elasticsearch - Scalability and MultitenancyElasticsearch - Scalability and Multitenancy
Elasticsearch - Scalability and Multitenancy
 
Encryption in the enterprise
Encryption in the enterpriseEncryption in the enterprise
Encryption in the enterprise
 
Blockchain overview - types, use-cases, security and usabilty
Blockchain overview - types, use-cases, security and usabiltyBlockchain overview - types, use-cases, security and usabilty
Blockchain overview - types, use-cases, security and usabilty
 
Електронна държава
Електронна държаваЕлектронна държава
Електронна държава
 
Blockchain - what is it good for?
Blockchain - what is it good for?Blockchain - what is it good for?
Blockchain - what is it good for?
 
Algorithmic and technological transparency
Algorithmic and technological transparencyAlgorithmic and technological transparency
Algorithmic and technological transparency
 
Scaling horizontally on AWS
Scaling horizontally on AWSScaling horizontally on AWS
Scaling horizontally on AWS
 
Alternatives for copyright protection online
Alternatives for copyright protection onlineAlternatives for copyright protection online
Alternatives for copyright protection online
 
GDPR for developers
GDPR for developersGDPR for developers
GDPR for developers
 
Политики, основани на данни
Политики, основани на данниПолитики, основани на данни
Политики, основани на данни
 
Отворено законодателство
Отворено законодателствоОтворено законодателство
Отворено законодателство
 
Overview of Message Queues
Overview of Message QueuesOverview of Message Queues
Overview of Message Queues
 
Electronic governance steps in the right direction?
Electronic governance   steps in the right direction?Electronic governance   steps in the right direction?
Electronic governance steps in the right direction?
 
Сигурност на електронното управление
Сигурност на електронното управлениеСигурност на електронното управление
Сигурност на електронното управление
 
Opensource government
Opensource governmentOpensource government
Opensource government
 
Биометрична идентификация
Биометрична идентификацияБиометрична идентификация
Биометрична идентификация
 
Biometric identification
Biometric identificationBiometric identification
Biometric identification
 
Регулации и технологии
Регулации и технологииРегулации и технологии
Регулации и технологии
 

Último

TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
mohitmore19
 

Último (20)

Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS LiveVip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with Precision
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptx
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
 

Scala - the good, the bad and the very ugly

  • 1. Scala The good, the bad and the very ugly
  • 2. Vanity slide ● Senior software engineer @ TomTom ● Using scala for more than a year ● Stackoverflow (couldn’t miss that) ● http://techblog.bozho.net ● @bozhobg ● (Yes, I’m making presentations about programming languages in PowerPoint with screenshots of code)
  • 3. The good ● functional and object-oriented ● JVM-based ● val, type inference ● expressive ● DSL-friendly
  • 4. The good ● case classes - immutable, value classes ● embrace immutability - immutable collections by default ● automatic conversion from and to Java collections
  • 5. The good ● no null - Option[Foo] ● Reusing java instruments (e.g. guava, slf4j, even spring and hibernate) ● goodies – e.g. instantiating collections without unnecessary brackets or type declarations
  • 8. The bad ● tools o The compiler is too slow o IDE-s (Eclipse and IntelliJ) break o sbt (build tool) is buggy ● ecosystem o Many java libraries cannot/should not be used o Most frameworks and libraries and in early phase o binary incompatible => one artifact for each scala version ● lambdas are slower than in Java 8
  • 9.
  • 10. The bad ● Heavy in terms of concepts and keywords: implicits, for comprehensions, lazy, case class, case object, currying, partially applied functions vs partial functions => ● Steep learning curve ● Syntactic diabetes
  • 12. Implicits implicit val, implicit def, implicitly, (implicit argument) If anywhere in the execution context there is an implicit definition, any function can read it with(implicit foo: String) => the horror! Saves initialization (e.g. of some tool)
  • 13. The bad One thing can be written in many ways and there is no “right” way.
  • 14.
  • 15.
  • 16. The bad “Concise” doesn’t necessarily mean fast to write or easy to read
  • 17.
  • 18. The bad Productivity – do we gain or lose?
  • 19. The very ugly cryptic
  • 20.
  • 21.
  • 22.
  • 23.
  • 24.
  • 26. res0: Boolean = false List(1,2,3).toSet res0: s.c.immutable.Set[Int] = Set(1, 2, 3)
  • 27. Philosophy ● Should the language stop us from shooting ourselves in the foot? ● Should this be at the expense of its expressiveness? ● Where is the balance? ● Who is scala suitable for?
  • 28. Optimistic ● IDEs are getting better ● Frameworks are getting mature ● Twitter and the language author are releasing guidelines and best practices (scala – the good parts) ● invokeDynamic (SI-8359)
  • 29. Conclusion ● I wouldn’t recommend scala for a general-purpose new project ● In an actual project most of the defficiencies are relatively easy to overcome ● I would recommend scala for a small, side module ● It’s interesting to work with, due to the functional aspect ● Don’t give the users of your language, API or product all of the possible options – they will misuse them.