SlideShare una empresa de Scribd logo
Clojure / Scala
Diego Pacheco
Clojure
❏ 2007
❏ Rich Hickey
❏ JVM based but also CLR and JavaScript
❏ Functional dialect of Lisp
❏ Immutability & Immutable Data Structures
❏ Great interoperability with Java
❏ But -> Slow and Hard to troubleshoot.
Who is using Clojure?
https://clojure.org/community/companies
“Function as Data, Data as
functions” -- RH.
You don't need classes: Just Functions and Data!
Lisp
Lisp
Getting started with lien (Clojure build system)
❏ Clojure Build System
❏ Compatible with Maven Repos
❏ Super Easy to use https://leiningen.org/
Hello World on lein REPL
From a File (*.clj)
From a File (*.clj)
From a File (*.clj)
Basics
❏ Lists ()
❏ Vectors []
❏ Assign with Let
❏ “Strings”
❏ seq
❏ if
Functions
reduce
reduce
map
map
filter
filter
every?
Pipeline Operator (->>)
Sets
❏ Like Math Sets
❏ Unsorted
❏ NO Duplicates
❏ Efficient:
❏ Checking
❏ Removal
❏ (sorted-set)
SortedSets
Maps
❏ Also known as
❏ Dictionaries
❏ Hash Maps
❏ Assoc k/v pairs
❏ Domain data
❏ (sorted-map)
Working with “Pojos” == Maps.
❏ What can you do with a
Pojo in OOP? Nothing.
❏ In clojure? A lot !!!
❏ Remember “Alan Perlis”
❏ No need to define “schema”
❏ Productivity
❏ Simplicity
defrecord here is our class be happy :-)
https://github.com/clojure/core.match
Clojure also has Pattern Matcher
Web Development ... Compojure & Ring
$ lein new compojure hello-world
$ cd hello-world
$ lein run server-headless
Open your browser on http://localhost:3000/
handler.clj
https://clojuredocs.org/
Exercises
1. Write a function which returns the last element in a sequence without using *last*.
Test data: (A) [10 20 30 40 50] (B) '(10 8 1) (C) ["x" "y" "z"]
2. Write a function which sum of a sequence of numbers without using *reduce*.
Test data: (A) [1 2 3 4 5 6] (B) '(0 0 -1 1 2 3) (C) #{40 50 25 15 10}
3. Write a REST service with clojure, all persistence needs to be done in memory using maps or records.
You will need to create an BANK application with: deposit, withdrawal, check balance, transfer
money into other accounts. You will need do proper validations and also unit tests. Your application
need to use lein and compojure there are no other frameworks/libs allowed.
You cannot use: for, if and let.
Scala
❏ 2004
❏ Functional Programing Language
❏ Based on Haskell
❏ Runs on the JVM also JavaScript
❏ Statically typed
❏ Better Java
❏ Awesome for Big Data / ML
❏ Created by Martin Odersky
SBT
❏ Build System for Scala
❏ IF you are working with scala you also
could do:
❏ Maven
❏ Gradle
❏ In practice SBT is the right choice.
Helloworld Scala + SBT
Helloworld Scala + SBT
SBT has a REPL too ($ sbt console)
Functions
❏ Functions
❏ Lambdas
❏ Are all Objects
❏ Since
implementation in
java (JVM).
Partial Application
❏ Partial
❏ Lazy
❏ Composition
❏ Re-use
Partial Application via Currying
❏ Partial
❏ Lazy
❏ Composition
❏ Re-use
Variable lengths arguments or in java terms varargs.
❏ *
❏ Dynamic
❏ Generic
❏ Similar to
java
OOP in Scala: Class
❏ Scala support OOP
❏ Here is the better
java part starts
❏ Simple
❏ Clean
❏ Less Verbose
OOP in Scala: Class Constructor + String Interpolation
OOP in Scala: Inheritance
❏ Class Hierarchy
❏ Polymorphism
OOP in Scala: Polymorphism Overriding
❏ Class Hierarchy
❏ Polymorphism
❏ Overriding
OOP in Scala: Traits
❏ Similar to Java Interfaces
❏ However you can have code
❏ Fundamental part of type
system (“Algebra”)
❏ One of best things in Scala
❏ Be Careful it can get crazy :D
❏ Stay practical stay clean!
OOP in Scala: Generics + Types
❏ Generics
❏ Types
❏ Abstractions
❏ Leverage
Compiler
❏ Haskell way
Apply
❏ Apply
❏ Code runs
❏ Default in Scala
❏ Like toString
In Java but better
❏ Super useful
OOP in Scala: Objects
❏ Different then Java Objects
❏ Objects are single instance
❏ It's how you do Singletons in Scala
❏ Great for org static functions
❏ Often classes have companion Objects
in Scala.
❏ Functions in Scala are Objects.
Pattern Matcher
❏ One of the best features
In Scala Language.
❏ Support ifs
❏ Support “_”
❏ Support type matching
❏ Better than Switch
Pattern Matcher
Case classes
❏ One of the best features
In Scala Language.
❏ Super charged Classes
❏ Equality & toString
Support
❏ Work on Pattern
Matcher
❏ Super clean syntax
Collections
❏ Like in Java
❏ But much better
❏ Immutable
❏ Mutable
❏ Tupes
❏ Sets, Arrays, Lists,
❏ Maps vs Map
map, filter, foldLeft
❏ Functional
Combinators
❏ Core FP prog
❏ Super useful
❏ Day by Day work
Exercises
1. Write a function which finds the last element in a List without using *last*.
Test data: (A) List(1,2,3,4,5,6,7,8) (B) List(“1”,”2”,”3”) (C) List(1.0,2.0,3.0)
2. Write a function which Flatten a nested list structure.
Test data: (A) flatten(List(List(1, 1), 2, List(3, List(5, 8)))) (B) (List(), 2, List(3,4))
3. Write a REST service with Scala, all persistence needs to be done in memory using maps or records.
You will need to create an BANK application with: deposit, withdrawal, check balance, transfer
money into other accounts. You will need do proper validations and also unit tests. Your application
need to use lein and compojure there are no other frameworks/libs allowed.
You cannot use: for, if and let.
Clojure / Scala
Diego Pacheco

