SlideShare a Scribd company logo
DevCon 2015
developers productivity platform
Dmitri Nesteruk
JetBrains
@dnesteruk
C# Tricks
In this talk
• Local inversion of control
• Maybe monad
• Dynamic prototyping
• Functional animation
Local Inversion of Control
• myList.Add(1)
“myList should add to itself the value 1”
• 1.AddTo(myList)
“take 1 and add to my list”
• op == “AND” || op == “OR” || op == “XOR”
“op is AND or op is OR or …”
• new[]{“AND”,”XOR”,”OR”}.Contains(z)
“a list of elements containing AND, OR, XOR contains…”
• z.IsOneOf(“AND”, “OR”, “XOR”)
self-descriptive
Maybe
• Monads are functional programming paradigms
• “Maybe” implies presence/absence of a value
• Typically we use `null` to indicate this
• Monadic application can make null checks implicit
• In F#, this is done with workflows
• Redefinition of certain operators within a scope
• How to do it in C#?
Dynamic Prototyping
• Typical development cycle
• Build
• Run
• Realize you need more functionality
• Stop program
• Rebuild, run again
• Dynamic prototyping
• Build
• Run
• Realize you need more functionality
• Edit the program without stopping it
• Program fixed at execution time!
• Sources are up to date when you exit
That’s all folks!
• Watch my TechDays videos! 
• Questions?
• dmitrinesteruk@gmail.com
• @dnesteruk

More Related Content

PPTX
Проект X2C
PDF
CallSharp: Automatic Input/Output Matching in .NET
PPTX
Cleaner Code - CodeStock 2019 Edition
PDF
Design Pattern Observations
PDF
[4DEV] Bartosz Sokół - Functional developer in object oriented world - how F#...
PDF
Functional Programming in C# and F#
PPTX
C# Today and Tomorrow
PPTX
F# as our day job by 2016
Проект X2C
CallSharp: Automatic Input/Output Matching in .NET
Cleaner Code - CodeStock 2019 Edition
Design Pattern Observations
[4DEV] Bartosz Sokół - Functional developer in object oriented world - how F#...
Functional Programming in C# and F#
C# Today and Tomorrow
F# as our day job by 2016

Similar to C# Tricks (20)

PPTX
What's coming to c# (Tel-Aviv, 2018)
PPTX
.Net december 2017 updates - Tamir Dresher
PDF
LectureNotes-06-DSA
PPTX
Cleaner Code: How Clean Code is Functional Code
PPTX
London F-Sharp User Group : Don Syme on F# - 09/09/2010
PPTX
Chapter3: fundamental programming
PPT
Operator overloading
PDF
Get Functional on the CLR: Intro to Functional Programming with F#
PDF
Dr archana dhawan bajaj - csharp fundamentals slides
PDF
Basic c# cheat sheet
PPTX
F# Eye 4 the C# Guy
PPT
F# Eye for the C# Guy
PPT
Csharp4 operators and_casts
PDF
It's All About Morphisms
PPTX
Lowering in C#: What really happens with your code?, from NDC Oslo 2019
PPT
Getting the MVVM Kicked Out of Your F#'n Monads
PPTX
C sharp 8.0 new features
PPTX
C sharp 8.0 new features
PPTX
Real World F# - SDD 2015
PPSX
C# 6.0 - April 2014 preview
What's coming to c# (Tel-Aviv, 2018)
.Net december 2017 updates - Tamir Dresher
LectureNotes-06-DSA
Cleaner Code: How Clean Code is Functional Code
London F-Sharp User Group : Don Syme on F# - 09/09/2010
Chapter3: fundamental programming
Operator overloading
Get Functional on the CLR: Intro to Functional Programming with F#
Dr archana dhawan bajaj - csharp fundamentals slides
Basic c# cheat sheet
F# Eye 4 the C# Guy
F# Eye for the C# Guy
Csharp4 operators and_casts
It's All About Morphisms
Lowering in C#: What really happens with your code?, from NDC Oslo 2019
Getting the MVVM Kicked Out of Your F#'n Monads
C sharp 8.0 new features
C sharp 8.0 new features
Real World F# - SDD 2015
C# 6.0 - April 2014 preview
Ad

