SlideShare una empresa de Scribd logo
1 de 25
Dynamic C# - A New World of Possibilities Aaron Erickson Lead Consultant, ThoughtWorks Author, The Nomadic Developer Co-Author, Professional F# (coming soon!) Microsoft MVP – C#
The initial name of the talk before it was rejected… Crazy Shit We Can Do With the Dynamic Keyword* *Not all of this is a good idea (remember, use and abuse)
C# - What it resembles now…
C# - A little of everything… Curly Braces (1.0) Generics (2.0) Functional “Lite” with Linq (3.0) And Now, Dynamic (4.0)
Duck Typing
Expando Objects
Treat Method Calls Like Messages
Send Message Receive Message
And More… Metaprogramming - take the expression tree called by the caller and do something with it. Interop– call other people’s libraries written using real dynamic languages (Ruby, JS, Python).
Interesting Applications of Dynamic C#
ActiveRecord
“ActiveRecord” for XML
Interop
Abuses… oh yes… You shuddering yet?  If not, you should be!
Is dynamic programming the answer to anything and everything?
Case For Case Against Performance – dynamic lookup just can’t be as fast as static lookup. A lot fewer things are CPU bound than we tend to think.  DB lookups?  Really? You were confused with var?  dynamic will make your head spin. Sorry – if you are confused with var, you really need to put down the keyboard and take up something for dummies, like investment banking. What is so bad about using strings in a lookup (i.e. table[“field”] vstable.field) table.field looks cleaner, survives a rename refactoring, and can just take the shape of a static object later if introduced (introduce class refactoring for R# someday?) If you want dynamic, just use a language designed for it, like Ruby!  Or JavaScript! Sometimes language choice is political. But need for dynamic remains.
Demo – Stupid Dynamic C# Tricks
Dynamic Everywhere?  My Thoughts Performance argument has merit.  Sometimes.  No pretending Twitter didn’t happen.   Dynamic readers for things like Json, XML, Text, Excel, etc – will be really wicked cool! End-user definition of objects.  I can finally envision systems, based on C#, where you can have user defined fields on CRUD objects from databases, where an end user adds a field, names it, and binding just “works”. This does not belong in your math or stats library.  That is what Clojure, Scala, Erlang, F# - or where C# is your given language, LINQ, are for. Linq + Dynamic in C# is mostly unexplored territory.  Some amazing things could come out of that intersection.
So you wanna do dynamic… You will do TDD.  Without it, you are a mess of runtime errors and maintenance nightmares You will respect that with great power comes great responsibility.  Programs using dynamic programs tend to be smaller, but metaprogramming to extremes can end up becoming “write-only” code. You will need to consider that vast parts of .NET-land have never seen this stuff before.  You will be ready to explain and justify why and how this stuff improves things. In 2020, you will curse, and maybe throw a chair or two, because of some abuse of dynamic some schmuck did in 2010 in that 10 year old code base. There is a good chance that schmuck will be me 
Questions?
Thank You! aaron.c.erickson@gmail.com twitter.com/aaronerickson http://nomadic-developer.com/

Más contenido relacionado

La actualidad más candente

Clean Code and Common Engineering Practices
Clean Code and Common Engineering PracticesClean Code and Common Engineering Practices
Clean Code and Common Engineering PracticesRuth Sperer
 
Python Programming Course
Python Programming CoursePython Programming Course
Python Programming Courseiseestech
 
Fine tuning large LMs
Fine tuning large LMsFine tuning large LMs
Fine tuning large LMsSylvainGugger
 
Androides y Mazmorras. Part I (dungeons & robots)
Androides y Mazmorras. Part I (dungeons & robots)Androides y Mazmorras. Part I (dungeons & robots)
Androides y Mazmorras. Part I (dungeons & robots)Jorge Barroso
 
Presistiendo que es gerundio (My storing story)
Presistiendo que es gerundio (My storing story)Presistiendo que es gerundio (My storing story)
Presistiendo que es gerundio (My storing story)Jorge Barroso
 
Ryan Curtin, Principal Research Scientist, Symantec at MLconf ATL 2016
Ryan Curtin, Principal Research Scientist, Symantec at MLconf ATL 2016Ryan Curtin, Principal Research Scientist, Symantec at MLconf ATL 2016
Ryan Curtin, Principal Research Scientist, Symantec at MLconf ATL 2016MLconf
 

La actualidad más candente (7)

Clean Code and Common Engineering Practices
Clean Code and Common Engineering PracticesClean Code and Common Engineering Practices
Clean Code and Common Engineering Practices
 
Python Programming Course
Python Programming CoursePython Programming Course
Python Programming Course
 
Fine tuning large LMs
Fine tuning large LMsFine tuning large LMs
Fine tuning large LMs
 
Androides y Mazmorras. Part I (dungeons & robots)
Androides y Mazmorras. Part I (dungeons & robots)Androides y Mazmorras. Part I (dungeons & robots)
Androides y Mazmorras. Part I (dungeons & robots)
 
Presistiendo que es gerundio (My storing story)
Presistiendo que es gerundio (My storing story)Presistiendo que es gerundio (My storing story)
Presistiendo que es gerundio (My storing story)
 
Ryan Curtin, Principal Research Scientist, Symantec at MLconf ATL 2016
Ryan Curtin, Principal Research Scientist, Symantec at MLconf ATL 2016Ryan Curtin, Principal Research Scientist, Symantec at MLconf ATL 2016
Ryan Curtin, Principal Research Scientist, Symantec at MLconf ATL 2016
 
How to code
How to codeHow to code
How to code
 

Destacado (12)

Trabajo 1
Trabajo 1Trabajo 1
Trabajo 1
 
Portada 2 pdf
Portada 2 pdfPortada 2 pdf
Portada 2 pdf
 
Profile
ProfileProfile
Profile
 
RWANDA
RWANDARWANDA
RWANDA
 
عمليات الحرث
عمليات الحرثعمليات الحرث
عمليات الحرث
 
Meja / Table
Meja / TableMeja / Table
Meja / Table
 
Harris_Matthew_UpdatedResume
Harris_Matthew_UpdatedResumeHarris_Matthew_UpdatedResume
Harris_Matthew_UpdatedResume
 
CouchDB + .NET - Relax in Style
CouchDB + .NET - Relax in StyleCouchDB + .NET - Relax in Style
CouchDB + .NET - Relax in Style
 
Sheela cao cv
Sheela cao cvSheela cao cv
Sheela cao cv
 
Lecturenotes on weed sc matched with the syllabus of 2nd sem,1st yr in tsrdam
Lecturenotes on weed sc matched with the syllabus of 2nd sem,1st yr in tsrdamLecturenotes on weed sc matched with the syllabus of 2nd sem,1st yr in tsrdam
Lecturenotes on weed sc matched with the syllabus of 2nd sem,1st yr in tsrdam
 
Microbiology Q & A for exam (short note)
Microbiology Q & A  for exam (short note)Microbiology Q & A  for exam (short note)
Microbiology Q & A for exam (short note)
 
Guía de mru
Guía de mruGuía de mru
Guía de mru
 

Similar a Dynamic C# and a New World of Possibilities

Brownfield Domain Driven Design
Brownfield Domain Driven DesignBrownfield Domain Driven Design
Brownfield Domain Driven DesignNicolò Pignatelli
 
The State of ML for iOS: On the Advent of WWDC 2018 🕯
The State of ML for iOS: On the Advent of WWDC 2018 🕯The State of ML for iOS: On the Advent of WWDC 2018 🕯
The State of ML for iOS: On the Advent of WWDC 2018 🕯Meghan Kane
 
Domain Driven Design in the Browser - Cameron Edwards
Domain Driven Design in the Browser - Cameron EdwardsDomain Driven Design in the Browser - Cameron Edwards
Domain Driven Design in the Browser - Cameron EdwardsHakka Labs
 
Sacrificing the golden calf of "coding"
Sacrificing the golden calf of "coding"Sacrificing the golden calf of "coding"
Sacrificing the golden calf of "coding"Christian Heilmann
 
Key Features Of The Pseudo Code
Key Features Of The Pseudo CodeKey Features Of The Pseudo Code
Key Features Of The Pseudo CodeAngilina Jones
 
Trends in Programming Technology you might want to keep an eye on af Bent Tho...
Trends in Programming Technology you might want to keep an eye on af Bent Tho...Trends in Programming Technology you might want to keep an eye on af Bent Tho...
Trends in Programming Technology you might want to keep an eye on af Bent Tho...InfinIT - Innovationsnetværket for it
 
C# classes
C#   classesC#   classes
C# classesTiago
 
Designing A Project Using Java Programming
Designing A Project Using Java ProgrammingDesigning A Project Using Java Programming
Designing A Project Using Java ProgrammingKaty Allen
 
Beyond JavaScript Frameworks: Writing Reliable Web Apps With Elm - Erik Wende...
Beyond JavaScript Frameworks: Writing Reliable Web Apps With Elm - Erik Wende...Beyond JavaScript Frameworks: Writing Reliable Web Apps With Elm - Erik Wende...
Beyond JavaScript Frameworks: Writing Reliable Web Apps With Elm - Erik Wende...Codemotion
 
Rrw02 Week 1 Assignment
Rrw02 Week 1 AssignmentRrw02 Week 1 Assignment
Rrw02 Week 1 AssignmentSheri Elliott
 
Evolving as a professional software developer
Evolving as a professional software developerEvolving as a professional software developer
Evolving as a professional software developerAnton Kirillov
 
Антон Кириллов, ZeptoLab
Антон Кириллов, ZeptoLabАнтон Кириллов, ZeptoLab
Антон Кириллов, ZeptoLabDiana Dymolazova
 
What every C++ programmer should know about modern compilers (w/ comments, AC...
What every C++ programmer should know about modern compilers (w/ comments, AC...What every C++ programmer should know about modern compilers (w/ comments, AC...
What every C++ programmer should know about modern compilers (w/ comments, AC...Sławomir Zborowski
 
ITCamp 2012 - Raffaele Rialdi - Introduction to WinRT
ITCamp 2012 - Raffaele Rialdi - Introduction to WinRTITCamp 2012 - Raffaele Rialdi - Introduction to WinRT
ITCamp 2012 - Raffaele Rialdi - Introduction to WinRTITCamp
 
The Guide to becoming a full stack developer in 2018
The Guide to becoming a full stack developer in 2018The Guide to becoming a full stack developer in 2018
The Guide to becoming a full stack developer in 2018Amit Ashwini
 
Deep Learning and the state of AI / 2016
Deep Learning and the state of AI / 2016Deep Learning and the state of AI / 2016
Deep Learning and the state of AI / 2016Grigory Sapunov
 

Similar a Dynamic C# and a New World of Possibilities (20)

Web Development with Smalltalk
Web Development with SmalltalkWeb Development with Smalltalk
Web Development with Smalltalk
 
Brownfield Domain Driven Design
Brownfield Domain Driven DesignBrownfield Domain Driven Design
Brownfield Domain Driven Design
 
All of Javascript
All of JavascriptAll of Javascript
All of Javascript
 
The State of ML for iOS: On the Advent of WWDC 2018 🕯
The State of ML for iOS: On the Advent of WWDC 2018 🕯The State of ML for iOS: On the Advent of WWDC 2018 🕯
The State of ML for iOS: On the Advent of WWDC 2018 🕯
 
Domain Driven Design in the Browser - Cameron Edwards
Domain Driven Design in the Browser - Cameron EdwardsDomain Driven Design in the Browser - Cameron Edwards
Domain Driven Design in the Browser - Cameron Edwards
 
Sacrificing the golden calf of "coding"
Sacrificing the golden calf of "coding"Sacrificing the golden calf of "coding"
Sacrificing the golden calf of "coding"
 
Key Features Of The Pseudo Code
Key Features Of The Pseudo CodeKey Features Of The Pseudo Code
Key Features Of The Pseudo Code
 
Trends in Programming Technology you might want to keep an eye on af Bent Tho...
Trends in Programming Technology you might want to keep an eye on af Bent Tho...Trends in Programming Technology you might want to keep an eye on af Bent Tho...
Trends in Programming Technology you might want to keep an eye on af Bent Tho...
 
C# classes
C#   classesC#   classes
C# classes
 
Designing A Project Using Java Programming
Designing A Project Using Java ProgrammingDesigning A Project Using Java Programming
Designing A Project Using Java Programming
 
All of javascript
All of javascriptAll of javascript
All of javascript
 
Beyond JavaScript Frameworks: Writing Reliable Web Apps With Elm - Erik Wende...
Beyond JavaScript Frameworks: Writing Reliable Web Apps With Elm - Erik Wende...Beyond JavaScript Frameworks: Writing Reliable Web Apps With Elm - Erik Wende...
Beyond JavaScript Frameworks: Writing Reliable Web Apps With Elm - Erik Wende...
 
Rrw02 Week 1 Assignment
Rrw02 Week 1 AssignmentRrw02 Week 1 Assignment
Rrw02 Week 1 Assignment
 
Evolving as a professional software developer
Evolving as a professional software developerEvolving as a professional software developer
Evolving as a professional software developer
 
Антон Кириллов, ZeptoLab
Антон Кириллов, ZeptoLabАнтон Кириллов, ZeptoLab
Антон Кириллов, ZeptoLab
 
What every C++ programmer should know about modern compilers (w/ comments, AC...
What every C++ programmer should know about modern compilers (w/ comments, AC...What every C++ programmer should know about modern compilers (w/ comments, AC...
What every C++ programmer should know about modern compilers (w/ comments, AC...
 
ITCamp 2012 - Raffaele Rialdi - Introduction to WinRT
ITCamp 2012 - Raffaele Rialdi - Introduction to WinRTITCamp 2012 - Raffaele Rialdi - Introduction to WinRT
ITCamp 2012 - Raffaele Rialdi - Introduction to WinRT
 
The Guide to becoming a full stack developer in 2018
The Guide to becoming a full stack developer in 2018The Guide to becoming a full stack developer in 2018
The Guide to becoming a full stack developer in 2018
 
Enterprise TypeScript
Enterprise TypeScriptEnterprise TypeScript
Enterprise TypeScript
 
Deep Learning and the state of AI / 2016
Deep Learning and the state of AI / 2016Deep Learning and the state of AI / 2016
Deep Learning and the state of AI / 2016
 

Último

What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
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
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
[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
 

Último (20)

What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
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
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
[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
 

Dynamic C# and a New World of Possibilities

  • 1. Dynamic C# - A New World of Possibilities Aaron Erickson Lead Consultant, ThoughtWorks Author, The Nomadic Developer Co-Author, Professional F# (coming soon!) Microsoft MVP – C#
  • 2. The initial name of the talk before it was rejected… Crazy Shit We Can Do With the Dynamic Keyword* *Not all of this is a good idea (remember, use and abuse)
  • 3. C# - What it resembles now…
  • 4.
  • 5.
  • 6. C# - A little of everything… Curly Braces (1.0) Generics (2.0) Functional “Lite” with Linq (3.0) And Now, Dynamic (4.0)
  • 8.
  • 10.
  • 11. Treat Method Calls Like Messages
  • 13. And More… Metaprogramming - take the expression tree called by the caller and do something with it. Interop– call other people’s libraries written using real dynamic languages (Ruby, JS, Python).
  • 18. Abuses… oh yes… You shuddering yet? If not, you should be!
  • 19. Is dynamic programming the answer to anything and everything?
  • 20. Case For Case Against Performance – dynamic lookup just can’t be as fast as static lookup. A lot fewer things are CPU bound than we tend to think. DB lookups? Really? You were confused with var? dynamic will make your head spin. Sorry – if you are confused with var, you really need to put down the keyboard and take up something for dummies, like investment banking. What is so bad about using strings in a lookup (i.e. table[“field”] vstable.field) table.field looks cleaner, survives a rename refactoring, and can just take the shape of a static object later if introduced (introduce class refactoring for R# someday?) If you want dynamic, just use a language designed for it, like Ruby! Or JavaScript! Sometimes language choice is political. But need for dynamic remains.
  • 21. Demo – Stupid Dynamic C# Tricks
  • 22. Dynamic Everywhere? My Thoughts Performance argument has merit. Sometimes. No pretending Twitter didn’t happen. Dynamic readers for things like Json, XML, Text, Excel, etc – will be really wicked cool! End-user definition of objects. I can finally envision systems, based on C#, where you can have user defined fields on CRUD objects from databases, where an end user adds a field, names it, and binding just “works”. This does not belong in your math or stats library. That is what Clojure, Scala, Erlang, F# - or where C# is your given language, LINQ, are for. Linq + Dynamic in C# is mostly unexplored territory. Some amazing things could come out of that intersection.
  • 23. So you wanna do dynamic… You will do TDD. Without it, you are a mess of runtime errors and maintenance nightmares You will respect that with great power comes great responsibility. Programs using dynamic programs tend to be smaller, but metaprogramming to extremes can end up becoming “write-only” code. You will need to consider that vast parts of .NET-land have never seen this stuff before. You will be ready to explain and justify why and how this stuff improves things. In 2020, you will curse, and maybe throw a chair or two, because of some abuse of dynamic some schmuck did in 2010 in that 10 year old code base. There is a good chance that schmuck will be me 
  • 25. Thank You! aaron.c.erickson@gmail.com twitter.com/aaronerickson http://nomadic-developer.com/

Notas del editor

  1. You may not eliminate state in your more traditional OO system, nor will you in an FP/OO hybrid – but you will likely make sure that things that manipulate state are seperated from things that ask questions. Question for audience – what are some common exceptions?
  2. You may not eliminate state in your more traditional OO system, nor will you in an FP/OO hybrid – but you will likely make sure that things that manipulate state are seperated from things that ask questions. Question for audience – what are some common exceptions?
  3. You may not eliminate state in your more traditional OO system, nor will you in an FP/OO hybrid – but you will likely make sure that things that manipulate state are seperated from things that ask questions. Question for audience – what are some common exceptions?
  4. You may not eliminate state in your more traditional OO system, nor will you in an FP/OO hybrid – but you will likely make sure that things that manipulate state are seperated from things that ask questions. Question for audience – what are some common exceptions?