Más contenido relacionado

La actualidad más candente

Event Pipe - Lambda Architecture
Event Pipe - Lambda ArchitectureEvent Pipe - Lambda Architecture
Event Pipe - Lambda Architecture
Bahadir Cambel
 
ELK Wrestling (Leeds DevOps)
ELK Wrestling (Leeds DevOps)ELK Wrestling (Leeds DevOps)
ELK Wrestling (Leeds DevOps)
Steve Elliott
 
RxJava in practice
RxJava in practice RxJava in practice
RxJava in practice
Javier Gamarra
 
PSUG #52 Dataflow and simplified reactive programming with Akka-streams
PSUG #52 Dataflow and simplified reactive programming with Akka-streamsPSUG #52 Dataflow and simplified reactive programming with Akka-streams
PSUG #52 Dataflow and simplified reactive programming with Akka-streams
Stephane Manciot
 
Scala.js: Next generation front end development in Scala
Scala.js:  Next generation front end development in ScalaScala.js:  Next generation front end development in Scala
Scala.js: Next generation front end development in Scala
Otto Chrons
 
My Gentle Introduction to RxJS
My Gentle Introduction to RxJSMy Gentle Introduction to RxJS
My Gentle Introduction to RxJS
Mattia Occhiuto
 
Logstash + Elasticsearch + Kibana Presentation on Startit Tech Meetup
Logstash + Elasticsearch + Kibana Presentation on Startit Tech MeetupLogstash + Elasticsearch + Kibana Presentation on Startit Tech Meetup
Logstash + Elasticsearch + Kibana Presentation on Startit Tech MeetupStartit
 
«Большие объёмы данных и сборка мусора в Java
«Большие объёмы данных и сборка мусора в Java«Большие объёмы данных и сборка мусора в Java
«Большие объёмы данных и сборка мусора в Java
Olga Lavrentieva
 
Intro to RxJava/RxAndroid - GDG Munich Android
Intro to RxJava/RxAndroid - GDG Munich AndroidIntro to RxJava/RxAndroid - GDG Munich Android
Intro to RxJava/RxAndroid - GDG Munich Android
Egor Andreevich
 
