SlideShare une entreprise Scribd logo
1  sur  52
Télécharger pour lire hors ligne
Taking DRY seriously
@FredyFadel
Aspectize.com
Without data
you are just another person
with an opinion.
Without opinion
you are a person just
with another dataset.
 From punch cards to Javascript
 more than 35 years of daily programming
 Co-Founder of two companies :
 Winwise (1993-2008)
 Aspectize (2007- always running)
 @FredyFadel
 http://www.scoop.it/t/web-tools-and-technologies
Code
DRY
Technical
NonTechnical
Separation
The thing, the job and it’s problems
Do we have any ?
…
Trying hard to do things right
but
We are not doing the right thing
It’s difficult.
HUMANS MACHINES
Ambiguities
Automating
As much as possible but not more
Human  Machine
Valuable information  Irrelevant details
 The computer revolution hasn't happened yet.
 OOPSLA - Alan Kay : 1997
 The real computer revolution hasn't happened yet.
 Education - Alan Kay : 2007
 Software is eating the world (Marc Andreessen : 2011).
 Books, Music,Video, Entertainment, Photography, Recruitment…
 And it’s just the beginning.
 First time in history we have a global many to many communication system
and it’s software.
 While describing your job, would you use the word growing ?
 Do you grow software ?
 Things that grow
 Cities, plants…
 Networks :The internet, theWeb, communication end points…
 Data : it’s shape, it’s volume
 Ceremonial complexity : Often due to code it’s shape, it’s volume
 Cars don’t grow : they are “born” dead
I'm not against types, but I don't know of
any type systems that aren't a complete
pain, so I still like dynamic typing.
Actually I made up the term "object-oriented",
and I can tell you I did not have C++ in mind.
Alan Kay
Dynamic
Slow
Continuous
Non stop
Class
Code
Deliverable at any time
Never finished
Is about automating
What is repeatable and valueless
Machines are good at repeating
Valuable best practices
It could be business oriented or technical.
But yet not interfering with intelligent choices
It’s distinguishing the invariant from the variable.
Eliminating
Waste
Cumbersome work
It’s about removing “redundancies”
Logical redundancies
It’s not about factoring code
Work less, do moreAutomation
It’s not about code
it’s about connections
Have nothing to do with code
Solving the puzzle
Rotating sides
Directing the flow of
information between humans
and machines
Reuse, DRY andWET
Do you have the impression of repeating yourself ?
 Repeating can be fun and lucrative
 You gain knowledge and expertise (at least in the beginning)
 You can maintain an impression of knowledge and expertise
 The widespread Not Invented Here syndrome
 You can easily mess up reuse
 left-pad story in node community
 “A little copying is better than a little dependency”
Write Everything Once
Is as dumb as
WET ==Write EverythingTwice
Is reusable what is reused
We reuse every day
tools, ideas, code others have written, resources…
We reuse because it’s seamless and has value
Habit
Even when it’s not seamless
Changing habits is expensive
Imitation
Surfing the buzz waves
 Best example
 Operating system
▪ Language independent
▪ Code independent
 Even better example
 Browser
▪ “Language independent”
▪ Operating system independent
Every piece of knowledge must have a
single, unambiguous, representation
within a system.
The Pragmatic Programmer
Taking Orthogonality Seriously
 Reuse is impossible if the reusable is not identified
 If the invariant is not identified
 If the independent is not identified
 Orthogonal is just a fancy way of saying independent
 The reusable won’t be reused if reuse is not more or less
seamless
 The invariant is what can be reused if it’s totally separated
from the variable (from the non reusable)
 The reuse of the invariant can be automated to make it
seamless
 AOP is a technique of automating the invariant.
 Separating what
 Business oriented code
 Technical code
 Because they are clearly independent
 Each have their own invariants
 Each evolve in their own pace
 Some technical invariants
 Network, bytes and clicks
 JSON, HTTP, SQL,Authentication, Browsers, Devices…
 Some business variable
 UX
 Data (it’s shape)
 Processes
HOW ?
Don't
call us
We'll
call you
Technical code calls business code
 Some history
 1997 MicrosoftTransaction Server (MTS)
▪ Declarative runtime attributes
 2000 COM+
▪ More attributes
 2002 .net
▪ Declarative and programmable attributes
 Attributes
 Create your own or use existing
 Tying
 the attribute to your code
 Engine (middle ware)
 to operate the magic (to automate)
 Some existing examples
