SlideShare une entreprise Scribd logo
1  sur  33
Scala Days 2013
Gilt Groupe
ebowman@gilt.com
http://www.flickr.com/photos/justusthane/1252907196/
Gilt provides insider access to today’s top designer labels, at up to 60% off retail.
Through our daily flash sales, which begin at noon EST, we offer everything from
high-end designer clothing and home furnishings to fine dining experiences. Our
products are grouped into five stores: Women, Men, Baby & Kids, Home and City.
Working from New York City, Dublin, or home/remotely, Gilt Tech’s 120 engineers
develop all of our technology in-house. Since Gilt’s founding days, we have
pursued a structure that enables us to address unique needs other e-commerce
platforms simply cannot support. These needs include the ability to handle
intense traffic spikes, offer prompt customer service, manage operations
(inventory, payments and shipping), and execute many other tasks.
As a rapidly growing company with an international customer base, Gilt’s priorities
focus on scalability and personalization. Gilt.com was originally built on Ruby on
Rails, but our rapid growth quickly led to scalability issues — prompting us to
migrate many parts of our website to the Java Virtual Machine. In 2011 we began
migrating our operations to Scala, which is currently our core stack.
http://search.savills.com/property-detail/gbedrseds090073
http://en.wikipedia.org/wiki/File:John_Paul_Jones_by_Charles_Wilson_Peale,_c1781.jpg
http://books.google.ie/books?id=diROAAAAYAAJ&pg=PA400&img=1&zoom=3&hl=en&sig=ACfU3U35lRj3v5Hwfzqe6ANIFr5f4L5RdA&ci=365%2C82%2C311%2C259&edge=0
“Symmetry,aswideorasnarrow
asyoumaydefineitsmeaning,is
oneideabywhichmanthrough
theageshastriedtocomprehend
andcreateorder,beauty,and
perfection.”--HermannWeyl
Symmetry:NotHowItLooks
Symmetryischanging
withoutchanging.
HowisScala
Symmetric?
EverythingisanObject
Java Scala
void dump(int x) {
System.out.println(
Integer.toString(x));
}
def dump(x: Int): Unit = {
println(x.toString)
}
void dump(Complex x) {
System.out.println(
x.toString());
}
def dump(x: Complex): Unit = {
println(x.toString)
}
:(
def dump[T](x: T): Unit = {
println(x.toString)
}
UniformAccessPrinciple
Java Scala
public class Datum {
public final int x;
public Datum(int x) {
this.x = x;
}
}
class Datum(val x: Int)
public class Datum {
private final int y;
public int x() {
return f(g(y));
}
public Datum(int y) {
this.y = y;
}
}
class Datum(y: Int) {
def x = f(g(y))
}
“All services offered by a module should be available through a
uniform notation, which does not betray whether they are implemented
through storage or through computation” - Bertrand Meyer
http://en.wikipedia.org/wiki/Uniform_access_principle
Immutable|Mutable
List<String> foo() {
ArrayList<String> items = computeItems();
return items;
}
Immutable|Mutable
List<String> foo() {
ArrayList<String> items = computeItems();
if (unlikelyThing()) {
return items.subList(
0, items.size() / 2);
} else {
return items;
}
}
List<String> foo() {
ArrayList<String> items = computeItems();
return items;
}
PatternMatching
x match {
case even if (x % 2) == 0 => even/2
case odd => odd + 1
}
PatternMatching
x match {
case even if (x % 2) == 0 => even/2
case odd => odd + 1
}
catch {
case io: IOException => ...
case e: Exception => ...
}
PatternMatching
x match {
case even if (x % 2) == 0 => even/2
case odd => odd + 1
}
catch {
case io: IOException => ...
case e: Exception => ...
}
val split: String => String = {
case null => None
case str => Some(str)
}
Monads
for {
x <- monad1
y <- monad2
} yield x op y
Monads
for {
x <- monad1
y <- monad2
} yield x op y
Traversable
Option
Future
IO
Reader
Writer
Error
Continuation
Asymmetry
PointlessSymmetry
try {
Class c = Class.forName("MyClass");
Object instance = c.newInstance();
c.getMethod("myMethod").invoke(instance);
} catch (NullPointerException e) {
} catch (IllegalAccessException e) {
} catch (InvocationTargetException e) {
} catch (ClassNotFoundException e) {
} catch (NoSuchMethodException e) {
} catch (InstantiationException e) {
}
http://www.metalev.org/2011/04/source-code-symmetry-and-transcendent.html
a[i].x += a[i - 1].x;
a[i].y += a[i - 1].y;
Ill-ConceivedSymmetry
http://www.metalev.org/2011/04/source-code-symmetry-and-transcendent.html
a[i].x += a[i - 1].x;
a[i].y += a[i - 1].y;
a(i) += a(i - 1)
Ill-ConceivedSymmetry
private def immediateAstNodes(n: Any): List[AstNode] = n match {
case a: AstNode List(a)
case t: Token Nil
case Some(x) immediateAstNodes(x)
case xs @ (_ :: _) xs flatMap { immediateAstNodes(_) }
case Left(x) immediateAstNodes(x)
case Right(x) immediateAstNodes(x)
case (l, r) immediateAstNodes(l) ++ immediateAstNodes(r)
case (x, y, z) immediateAstNodes(x) ++ immediateAstNodes(y) ++ immediateAstNodes(z)
case true | false | Nil | None Nil
}
http://stackoverflow.com/questions/8618082/visitor-pattern-in-scala
BeautifulAsymmetry
Symmetry&Aesthetics
Symmetry&Aesthetics
http://pages.cs.wisc.edu/~dyer/vsam/images/mona.gif
Symmetry&Aesthetics
http://pages.cs.wisc.edu/~dyer/vsam/images/mona.gif
http://www.leonardodavinci.net/images/gallery/monalisa_detail1.jpg
Symmetry&Aesthetics
http://pages.cs.wisc.edu/~dyer/vsam/images/mona.gif
http://www.leonardodavinci.net/images/gallery/monalisa_detail1.jpg
http://www.saylor.org/site/wp-content/uploads/2012/04/6-mona-lisa.gif
Balance
Rest
Binding
Order
Law
Rigidity
Constraint
Motion
Loosening
Arbitrariness
Accident
Life & Play
Freedom
http://www.acadeuro.org/fileadmin/user_upload/publications/ER_Symmetry_supplement/Lorenz.pdf
Balance
Rest
Binding
Order
Law
Rigidity
Constraint
Motion
Loosening
Arbitrariness
Accident
Life & Play
Freedom
http://www.acadeuro.org/fileadmin/user_upload/publications/ER_Symmetry_supplement/Lorenz.pdf
Platform Product
Symmetry Asymmetry
http://upload.wikimedia.org/wikipedia/commons/thumb/d/db/MaryRose-carpentry_tools1.jpg/250px-MaryRose-carpentry_tools1.jpg
http://test.classconnection.s3.amazonaws.com/324/flashcards/95324/png/altarpiece.png
http://upload.wikimedia.org/wikipedia/commons/6/63/Michelangelos_David.jpg
http://amolife.com/image/images/stories/Art&Abstract/most_popular_sculptures%20(7).jpg
http://www.biographyonline.net/artists/images/Much-The_Scream.jpg
http://www.pics24h.com/img/artwork/5-most-famous-paintings/5-most-famous-paintings03.jpg
http://upload.wikimedia.org/wikipedia/commons/6/63/Michelangelos_David.jpg
http://amolife.com/image/images/stories/Art&Abstract/most_popular_sculptures%20(7).jpg
http://www.biographyonline.net/artists/images/Much-The_Scream.jpg
http://www.pics24h.com/img/artwork/5-most-famous-paintings/5-most-famous-paintings03.jpg
http://www.iie.org/~/media/Images/Corporate/Static-Header/D-F/SH-EmmyNoether.ashx?mh=235&mw=300
http://memegenerator.net/instance/38640565
FinFin
http://tech.gilt.com
@gilttech
@ebowman
ebowman@gilt.com

Contenu connexe

Similaire à Scala & symmetry

Priming Java for Speed at Market Open
Priming Java for Speed at Market OpenPriming Java for Speed at Market Open
Priming Java for Speed at Market OpenAzul Systems Inc.
 
Agile Data Science 2.0
Agile Data Science 2.0Agile Data Science 2.0
Agile Data Science 2.0Russell Jurney
 
From clever code to better code
From clever code to better codeFrom clever code to better code
From clever code to better codeDror Helper
 
Art of Javascript
Art of JavascriptArt of Javascript
Art of JavascriptTarek Yehia
 
Scaling business app development with Play and Scala
Scaling business app development with Play and ScalaScaling business app development with Play and Scala
Scaling business app development with Play and ScalaPeter Hilton
 
Ten useful JavaScript tips & best practices
Ten useful JavaScript tips & best practicesTen useful JavaScript tips & best practices
Ten useful JavaScript tips & best practicesAnkit Rastogi
 
vertopal.com_DataEncodingForDataClustering-5 (1).pdf
vertopal.com_DataEncodingForDataClustering-5 (1).pdfvertopal.com_DataEncodingForDataClustering-5 (1).pdf
vertopal.com_DataEncodingForDataClustering-5 (1).pdfzraibianour
 
Deep Anomaly Detection from Research to Production Leveraging Spark and Tens...
 Deep Anomaly Detection from Research to Production Leveraging Spark and Tens... Deep Anomaly Detection from Research to Production Leveraging Spark and Tens...
Deep Anomaly Detection from Research to Production Leveraging Spark and Tens...Databricks
 
Joining the Club: Using Spark to Accelerate Big Data at Dollar Shave Club
Joining the Club: Using Spark to Accelerate Big Data at Dollar Shave ClubJoining the Club: Using Spark to Accelerate Big Data at Dollar Shave Club
Joining the Club: Using Spark to Accelerate Big Data at Dollar Shave ClubData Con LA
 
Idioms in swift 2016 05c
Idioms in swift 2016 05cIdioms in swift 2016 05c
Idioms in swift 2016 05cKaz Yoshikawa
 

Similaire à Scala & symmetry (11)

Priming Java for Speed at Market Open
Priming Java for Speed at Market OpenPriming Java for Speed at Market Open
Priming Java for Speed at Market Open
 
Agile Data Science 2.0
Agile Data Science 2.0Agile Data Science 2.0
Agile Data Science 2.0
 
From clever code to better code
From clever code to better codeFrom clever code to better code
From clever code to better code
 
Art of Javascript
Art of JavascriptArt of Javascript
Art of Javascript
 
Scaling business app development with Play and Scala
Scaling business app development with Play and ScalaScaling business app development with Play and Scala
Scaling business app development with Play and Scala
 
Ten useful JavaScript tips & best practices
Ten useful JavaScript tips & best practicesTen useful JavaScript tips & best practices
Ten useful JavaScript tips & best practices
 
vertopal.com_DataEncodingForDataClustering-5 (1).pdf
vertopal.com_DataEncodingForDataClustering-5 (1).pdfvertopal.com_DataEncodingForDataClustering-5 (1).pdf
vertopal.com_DataEncodingForDataClustering-5 (1).pdf
 
Deep Anomaly Detection from Research to Production Leveraging Spark and Tens...
 Deep Anomaly Detection from Research to Production Leveraging Spark and Tens... Deep Anomaly Detection from Research to Production Leveraging Spark and Tens...
Deep Anomaly Detection from Research to Production Leveraging Spark and Tens...
 
JavaScript Refactoring
JavaScript RefactoringJavaScript Refactoring
JavaScript Refactoring
 
Joining the Club: Using Spark to Accelerate Big Data at Dollar Shave Club
Joining the Club: Using Spark to Accelerate Big Data at Dollar Shave ClubJoining the Club: Using Spark to Accelerate Big Data at Dollar Shave Club
Joining the Club: Using Spark to Accelerate Big Data at Dollar Shave Club
 
Idioms in swift 2016 05c
Idioms in swift 2016 05cIdioms in swift 2016 05c
Idioms in swift 2016 05c
 

Dernier

Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAndikSusilo4
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...HostedbyConfluent
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 

Dernier (20)

Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & Application
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping Elbows
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 

Scala & symmetry