Interactive learning analytics dashboards with ELK (Elasticsearch Logstash Ki...
Interactive learning analytics dashboards with ELK (Elasticsearch Logstash Ki...Interactive learning analytics dashboards with ELK (Elasticsearch Logstash Ki...
Interactive learning analytics dashboards with ELK (Elasticsearch Logstash Ki...
Andrii Vozniuk
 
Airbnb Search Architecture: Presented by Maxim Charkov, Airbnb
Airbnb Search Architecture: Presented by Maxim Charkov, AirbnbAirbnb Search Architecture: Presented by Maxim Charkov, Airbnb
Airbnb Search Architecture: Presented by Maxim Charkov, Airbnb
Lucidworks
 
mongodb-aggregation-may-2012
mongodb-aggregation-may-2012mongodb-aggregation-may-2012
mongodb-aggregation-may-2012
Chris Westin
 
Distributed Real-Time Stream Processing: Why and How 2.0
Distributed Real-Time Stream Processing:  Why and How 2.0Distributed Real-Time Stream Processing:  Why and How 2.0
Distributed Real-Time Stream Processing: Why and How 2.0
Petr Zapletal
 
Logging for OpenStack - Elasticsearch, Fluentd, Logstash, Kibana
Logging for OpenStack - Elasticsearch, Fluentd, Logstash, KibanaLogging for OpenStack - Elasticsearch, Fluentd, Logstash, Kibana
Logging for OpenStack - Elasticsearch, Fluentd, Logstash, Kibana
Md Safiyat Reza
 
Logs aggregation and analysis
Logs aggregation and analysisLogs aggregation and analysis
Logs aggregation and analysis
Divante
 
Project kepler compile time metaprogramming for scala
Project kepler compile time metaprogramming for scalaProject kepler compile time metaprogramming for scala
Project kepler compile time metaprogramming for scala
Skills Matter Talks
 
Experiences in ELK with D3.js for Large Log Analysis and Visualization
Experiences in ELK with D3.js  for Large Log Analysis  and VisualizationExperiences in ELK with D3.js  for Large Log Analysis  and Visualization
Experiences in ELK with D3.js for Large Log Analysis and Visualization
Surasak Sanguanpong
 
How to start using Scala
How to start using ScalaHow to start using Scala
How to start using ScalaNgoc Dao
 
ELK Stack
ELK StackELK Stack
ELK Stack
Phuc Nguyen
 
A dive into akka streams: from the basics to a real-world scenario
A dive into akka streams: from the basics to a real-world scenarioA dive into akka streams: from the basics to a real-world scenario
A dive into akka streams: from the basics to a real-world scenario
Gioia Ballin
 

La actualidad más candente (20)

Event Pipe - Lambda Architecture
Event Pipe - Lambda ArchitectureEvent Pipe - Lambda Architecture
Event Pipe - Lambda Architecture
 
ELK Wrestling (Leeds DevOps)
ELK Wrestling (Leeds DevOps)ELK Wrestling (Leeds DevOps)
ELK Wrestling (Leeds DevOps)
 
RxJava in practice
RxJava in practice RxJava in practice
RxJava in practice
 
PSUG #52 Dataflow and simplified reactive programming with Akka-streams
PSUG #52 Dataflow and simplified reactive programming with Akka-streamsPSUG #52 Dataflow and simplified reactive programming with Akka-streams
PSUG #52 Dataflow and simplified reactive programming with Akka-streams
 
Scala.js: Next generation front end development in Scala
Scala.js:  Next generation front end development in ScalaScala.js:  Next generation front end development in Scala
Scala.js: Next generation front end development in Scala
 
My Gentle Introduction to RxJS
My Gentle Introduction to RxJSMy Gentle Introduction to RxJS
My Gentle Introduction to RxJS
 
Logstash + Elasticsearch + Kibana Presentation on Startit Tech Meetup
Logstash + Elasticsearch + Kibana Presentation on Startit Tech MeetupLogstash + Elasticsearch + Kibana Presentation on Startit Tech Meetup
Logstash + Elasticsearch + Kibana Presentation on Startit Tech Meetup
 
«Большие объёмы данных и сборка мусора в Java
«Большие объёмы данных и сборка мусора в Java«Большие объёмы данных и сборка мусора в Java
«Большие объёмы данных и сборка мусора в Java
 
Intro to RxJava/RxAndroid - GDG Munich Android
Intro to RxJava/RxAndroid - GDG Munich AndroidIntro to RxJava/RxAndroid - GDG Munich Android
Intro to RxJava/RxAndroid - GDG Munich Android
 
Interactive learning analytics dashboards with ELK (Elasticsearch Logstash Ki...
Interactive learning analytics dashboards with ELK (Elasticsearch Logstash Ki...Interactive learning analytics dashboards with ELK (Elasticsearch Logstash Ki...
Interactive learning analytics dashboards with ELK (Elasticsearch Logstash Ki...
 
Airbnb Search Architecture: Presented by Maxim Charkov, Airbnb
Airbnb Search Architecture: Presented by Maxim Charkov, AirbnbAirbnb Search Architecture: Presented by Maxim Charkov, Airbnb
Airbnb Search Architecture: Presented by Maxim Charkov, Airbnb
 
mongodb-aggregation-may-2012
mongodb-aggregation-may-2012mongodb-aggregation-may-2012
mongodb-aggregation-may-2012
 
Distributed Real-Time Stream Processing: Why and How 2.0
Distributed Real-Time Stream Processing:  Why and How 2.0Distributed Real-Time Stream Processing:  Why and How 2.0
Distributed Real-Time Stream Processing: Why and How 2.0
 
Logging for OpenStack - Elasticsearch, Fluentd, Logstash, Kibana
Logging for OpenStack - Elasticsearch, Fluentd, Logstash, KibanaLogging for OpenStack - Elasticsearch, Fluentd, Logstash, Kibana
Logging for OpenStack - Elasticsearch, Fluentd, Logstash, Kibana
 
Logs aggregation and analysis
Logs aggregation and analysisLogs aggregation and analysis
Logs aggregation and analysis
 
Project kepler compile time metaprogramming for scala
Project kepler compile time metaprogramming for scalaProject kepler compile time metaprogramming for scala
Project kepler compile time metaprogramming for scala
 
Experiences in ELK with D3.js for Large Log Analysis and Visualization
Experiences in ELK with D3.js  for Large Log Analysis  and VisualizationExperiences in ELK with D3.js  for Large Log Analysis  and Visualization
Experiences in ELK with D3.js for Large Log Analysis and Visualization
 
How to start using Scala
How to start using ScalaHow to start using Scala
How to start using Scala
 
ELK Stack
ELK StackELK Stack
ELK Stack
 
A dive into akka streams: from the basics to a real-world scenario
A dive into akka streams: from the basics to a real-world scenarioA dive into akka streams: from the basics to a real-world scenario
A dive into akka streams: from the basics to a real-world scenario
 

Similar a Clojure & Scala

Introduction to Scala language
Introduction to Scala languageIntroduction to Scala language
Introduction to Scala language
Aaqib Pervaiz
 
Building Asynchronous Applications
Building Asynchronous ApplicationsBuilding Asynchronous Applications
Building Asynchronous Applications
Johan Edstrom
 
CrateDB - Giacomo Ceribelli
CrateDB - Giacomo CeribelliCrateDB - Giacomo Ceribelli
CrateDB - Giacomo Ceribelli
ceribbo
 
It's Time To Stop Using Lambda Architecture
It's Time To Stop Using Lambda ArchitectureIt's Time To Stop Using Lambda Architecture
It's Time To Stop Using Lambda Architecture
Yaroslav Tkachenko
 
Building Distributed Systems in Scala
Building Distributed Systems in ScalaBuilding Distributed Systems in Scala
Building Distributed Systems in Scala
Alex Payne
 
Scala Days San Francisco
Scala Days San FranciscoScala Days San Francisco
Scala Days San Francisco
Martin Odersky
 
Scala adoption by enterprises
Scala adoption by enterprisesScala adoption by enterprises
Scala adoption by enterprises
Mike Slinn
 
Best practices in Java
Best practices in JavaBest practices in Java
Best practices in Java
Mudit Gupta
 
JavaScript Coding Guidelines
JavaScript Coding GuidelinesJavaScript Coding Guidelines
JavaScript Coding Guidelines
Oleksii Prohonnyi
 
Scala final ppt vinay
Scala final ppt vinayScala final ppt vinay
Scala final ppt vinay
Viplav Jain
 
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
Ngoc Dao
 
The Why and How of Scala at Twitter
The Why and How of Scala at TwitterThe Why and How of Scala at Twitter
The Why and How of Scala at Twitter
Alex Payne
 
Clojure for Java developers
Clojure for Java developersClojure for Java developers
Clojure for Java developers
John Stevenson
 
ES & Kafka
ES & KafkaES & Kafka
ES & Kafka
Diego Pacheco
 
Martin Odersky - Evolution of Scala
Martin Odersky - Evolution of ScalaMartin Odersky - Evolution of Scala
Martin Odersky - Evolution of ScalaScala Italy
 
It's Time To Stop Using Lambda Architecture | Yaroslav Tkachenko, Shopify
It's Time To Stop Using Lambda Architecture | Yaroslav Tkachenko, ShopifyIt's Time To Stop Using Lambda Architecture | Yaroslav Tkachenko, Shopify
It's Time To Stop Using Lambda Architecture | Yaroslav Tkachenko, Shopify
HostedbyConfluent
 
Terence Barr - jdk7+8 - 24mai2011
Terence Barr - jdk7+8 - 24mai2011Terence Barr - jdk7+8 - 24mai2011
Terence Barr - jdk7+8 - 24mai2011Agora Group
 
Java 9
Java 9Java 9
Java 9
Netesh Kumar
 
Java Hands-On Workshop
Java Hands-On WorkshopJava Hands-On Workshop
Java Hands-On Workshop
Arpit Poladia
 

Similar a Clojure & Scala (20)

Introduction to Scala language
Introduction to Scala languageIntroduction to Scala language
Introduction to Scala language
 
Building Asynchronous Applications
Building Asynchronous ApplicationsBuilding Asynchronous Applications
Building Asynchronous Applications
 
CrateDB - Giacomo Ceribelli
CrateDB - Giacomo CeribelliCrateDB - Giacomo Ceribelli
CrateDB - Giacomo Ceribelli
 
It's Time To Stop Using Lambda Architecture
It's Time To Stop Using Lambda ArchitectureIt's Time To Stop Using Lambda Architecture
It's Time To Stop Using Lambda Architecture
 
Building Distributed Systems in Scala
Building Distributed Systems in ScalaBuilding Distributed Systems in Scala
Building Distributed Systems in Scala
 
Scala Days San Francisco
Scala Days San FranciscoScala Days San Francisco
Scala Days San Francisco
 
Scala adoption by enterprises
Scala adoption by enterprisesScala adoption by enterprises
Scala adoption by enterprises
 
Best practices in Java
Best practices in JavaBest practices in Java
Best practices in Java
 
JavaScript Coding Guidelines
JavaScript Coding GuidelinesJavaScript Coding Guidelines
JavaScript Coding Guidelines
 
Scala final ppt vinay
Scala final ppt vinayScala final ppt vinay
Scala final ppt vinay
 
Scala-Ls1
Scala-Ls1Scala-Ls1
Scala-Ls1
 
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
 
The Why and How of Scala at Twitter
The Why and How of Scala at TwitterThe Why and How of Scala at Twitter
The Why and How of Scala at Twitter
 
Clojure for Java developers
Clojure for Java developersClojure for Java developers
Clojure for Java developers
 
ES & Kafka
ES & KafkaES & Kafka
ES & Kafka
 
Martin Odersky - Evolution of Scala
Martin Odersky - Evolution of ScalaMartin Odersky - Evolution of Scala
Martin Odersky - Evolution of Scala
 
It's Time To Stop Using Lambda Architecture | Yaroslav Tkachenko, Shopify
It's Time To Stop Using Lambda Architecture | Yaroslav Tkachenko, ShopifyIt's Time To Stop Using Lambda Architecture | Yaroslav Tkachenko, Shopify
It's Time To Stop Using Lambda Architecture | Yaroslav Tkachenko, Shopify
 
Terence Barr - jdk7+8 - 24mai2011
Terence Barr - jdk7+8 - 24mai2011Terence Barr - jdk7+8 - 24mai2011
Terence Barr - jdk7+8 - 24mai2011
 
Java 9
Java 9Java 9
Java 9
 
Java Hands-On Workshop
Java Hands-On WorkshopJava Hands-On Workshop
Java Hands-On Workshop
 

Más de Diego Pacheco

Naming Things Book : Simple Book Review!
Naming Things Book : Simple Book Review!Naming Things Book : Simple Book Review!
Naming Things Book : Simple Book Review!
Diego Pacheco
 
Continuous Discovery Habits Book Review.pdf
Continuous Discovery Habits  Book Review.pdfContinuous Discovery Habits  Book Review.pdf
Continuous Discovery Habits Book Review.pdf
Diego Pacheco
 
Thoughts about Shape Up
Thoughts about Shape UpThoughts about Shape Up
Thoughts about Shape Up
Diego Pacheco
 
Holacracy
HolacracyHolacracy
Holacracy
Diego Pacheco
 
AWS IAM
AWS IAMAWS IAM
AWS IAM
Diego Pacheco
 
Encryption Deep Dive
Encryption Deep DiveEncryption Deep Dive
Encryption Deep Dive
Diego Pacheco
 
Sec 101
Sec 101Sec 101
Sec 101
Diego Pacheco
 
Reflections on SCM
Reflections on SCMReflections on SCM
Reflections on SCM
Diego Pacheco
 
Management: Doing the non-obvious! III
Management: Doing the non-obvious! IIIManagement: Doing the non-obvious! III
Management: Doing the non-obvious! III
Diego Pacheco
 
Design is not Subjective
Design is not SubjectiveDesign is not Subjective
Design is not Subjective
Diego Pacheco
 
Architecture & Engineering : Doing the non-obvious!
Architecture & Engineering :  Doing the non-obvious!Architecture & Engineering :  Doing the non-obvious!
Architecture & Engineering : Doing the non-obvious!
Diego Pacheco
 
Management doing the non-obvious II
Management doing the non-obvious II Management doing the non-obvious II
Management doing the non-obvious II
Diego Pacheco
 
Testing in production
Testing in productionTesting in production
Testing in production
Diego Pacheco
 
Nine lies about work
Nine lies about workNine lies about work
Nine lies about work
Diego Pacheco
 
Management: doing the nonobvious!
Management: doing the nonobvious!Management: doing the nonobvious!
Management: doing the nonobvious!
Diego Pacheco
 
AI and the Future
AI and the FutureAI and the Future
AI and the Future
Diego Pacheco
 
Dealing with dependencies
Dealing  with dependenciesDealing  with dependencies
Dealing with dependencies
Diego Pacheco
 
Dealing with dependencies in tests
Dealing  with dependencies in testsDealing  with dependencies in tests
Dealing with dependencies in tests
Diego Pacheco
 
Kanban 2020
Kanban 2020Kanban 2020
Kanban 2020
Diego Pacheco
 

Más de Diego Pacheco (20)

Naming Things Book : Simple Book Review!
Naming Things Book : Simple Book Review!Naming Things Book : Simple Book Review!
Naming Things Book : Simple Book Review!
 
Continuous Discovery Habits Book Review.pdf
Continuous Discovery Habits  Book Review.pdfContinuous Discovery Habits  Book Review.pdf
Continuous Discovery Habits Book Review.pdf
 
Thoughts about Shape Up
Thoughts about Shape UpThoughts about Shape Up
Thoughts about Shape Up
 
Holacracy
HolacracyHolacracy
Holacracy
 
AWS IAM
AWS IAMAWS IAM
AWS IAM
 
CDKs
CDKsCDKs
CDKs
 
Encryption Deep Dive
Encryption Deep DiveEncryption Deep Dive
Encryption Deep Dive
 
Sec 101
Sec 101Sec 101
Sec 101
 
Reflections on SCM
Reflections on SCMReflections on SCM
Reflections on SCM
 
Management: Doing the non-obvious! III
Management: Doing the non-obvious! IIIManagement: Doing the non-obvious! III
Management: Doing the non-obvious! III
 
Design is not Subjective
Design is not SubjectiveDesign is not Subjective
Design is not Subjective
 
Architecture & Engineering : Doing the non-obvious!
Architecture & Engineering :  Doing the non-obvious!Architecture & Engineering :  Doing the non-obvious!
Architecture & Engineering : Doing the non-obvious!
 
Management doing the non-obvious II
Management doing the non-obvious II Management doing the non-obvious II
Management doing the non-obvious II
 
Testing in production
Testing in productionTesting in production
Testing in production
 
Nine lies about work
Nine lies about workNine lies about work
Nine lies about work
 
Management: doing the nonobvious!
Management: doing the nonobvious!Management: doing the nonobvious!
Management: doing the nonobvious!
 
AI and the Future
AI and the FutureAI and the Future
AI and the Future
 
Dealing with dependencies
Dealing  with dependenciesDealing  with dependencies
Dealing with dependencies
 
Dealing with dependencies in tests
Dealing  with dependencies in testsDealing  with dependencies in tests
Dealing with dependencies in tests
 
Kanban 2020
Kanban 2020Kanban 2020
Kanban 2020
 

Último

Mind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AIMind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AI
Kumud Singh
 
By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024
Pierluigi Pugliese
 
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
Neo4j
 
UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6
DianaGray10
 
Climate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing DaysClimate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing Days
Kari Kakkonen
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
Safe Software
 
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AI
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AIEnchancing adoption of Open Source Libraries. A case study on Albumentations.AI
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AI
Vladimir Iglovikov, Ph.D.
 
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex ProofszkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
Alex Pruden
 
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
SOFTTECHHUB
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
ControlCase
 
Video Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the FutureVideo Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the Future
Alpen-Adria-Universität
 
Pushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 daysPushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 days
Adtran
 
Introduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - CybersecurityIntroduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - Cybersecurity
mikeeftimakis1
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance
 
RESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for studentsRESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for students
KAMESHS29
 
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
名前 です男
 
20 Comprehensive Checklist of Designing and Developing a Website
20 Comprehensive Checklist of Designing and Developing a Website20 Comprehensive Checklist of Designing and Developing a Website
20 Comprehensive Checklist of Designing and Developing a Website
Pixlogix Infotech
 
Full-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalizationFull-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalization
Zilliz
 
20240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 202420240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 2024
Matthew Sinclair
 
How to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptxHow to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptx
danishmna97
 

Último (20)

Mind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AIMind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AI
 
By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024
 
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
 
UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6
 
Climate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing DaysClimate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing Days
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
 
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AI
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AIEnchancing adoption of Open Source Libraries. A case study on Albumentations.AI
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AI
 
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex ProofszkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
 
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
 
Video Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the FutureVideo Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the Future
 
Pushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 daysPushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 days
 
Introduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - CybersecurityIntroduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - Cybersecurity
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
 
RESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for studentsRESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for students
 
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
 
20 Comprehensive Checklist of Designing and Developing a Website
20 Comprehensive Checklist of Designing and Developing a Website20 Comprehensive Checklist of Designing and Developing a Website
20 Comprehensive Checklist of Designing and Developing a Website
 
Full-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalizationFull-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalization
 
20240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 202420240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 2024
 
How to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptxHow to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptx
 

Clojure & Scala

  • 2.
  • 3. Clojure ❏ 2007 ❏ Rich Hickey ❏ JVM based but also CLR and JavaScript ❏ Functional dialect of Lisp ❏ Immutability & Immutable Data Structures ❏ Great interoperability with Java ❏ But -> Slow and Hard to troubleshoot.
  • 4. Who is using Clojure? https://clojure.org/community/companies
  • 5.
  • 6.
  • 7. “Function as Data, Data as functions” -- RH. You don't need classes: Just Functions and Data!
  • 8.
  • 10. Lisp
  • 11.
  • 12. Getting started with lien (Clojure build system) ❏ Clojure Build System ❏ Compatible with Maven Repos ❏ Super Easy to use https://leiningen.org/
  • 13. Hello World on lein REPL
  • 14. From a File (*.clj)
  • 15. From a File (*.clj)
  • 16. From a File (*.clj)
  • 17. Basics ❏ Lists () ❏ Vectors [] ❏ Assign with Let ❏ “Strings” ❏ seq ❏ if
  • 21. map
  • 22. map
  • 27. Sets ❏ Like Math Sets ❏ Unsorted ❏ NO Duplicates ❏ Efficient: ❏ Checking ❏ Removal ❏ (sorted-set)
  • 29. Maps ❏ Also known as ❏ Dictionaries ❏ Hash Maps ❏ Assoc k/v pairs ❏ Domain data ❏ (sorted-map)
  • 30. Working with “Pojos” == Maps. ❏ What can you do with a Pojo in OOP? Nothing. ❏ In clojure? A lot !!! ❏ Remember “Alan Perlis” ❏ No need to define “schema” ❏ Productivity ❏ Simplicity
  • 31. defrecord here is our class be happy :-)
  • 33. Web Development ... Compojure & Ring $ lein new compojure hello-world $ cd hello-world $ lein run server-headless
  • 34. Open your browser on http://localhost:3000/
  • 37. Exercises 1. Write a function which returns the last element in a sequence without using *last*. Test data: (A) [10 20 30 40 50] (B) '(10 8 1) (C) ["x" "y" "z"] 2. Write a function which sum of a sequence of numbers without using *reduce*. Test data: (A) [1 2 3 4 5 6] (B) '(0 0 -1 1 2 3) (C) #{40 50 25 15 10} 3. Write a REST service with clojure, all persistence needs to be done in memory using maps or records. You will need to create an BANK application with: deposit, withdrawal, check balance, transfer money into other accounts. You will need do proper validations and also unit tests. Your application need to use lein and compojure there are no other frameworks/libs allowed. You cannot use: for, if and let.
  • 38. Scala ❏ 2004 ❏ Functional Programing Language ❏ Based on Haskell ❏ Runs on the JVM also JavaScript ❏ Statically typed ❏ Better Java ❏ Awesome for Big Data / ML ❏ Created by Martin Odersky
  • 39. SBT ❏ Build System for Scala ❏ IF you are working with scala you also could do: ❏ Maven ❏ Gradle ❏ In practice SBT is the right choice.
  • 42. SBT has a REPL too ($ sbt console)
  • 43. Functions ❏ Functions ❏ Lambdas ❏ Are all Objects ❏ Since implementation in java (JVM).
  • 44. Partial Application ❏ Partial ❏ Lazy ❏ Composition ❏ Re-use
  • 45. Partial Application via Currying ❏ Partial ❏ Lazy ❏ Composition ❏ Re-use
  • 46. Variable lengths arguments or in java terms varargs. ❏ * ❏ Dynamic ❏ Generic ❏ Similar to java
  • 47. OOP in Scala: Class ❏ Scala support OOP ❏ Here is the better java part starts ❏ Simple ❏ Clean ❏ Less Verbose
  • 48. OOP in Scala: Class Constructor + String Interpolation
  • 49. OOP in Scala: Inheritance ❏ Class Hierarchy ❏ Polymorphism
  • 50. OOP in Scala: Polymorphism Overriding ❏ Class Hierarchy ❏ Polymorphism ❏ Overriding
  • 51. OOP in Scala: Traits ❏ Similar to Java Interfaces ❏ However you can have code ❏ Fundamental part of type system (“Algebra”) ❏ One of best things in Scala ❏ Be Careful it can get crazy :D ❏ Stay practical stay clean!
  • 52. OOP in Scala: Generics + Types ❏ Generics ❏ Types ❏ Abstractions ❏ Leverage Compiler ❏ Haskell way
  • 53. Apply ❏ Apply ❏ Code runs ❏ Default in Scala ❏ Like toString In Java but better ❏ Super useful
  • 54. OOP in Scala: Objects ❏ Different then Java Objects ❏ Objects are single instance ❏ It's how you do Singletons in Scala ❏ Great for org static functions ❏ Often classes have companion Objects in Scala. ❏ Functions in Scala are Objects.
  • 55. Pattern Matcher ❏ One of the best features In Scala Language. ❏ Support ifs ❏ Support “_” ❏ Support type matching ❏ Better than Switch
  • 57. Case classes ❏ One of the best features In Scala Language. ❏ Super charged Classes ❏ Equality & toString Support ❏ Work on Pattern Matcher ❏ Super clean syntax
  • 58. Collections ❏ Like in Java ❏ But much better ❏ Immutable ❏ Mutable ❏ Tupes ❏ Sets, Arrays, Lists, ❏ Maps vs Map
  • 59. map, filter, foldLeft ❏ Functional Combinators ❏ Core FP prog ❏ Super useful ❏ Day by Day work
  • 60. Exercises 1. Write a function which finds the last element in a List without using *last*. Test data: (A) List(1,2,3,4,5,6,7,8) (B) List(“1”,”2”,”3”) (C) List(1.0,2.0,3.0) 2. Write a function which Flatten a nested list structure. Test data: (A) flatten(List(List(1, 1), 2, List(3, List(5, 8)))) (B) (List(), 2, List(3,4)) 3. Write a REST service with Scala, all persistence needs to be done in memory using maps or records. You will need to create an BANK application with: deposit, withdrawal, check balance, transfer money into other accounts. You will need do proper validations and also unit tests. Your application need to use lein and compojure there are no other frameworks/libs allowed. You cannot use: for, if and let.