[Conditional("DEBUG")] voidTrace (string msg) { …; }
[PrincipalPermission (SecurityAction.Demand, Role = "Admin")]
public DataSet LoadAdminData () { …; }
[assembly:InternalsVisibleToAttribute("YourAssembly, PublicKey=8b…ff")]
 Some potential examples
[DateValidator("yyyy-MM-dd")]TextBox birthDay = newTextBox ();
[Command(BrowserCacheDuration = "30 Minutes")]
doubleTemperature (string city);
 The mighty TransparentProxy
 A transparent proxy is an object that can simulate any interface !
 Easy to implement
▪ Less than 50 lines of C#
▪ You just need to implement it once in your life
 Enables you to intercept all calls and provide valuable orthogonal
technical services through aTechnical Engine.
 .net attributes are fine for technical aspects that require a
small amount of information
 For more sophisticated aspects a DSL can be used to load
information into theTechnical Engine.
 DSL example : Gherkin in Cucumber.
 Integrated inVisual Studio
 Graphical DSL for describing
▪ The shape of Data
 Textual DSL for describing bindings
▪ Data
▪ Command
▪ Layout
 A JavascriptTechnical Engine that automates
 Producing HTML in the browser
 Sending/Receiving Data
 Manging State
 A .netTechnical Engine that automates
 Reading/Writing Data
 Azure integration
Load Information
Payment
Save Information
Business operation
Technical
Engine
Load Information
Payment
Save Information
Business operation
Technical
Engine
http://www.meetup.com/fr-FR/Aspectize-Paris-Meetup/
Next one is on may 19th @ 5:30pm hosted by Microsoft
Issy les Moulineaux

Contenu connexe

Similaire à DRY

Developer's Introduction to Machine Learning
Developer's Introduction to Machine LearningDeveloper's Introduction to Machine Learning
Developer's Introduction to Machine LearningChristopher Mohritz
 
Beginners guide-to-coding-updated
Beginners guide-to-coding-updatedBeginners guide-to-coding-updated
Beginners guide-to-coding-updatedSaidLezzar
 
Classroom to careers in Web Development
Classroom to careers in Web DevelopmentClassroom to careers in Web Development
Classroom to careers in Web DevelopmentDouglas Ng
 
Voxxed Athens 2018 - UX design and back-ends: When the back-end meets the user
Voxxed Athens 2018 - UX design and back-ends: When the back-end meets the userVoxxed Athens 2018 - UX design and back-ends: When the back-end meets the user
Voxxed Athens 2018 - UX design and back-ends: When the back-end meets the userVoxxed Athens
 
Sunny Tech 2019 - Craft Forever
Sunny Tech 2019 - Craft ForeverSunny Tech 2019 - Craft Forever
Sunny Tech 2019 - Craft ForeverCyrille Martraire
 
Models vs Reality: Quest for the Roots of Complexity
Models vs Reality: Quest for the Roots of ComplexityModels vs Reality: Quest for the Roots of Complexity
Models vs Reality: Quest for the Roots of ComplexityJulian Warszawski
 
From dev to ops and beyond - getting it done
From dev to ops and beyond - getting it doneFrom dev to ops and beyond - getting it done
From dev to ops and beyond - getting it doneEdorian
 
Edt08 June08 004
Edt08 June08 004Edt08 June08 004
Edt08 June08 004Kevin Corti
 
Le PC est mort. Vive le PC!
Le PC est mort. Vive le PC!Le PC est mort. Vive le PC!
Le PC est mort. Vive le PC!Giorgio Pauletto
 
[GDSC @ UoL] Chip Chat
[GDSC @ UoL] Chip Chat[GDSC @ UoL] Chip Chat
[GDSC @ UoL] Chip ChatTan
 
Grammarly AI-NLP Club #2 - Recent advances in applied chatbot technology - Jo...
Grammarly AI-NLP Club #2 - Recent advances in applied chatbot technology - Jo...Grammarly AI-NLP Club #2 - Recent advances in applied chatbot technology - Jo...
Grammarly AI-NLP Club #2 - Recent advances in applied chatbot technology - Jo...Grammarly
 
Evolving as a professional software developer
Evolving as a professional software developerEvolving as a professional software developer
Evolving as a professional software developerAnton Kirillov
 