More from Dmitri Nesteruk (20)

PDF
Good Ideas in Programming Languages
PDF
Design Patterns in Modern C++
PPTX
Introduction to Programming Bots
PDF
Converting Managed Languages to C++
PDF
Monte Carlo C++
PDF
Tpl DataFlow
PDF
YouTrack: Not Just an Issue Tracker
PPTX
Domain Transformations
PDF
Victor CG Erofeev - Metro UI
PDF
Developer Efficiency
PPTX
Distributed Development
PDF
Dynamics CRM Data Integration
PDF
Web mining
PDF
Data mapping tutorial
PDF
Reactive Extensions
PDF
Design Patterns in .Net
PDF
Metaprogramming
PDF
Code Generation
PDF
.Net Multithreading and Parallelization
PDF
AOP via PIAB and Unity
Good Ideas in Programming Languages
Design Patterns in Modern C++
Introduction to Programming Bots
Converting Managed Languages to C++
Monte Carlo C++
Tpl DataFlow
YouTrack: Not Just an Issue Tracker
Domain Transformations
Victor CG Erofeev - Metro UI
Developer Efficiency
Distributed Development
Dynamics CRM Data Integration
Web mining
Data mapping tutorial
Reactive Extensions
Design Patterns in .Net
Metaprogramming
Code Generation
.Net Multithreading and Parallelization
AOP via PIAB and Unity
Ad

Recently uploaded (20)

PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PPTX
Cloud computing and distributed systems.
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
Encapsulation theory and applications.pdf
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PPTX
Programs and apps: productivity, graphics, security and other tools
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PDF
Machine learning based COVID-19 study performance prediction
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PDF
A comparative analysis of optical character recognition models for extracting...
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
Spectral efficient network and resource selection model in 5G networks
PPTX
Big Data Technologies - Introduction.pptx
PPT
Teaching material agriculture food technology
Per capita expenditure prediction using model stacking based on satellite ima...
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
Digital-Transformation-Roadmap-for-Companies.pptx
Cloud computing and distributed systems.
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
Encapsulation_ Review paper, used for researhc scholars
Encapsulation theory and applications.pdf
“AI and Expert System Decision Support & Business Intelligence Systems”
Programs and apps: productivity, graphics, security and other tools
Chapter 3 Spatial Domain Image Processing.pdf
Machine learning based COVID-19 study performance prediction
20250228 LYD VKU AI Blended-Learning.pptx
Advanced methodologies resolving dimensionality complications for autism neur...
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Mobile App Security Testing_ A Comprehensive Guide.pdf
A comparative analysis of optical character recognition models for extracting...
Diabetes mellitus diagnosis method based random forest with bat algorithm
Spectral efficient network and resource selection model in 5G networks
Big Data Technologies - Introduction.pptx
Teaching material agriculture food technology

C# Tricks

  • 3. In this talk • Local inversion of control • Maybe monad • Dynamic prototyping • Functional animation
  • 4. Local Inversion of Control • myList.Add(1) “myList should add to itself the value 1” • 1.AddTo(myList) “take 1 and add to my list” • op == “AND” || op == “OR” || op == “XOR” “op is AND or op is OR or …” • new[]{“AND”,”XOR”,”OR”}.Contains(z) “a list of elements containing AND, OR, XOR contains…” • z.IsOneOf(“AND”, “OR”, “XOR”) self-descriptive
  • 5. Maybe • Monads are functional programming paradigms • “Maybe” implies presence/absence of a value • Typically we use `null` to indicate this • Monadic application can make null checks implicit • In F#, this is done with workflows • Redefinition of certain operators within a scope • How to do it in C#?
  • 6. Dynamic Prototyping • Typical development cycle • Build • Run • Realize you need more functionality • Stop program • Rebuild, run again • Dynamic prototyping • Build • Run • Realize you need more functionality • Edit the program without stopping it • Program fixed at execution time! • Sources are up to date when you exit
  • 7. That’s all folks! • Watch my TechDays videos!  • Questions? • dmitrinesteruk@gmail.com • @dnesteruk