Automating With Excel An Object Oriented Approach
Automating  With  Excel    An  Object  Oriented  ApproachAutomating  With  Excel    An  Object  Oriented  Approach
Automating With Excel An Object Oriented ApproachRazorleaf Corporation
 
Demystifying Machine Learning - How to give your business superpowers.
Demystifying Machine Learning - How to give your business superpowers.Demystifying Machine Learning - How to give your business superpowers.
Demystifying Machine Learning - How to give your business superpowers.10x Nation
 
Feedback loops between tooling and culture
Feedback loops between tooling and cultureFeedback loops between tooling and culture
Feedback loops between tooling and cultureChris Winters
 
Diagnosability vs The Cloud
Diagnosability vs The CloudDiagnosability vs The Cloud
Diagnosability vs The CloudBob Rhubart
 
Diagnosability versus The Cloud, Redwood Shores 2011-08-30
Diagnosability versus The Cloud, Redwood Shores 2011-08-30Diagnosability versus The Cloud, Redwood Shores 2011-08-30
Diagnosability versus The Cloud, Redwood Shores 2011-08-30Cary Millsap
 
Integrating and publishing public safety data using semantic technologies
Integrating and publishing public safety data using semantic technologiesIntegrating and publishing public safety data using semantic technologies
Integrating and publishing public safety data using semantic technologiesAlvaro Graves
 
Herding cats in the Cloud
Herding cats in the CloudHerding cats in the Cloud
Herding cats in the CloudDewey Sasser
 

Similaire à DRY (20)

Developer's Introduction to Machine Learning
Developer's Introduction to Machine LearningDeveloper's Introduction to Machine Learning
Developer's Introduction to Machine Learning
 
Beginners guide-to-coding-updated
Beginners guide-to-coding-updatedBeginners guide-to-coding-updated
Beginners guide-to-coding-updated
 
Classroom to careers in Web Development
Classroom to careers in Web DevelopmentClassroom to careers in Web Development
Classroom to careers in Web Development
 
Voxxed Athens 2018 - UX design and back-ends: When the back-end meets the user
Voxxed Athens 2018 - UX design and back-ends: When the back-end meets the userVoxxed Athens 2018 - UX design and back-ends: When the back-end meets the user
Voxxed Athens 2018 - UX design and back-ends: When the back-end meets the user
 
Sunny Tech 2019 - Craft Forever
Sunny Tech 2019 - Craft ForeverSunny Tech 2019 - Craft Forever
Sunny Tech 2019 - Craft Forever
 
Models vs Reality: Quest for the Roots of Complexity
Models vs Reality: Quest for the Roots of ComplexityModels vs Reality: Quest for the Roots of Complexity
Models vs Reality: Quest for the Roots of Complexity
 
From dev to ops and beyond - getting it done
From dev to ops and beyond - getting it doneFrom dev to ops and beyond - getting it done
From dev to ops and beyond - getting it done
 
Edt08 June08 004
Edt08 June08 004Edt08 June08 004
Edt08 June08 004
 
Le PC est mort. Vive le PC!
Le PC est mort. Vive le PC!Le PC est mort. Vive le PC!
Le PC est mort. Vive le PC!
 
[GDSC @ UoL] Chip Chat
[GDSC @ UoL] Chip Chat[GDSC @ UoL] Chip Chat
[GDSC @ UoL] Chip Chat
 
Grammarly AI-NLP Club #2 - Recent advances in applied chatbot technology - Jo...
Grammarly AI-NLP Club #2 - Recent advances in applied chatbot technology - Jo...Grammarly AI-NLP Club #2 - Recent advances in applied chatbot technology - Jo...
Grammarly AI-NLP Club #2 - Recent advances in applied chatbot technology - Jo...
 
Evolving as a professional software developer
Evolving as a professional software developerEvolving as a professional software developer
Evolving as a professional software developer
 
Automating With Excel An Object Oriented Approach
Automating  With  Excel    An  Object  Oriented  ApproachAutomating  With  Excel    An  Object  Oriented  Approach
Automating With Excel An Object Oriented Approach
 
Demystifying Machine Learning - How to give your business superpowers.
Demystifying Machine Learning - How to give your business superpowers.Demystifying Machine Learning - How to give your business superpowers.
Demystifying Machine Learning - How to give your business superpowers.
 
Feedback loops between tooling and culture
Feedback loops between tooling and cultureFeedback loops between tooling and culture
Feedback loops between tooling and culture
 
Diagnosability vs The Cloud
Diagnosability vs The CloudDiagnosability vs The Cloud
Diagnosability vs The Cloud
 
Diagnosability versus The Cloud, Redwood Shores 2011-08-30
Diagnosability versus The Cloud, Redwood Shores 2011-08-30Diagnosability versus The Cloud, Redwood Shores 2011-08-30
Diagnosability versus The Cloud, Redwood Shores 2011-08-30
 
Integrating and publishing public safety data using semantic technologies
Integrating and publishing public safety data using semantic technologiesIntegrating and publishing public safety data using semantic technologies
Integrating and publishing public safety data using semantic technologies
 
Herding cats in the Cloud
Herding cats in the CloudHerding cats in the Cloud
Herding cats in the Cloud
 
Good++
Good++Good++
Good++
 

Plus de Fredy Fadel

L’informatique est une science fondamentale.pdf
L’informatique est une science fondamentale.pdfL’informatique est une science fondamentale.pdf
L’informatique est une science fondamentale.pdfFredy Fadel
 
L'infinie ou l'histoire de la mathématisation de la logique
L'infinie ou l'histoire de la mathématisation de la logiqueL'infinie ou l'histoire de la mathématisation de la logique
L'infinie ou l'histoire de la mathématisation de la logiqueFredy Fadel
 
AspectizeWhyHowWhat
AspectizeWhyHowWhatAspectizeWhyHowWhat
AspectizeWhyHowWhatFredy Fadel
 
Azure Data Aspectize
Azure Data AspectizeAzure Data Aspectize
Azure Data AspectizeFredy Fadel
 
Javascript un langage supérieur
Javascript un langage supérieurJavascript un langage supérieur
Javascript un langage supérieurFredy Fadel
 
Tech days2013aspectize
Tech days2013aspectizeTech days2013aspectize
Tech days2013aspectizeFredy Fadel
 

Plus de Fredy Fadel (7)

L’informatique est une science fondamentale.pdf
L’informatique est une science fondamentale.pdfL’informatique est une science fondamentale.pdf
L’informatique est une science fondamentale.pdf
 
L'infinie ou l'histoire de la mathématisation de la logique
L'infinie ou l'histoire de la mathématisation de la logiqueL'infinie ou l'histoire de la mathématisation de la logique
L'infinie ou l'histoire de la mathématisation de la logique
 
AspectizeAndYou
AspectizeAndYouAspectizeAndYou
AspectizeAndYou
 
AspectizeWhyHowWhat
AspectizeWhyHowWhatAspectizeWhyHowWhat
AspectizeWhyHowWhat
 
Azure Data Aspectize
Azure Data AspectizeAzure Data Aspectize
Azure Data Aspectize
 
Javascript un langage supérieur
Javascript un langage supérieurJavascript un langage supérieur
Javascript un langage supérieur
 
Tech days2013aspectize
Tech days2013aspectizeTech days2013aspectize
Tech days2013aspectize
 

DRY

  • 2. Without data you are just another person with an opinion.
  • 3. Without opinion you are a person just with another dataset.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.  From punch cards to Javascript  more than 35 years of daily programming  Co-Founder of two companies :  Winwise (1993-2008)  Aspectize (2007- always running)  @FredyFadel  http://www.scoop.it/t/web-tools-and-technologies
  • 10. The thing, the job and it’s problems
  • 11. Do we have any ?
  • 12.
  • 13. Trying hard to do things right but We are not doing the right thing
  • 16. Automating As much as possible but not more Human  Machine Valuable information  Irrelevant details
  • 17.  The computer revolution hasn't happened yet.  OOPSLA - Alan Kay : 1997  The real computer revolution hasn't happened yet.  Education - Alan Kay : 2007  Software is eating the world (Marc Andreessen : 2011).  Books, Music,Video, Entertainment, Photography, Recruitment…  And it’s just the beginning.  First time in history we have a global many to many communication system and it’s software.
  • 18.  While describing your job, would you use the word growing ?  Do you grow software ?  Things that grow  Cities, plants…  Networks :The internet, theWeb, communication end points…  Data : it’s shape, it’s volume  Ceremonial complexity : Often due to code it’s shape, it’s volume  Cars don’t grow : they are “born” dead
  • 19. I'm not against types, but I don't know of any type systems that aren't a complete pain, so I still like dynamic typing. Actually I made up the term "object-oriented", and I can tell you I did not have C++ in mind. Alan Kay
  • 21. Deliverable at any time Never finished
  • 22. Is about automating What is repeatable and valueless Machines are good at repeating Valuable best practices It could be business oriented or technical. But yet not interfering with intelligent choices It’s distinguishing the invariant from the variable.
  • 23. Eliminating Waste Cumbersome work It’s about removing “redundancies” Logical redundancies It’s not about factoring code
  • 24. Work less, do moreAutomation It’s not about code it’s about connections
  • 25. Have nothing to do with code
  • 27. Directing the flow of information between humans and machines
  • 29. Do you have the impression of repeating yourself ?
  • 30.  Repeating can be fun and lucrative  You gain knowledge and expertise (at least in the beginning)  You can maintain an impression of knowledge and expertise  The widespread Not Invented Here syndrome  You can easily mess up reuse  left-pad story in node community  “A little copying is better than a little dependency”
  • 31. Write Everything Once Is as dumb as WET ==Write EverythingTwice
  • 32. Is reusable what is reused We reuse every day tools, ideas, code others have written, resources… We reuse because it’s seamless and has value
  • 33. Habit Even when it’s not seamless Changing habits is expensive Imitation Surfing the buzz waves
  • 34.  Best example  Operating system ▪ Language independent ▪ Code independent  Even better example  Browser ▪ “Language independent” ▪ Operating system independent
  • 35. Every piece of knowledge must have a single, unambiguous, representation within a system. The Pragmatic Programmer
  • 37.  Reuse is impossible if the reusable is not identified  If the invariant is not identified  If the independent is not identified  Orthogonal is just a fancy way of saying independent  The reusable won’t be reused if reuse is not more or less seamless
  • 38.  The invariant is what can be reused if it’s totally separated from the variable (from the non reusable)  The reuse of the invariant can be automated to make it seamless  AOP is a technique of automating the invariant.
  • 39.  Separating what  Business oriented code  Technical code  Because they are clearly independent  Each have their own invariants  Each evolve in their own pace
  • 40.  Some technical invariants  Network, bytes and clicks  JSON, HTTP, SQL,Authentication, Browsers, Devices…  Some business variable  UX  Data (it’s shape)  Processes
  • 41. HOW ?
  • 42.
  • 43. Don't call us We'll call you Technical code calls business code
  • 44.  Some history  1997 MicrosoftTransaction Server (MTS) ▪ Declarative runtime attributes  2000 COM+ ▪ More attributes  2002 .net ▪ Declarative and programmable attributes
  • 45.  Attributes  Create your own or use existing  Tying  the attribute to your code  Engine (middle ware)  to operate the magic (to automate)
  • 46.  Some existing examples [Conditional("DEBUG")] voidTrace (string msg) { …; } [PrincipalPermission (SecurityAction.Demand, Role = "Admin")] public DataSet LoadAdminData () { …; } [assembly:InternalsVisibleToAttribute("YourAssembly, PublicKey=8b…ff")]  Some potential examples [DateValidator("yyyy-MM-dd")]TextBox birthDay = newTextBox (); [Command(BrowserCacheDuration = "30 Minutes")] doubleTemperature (string city);
  • 47.  The mighty TransparentProxy  A transparent proxy is an object that can simulate any interface !  Easy to implement ▪ Less than 50 lines of C# ▪ You just need to implement it once in your life  Enables you to intercept all calls and provide valuable orthogonal technical services through aTechnical Engine.
  • 48.  .net attributes are fine for technical aspects that require a small amount of information  For more sophisticated aspects a DSL can be used to load information into theTechnical Engine.  DSL example : Gherkin in Cucumber.
  • 49.  Integrated inVisual Studio  Graphical DSL for describing ▪ The shape of Data  Textual DSL for describing bindings ▪ Data ▪ Command ▪ Layout
  • 50.  A JavascriptTechnical Engine that automates  Producing HTML in the browser  Sending/Receiving Data  Manging State  A .netTechnical Engine that automates  Reading/Writing Data  Azure integration
  • 51. Load Information Payment Save Information Business operation Technical Engine Load Information Payment Save Information Business operation Technical Engine
  • 52. http://www.meetup.com/fr-FR/Aspectize-Paris-Meetup/ Next one is on may 19th @ 5:30pm hosted by Microsoft Issy les Moulineaux