Expression trees is an obscure, although very interesting feature in .NET. Most people probably think of it as something synonymous with object-relational mapping frameworks, but despite being its most common use case, it’s not the only one. There are a lot of creative things you can do with expression trees, including code generation, transpilation, metaprogramming, and more. During this talk, I will explain what this feature really is about and guide you through some examples where it provides real-life benefits.
We'll talk about:
What is an expression tree
How to compile code at runtime
How to make reflection faster
How to implement generic operators
How to turn DSLs into expression trees
How to make metaprogramming type-safe
How to translate a lambda into a different language...and more
This document discusses expression trees in C#. It begins with an introduction to expression trees, which describe the structure of an expression. It then discusses how expression trees are represented in .NET using types deriving from System.Linq.Expressions.Expression. It provides examples of constructing expression trees manually using factory methods, and how lambda expression trees can be converted into delegates. The document also discusses optimizing reflection-heavy code using expression trees, implementing generic operators with expression trees, parsing DSLs into expression trees, obtaining expression trees from lambdas, and identifying type members using expression trees.
The document discusses expression trees in C#. It provides examples of constructing expression trees manually by creating expression tree nodes like ConstantExpression and MethodCallExpression. It also discusses parsing code into expression trees, optimizing reflection-heavy code using expression trees, building generic operators using expression trees, and inferring expression trees from code.
Explores how to write a tic-tac-toe API that meets some interesting static typing constraints. Specifically, programs using the API may fail to compile, depending on the state of play in the game, such as trying to call move() with an already completed game board. The real theme of the presentation is not so much solving the tic-tac-toe problem but, rather, pushing static typing to its limits (and some might argue beyond its useful limits—you will have to judge for yourself).
The document discusses the scripting capabilities of Groovy and how it simplifies scripting compared to Java. Groovy allows separating code into simple scripts without unnecessary class and method definitions. It supports various approaches for running scripts, including via a GroovyShell, GroovyScriptEngine, or by implementing the JSR-223 scripting API. Groovy also allows predefining variables and methods in a script's binding to make domain-specific languages more natural to use.
Expression trees in c#, Алексей Голубь (Svitla Systems)Alina Vilk
рассказывал про это понятие и способы генерации деревьев выражений, о превращении пользовательской грамматики непосредственно в исполняемый код; поделился информацией о написании быстрых универсальных операторов и компиляции сборок во время выполнения
This document discusses leveraging Groovy for capturing business rules through domain-specific languages (DSLs). It begins with introductions to DSLs and Groovy, explaining their goals and advantages. Examples are provided of using Groovy to remove boilerplate code from Java programs and create internal DSLs. The document demonstrates how Groovy features like closures and meta-programming enable the creation of DSLs for expressing business rules in a natural, domain-focused way.
Groovy is a dynamic language for the Java Virtual Machine that builds upon Java's strengths. It allows for increased productivity by reducing boilerplate code and simplifying testing. Groovy code compiles to Java bytecode, integrates seamlessly with existing Java code, and has features like closures and iterators that make programming more concise. Groovy adopts many modern language features while keeping a low barrier to entry for Java developers.
This document provides an introduction to functional programming concepts and techniques in Groovy, including:
- The benefits of functional programming such as more declarative code, reduced errors, and improved reusability.
- Key functional concepts like immutable data structures, recursion, and lazy evaluation.
- Examples of using closures and higher-order functions in Groovy.
- Techniques for building immutable and persistent data structures.
A Domain Specific Language (DSL) is a programming language focused on a particular problem domain. DSLs provide expressive notations and abstractions for their domain through appropriate syntax and semantics. Groovy enables the creation of DSLs through features like closures, builders, open classes, and AST transformations that allow customizing and extending the language.
This document discusses various approaches for handling concurrency in Groovy and Java programs, including using GPars. It describes how GPars provides features for data parallelism, asynchronous functions, actors, safe agents, and dataflow concurrency. It also provides examples of using GPars parallel collections and dataflows to introduce concurrency into sequential algorithms in a transparent way.
Designing with Groovy Traits - Gr8Conf IndiaNaresha K
The document discusses using traits in Groovy to provide reusable behaviors and properties to classes without relying on inheritance. It describes how traits allow for mixing in multiple capabilities, overriding trait methods, implementing interfaces, declaring abstract methods, and having state. Traits can extend other traits and resolve conflicts using finer control. Traits also allow applying behaviors at runtime and composing common fields. Examples demonstrate composing user context, auditing objects, chaining approvals, and more.
This document discusses principles of writing clean code for readability and maintainability. It defines clean code as code that is simple, direct and reads like well-written prose. Clean code should have meaningful names, small and focused functions, minimal comments, and use exceptions for error handling rather than return codes. Classes should also have a single well-described responsibility and follow the single responsibility principle. Overall, writing clean code produces benefits during development and makes the code easier to maintain going forward.
This document provides an overview of the Python programming language. It includes several code examples and summaries of key Python concepts like strings, lists, tuples, dictionaries, files, regular expressions, and object-oriented programming. It also lists some common Python functions and modules for tasks like HTTP requests and database access. The document aims to introduce Python's main features and provide basic code samples to help new Python learners.
The document discusses Groovy, an object-oriented scripting language for the Java Virtual Machine (JVM). It provides examples of Groovy code and describes Groovy's features such as optional typing, closures, list and map syntax, and interoperability with Java. Key features include dynamic typing, closures/anonymous functions, built-in support for lists/maps, and compiling to Java bytecode. Groovy aims to make Java development more productive and agile through a syntax resembling Python/Ruby.
1. The document discusses polyglot programming using multiple languages on the Java Virtual Machine (JVM), including Java, Groovy, Scala, and Clojure.
2. It notes that while Java has matured, other JVM languages have evolved faster with features like closures, operator overloading, and richer type systems.
3. Interoperability between JVM languages is seamless, allowing code written in different languages to easily call each other. The document promotes experimenting with multiple JVM languages for polyglot programming.
Presented on 27th September 2017 to a joint meeting of 'Cork Functional Programmers' and the 'Cork Java Users Group'
Based on the Kotlin Language programming course from Instil. For more details see https://instil.co/courses/kotlin-development/
The document discusses optimizing Tcl bytecode. It provides an overview of Tcl's evaluation strategy using bytecode and discusses opportunities to improve bytecode compilation coverage, generation, and optimization. The author outlines work done to compile more commands to bytecode, improve bytecode for operations like list concatenation, and add an initial bytecode optimizer. Benchmark results show performance improvements from these changes ranging from 10-40% depending on the operation. Future work is needed to fully optimize control flow, eliminate dead code, and close the gap between the assembler and optimizer.
Ruby plays to many programming paradigms. It's an object-oriented language that can be used in a functional or an imperative/procedural way. But Ruby does not often get used as a logic programming language. In this talk I'll explore logic programming using Ruby. What is it, and is it a tool you want to add to your toolbox? We'll touch on several libraries, we'll primary look at an implementation of minikanren (http://minikanren.org/) for Ruby.
La teoria delle categorie sta alla programmazione funzionale come i GoF design pattern stanno a quella ad oggetti. Vista l’imminente introduzione delle lambda expression, è tempo anche per gli sviluppatori Java di imparare qualcosa in più riguardo ai più comuni pattern di programmazione funzionale. Le monadi sono probabilmente le più espressive (e forse le più incomprese) fra questi pattern, per cui lo scopo del talk è quello di introdurle, chiarendo con esempi pratici come e quando dovrebbero essere usate, sottolineando i loro vantaggi e mostrando come possono essere implementate in Java8.
Implementing pseudo-keywords through Functional ProgramingVincent Pradeilles
The document discusses implementing asynchronous code in a more functional way using pseudo-keywords. It introduces a weakify function that takes a function and returns a function that wraps it to avoid retain cycles when referencing self. This approach is expanded to other common patterns like debouncing. The document then shows how property wrappers can be used to implement these pseudo-keywords more declaratively. This allows patterns like asynchronous code and debouncing to be written in a cleaner way without extra boilerplate.
This document discusses using the jq command line tool and Python to filter and format JSON data within Xcode's debugger LLDB. It describes running jq filters on JSON strings extracted from variables, saving the filter and JSON to temporary files for jq to process instead of using stdin. A Python function is defined to run jq from LLDB and return the output.
The document discusses monads and functional programming concepts. It begins by explaining that monads are structures that put values in computational contexts. It then provides a technical definition of a monad involving endofunctors, natural transformations, and laws. Several examples are given to illustrate monads, including the Optional monad in Java to handle null values, and the Stream monad to represent sequences. The document advocates using monads to make aspects like errors, state, and effects explicit in a program's type system.
This document discusses various techniques for optimizing Python code, including:
1. Using the right algorithms and data structures to minimize time complexity, such as choosing lists, sets or dictionaries based on needed functionality.
2. Leveraging Python-specific optimizations like string concatenation, lookups, loops and imports.
3. Profiling code with tools like timeit, cProfile and visualizers to identify bottlenecks before optimizing.
4. Optimizing only after validating a performance need and starting with general strategies before rewriting hotspots in Python or other languages. Premature optimization can complicate code.
This document discusses observations on implementing design patterns in C# and .NET. It covers local inversion of control using extension methods, composite patterns to expose collections and scalar objects uniformly, and using dynamic features like dynamic proxies and dynamic dispatch to implement patterns like null objects, visitors, and logging proxies at runtime without static constraints. The key points are:
1. Design patterns remain relevant when translated to modern OOP languages like C#.
2. Features like extension methods and dynamic objects allow new implementations of patterns like local inversion of control and runtime proxies.
3. The composite pattern can expose collections and individual objects through a uniform interface at different scales from properties to entire classes.
4. Dynamic features enable implementing patterns
Map(), flatmap() and reduce() are your new best friends: simpler collections,...Chris Richardson
This document summarizes a presentation about functional programming and how functions like map(), flatMap(), and reduce() can simplify collection processing, concurrency, and big data problems. The presentation introduces functional programming concepts and how languages like Java 8 have adopted these with features like lambda expressions and streams. It provides examples of how to use streams to map, filter, and reduce collections in a more declarative way compared to imperative for loops. It also discusses how functions and futures can help simplify concurrent operations by allowing asynchronous work to be expressed more clearly.
The document provides an overview of functional programming in Java. It discusses functional programming concepts like higher-order functions and avoiding side effects. It gives examples of functional-style code in Java for filtering lists and transforming objects. It also discusses how functional programming can be used to implement customizable business logic by passing functions as parameters and looking up functions through a dependency injection container.
C# 7.x What's new and what's coming with C# 8Christian Nagel
C# is extended in a fast pace – with new features allow to reduce the code you need to write, offer more safety, and gives better performance – and you still write safe code. In this session you are introduced to the new C# 7.0-7.3 features including tuples and pattern matching, and learn about the features planned with C# 8.0 such as nullable reference types, extensions for pattern matching, and the new switch expression.
The document discusses clean code principles such as writing code for readability by other programmers, using meaningful names, following the DRY principle of not repeating yourself, and focusing on writing code that is maintainable and changeable. It provides examples of clean code versus less clean code and emphasizes that code is written primarily for human consumption by other programmers, not for computers. The document also discusses principles like the Single Responsibility Principle and the Boy Scout Rule of leaving the code cleaner than how you found it. It questions how to measure clean code and emphasizes the importance of writing tests for code and refactoring legacy code without tests.
A Domain Specific Language (DSL) is a programming language focused on a particular problem domain. DSLs provide expressive notations and abstractions for their domain through appropriate syntax and semantics. Groovy enables the creation of DSLs through features like closures, builders, open classes, and AST transformations that allow customizing and extending the language.
This document discusses various approaches for handling concurrency in Groovy and Java programs, including using GPars. It describes how GPars provides features for data parallelism, asynchronous functions, actors, safe agents, and dataflow concurrency. It also provides examples of using GPars parallel collections and dataflows to introduce concurrency into sequential algorithms in a transparent way.
Designing with Groovy Traits - Gr8Conf IndiaNaresha K
The document discusses using traits in Groovy to provide reusable behaviors and properties to classes without relying on inheritance. It describes how traits allow for mixing in multiple capabilities, overriding trait methods, implementing interfaces, declaring abstract methods, and having state. Traits can extend other traits and resolve conflicts using finer control. Traits also allow applying behaviors at runtime and composing common fields. Examples demonstrate composing user context, auditing objects, chaining approvals, and more.
This document discusses principles of writing clean code for readability and maintainability. It defines clean code as code that is simple, direct and reads like well-written prose. Clean code should have meaningful names, small and focused functions, minimal comments, and use exceptions for error handling rather than return codes. Classes should also have a single well-described responsibility and follow the single responsibility principle. Overall, writing clean code produces benefits during development and makes the code easier to maintain going forward.
This document provides an overview of the Python programming language. It includes several code examples and summaries of key Python concepts like strings, lists, tuples, dictionaries, files, regular expressions, and object-oriented programming. It also lists some common Python functions and modules for tasks like HTTP requests and database access. The document aims to introduce Python's main features and provide basic code samples to help new Python learners.
The document discusses Groovy, an object-oriented scripting language for the Java Virtual Machine (JVM). It provides examples of Groovy code and describes Groovy's features such as optional typing, closures, list and map syntax, and interoperability with Java. Key features include dynamic typing, closures/anonymous functions, built-in support for lists/maps, and compiling to Java bytecode. Groovy aims to make Java development more productive and agile through a syntax resembling Python/Ruby.
1. The document discusses polyglot programming using multiple languages on the Java Virtual Machine (JVM), including Java, Groovy, Scala, and Clojure.
2. It notes that while Java has matured, other JVM languages have evolved faster with features like closures, operator overloading, and richer type systems.
3. Interoperability between JVM languages is seamless, allowing code written in different languages to easily call each other. The document promotes experimenting with multiple JVM languages for polyglot programming.
Presented on 27th September 2017 to a joint meeting of 'Cork Functional Programmers' and the 'Cork Java Users Group'
Based on the Kotlin Language programming course from Instil. For more details see https://instil.co/courses/kotlin-development/
The document discusses optimizing Tcl bytecode. It provides an overview of Tcl's evaluation strategy using bytecode and discusses opportunities to improve bytecode compilation coverage, generation, and optimization. The author outlines work done to compile more commands to bytecode, improve bytecode for operations like list concatenation, and add an initial bytecode optimizer. Benchmark results show performance improvements from these changes ranging from 10-40% depending on the operation. Future work is needed to fully optimize control flow, eliminate dead code, and close the gap between the assembler and optimizer.
Ruby plays to many programming paradigms. It's an object-oriented language that can be used in a functional or an imperative/procedural way. But Ruby does not often get used as a logic programming language. In this talk I'll explore logic programming using Ruby. What is it, and is it a tool you want to add to your toolbox? We'll touch on several libraries, we'll primary look at an implementation of minikanren (http://minikanren.org/) for Ruby.
La teoria delle categorie sta alla programmazione funzionale come i GoF design pattern stanno a quella ad oggetti. Vista l’imminente introduzione delle lambda expression, è tempo anche per gli sviluppatori Java di imparare qualcosa in più riguardo ai più comuni pattern di programmazione funzionale. Le monadi sono probabilmente le più espressive (e forse le più incomprese) fra questi pattern, per cui lo scopo del talk è quello di introdurle, chiarendo con esempi pratici come e quando dovrebbero essere usate, sottolineando i loro vantaggi e mostrando come possono essere implementate in Java8.
Implementing pseudo-keywords through Functional ProgramingVincent Pradeilles
The document discusses implementing asynchronous code in a more functional way using pseudo-keywords. It introduces a weakify function that takes a function and returns a function that wraps it to avoid retain cycles when referencing self. This approach is expanded to other common patterns like debouncing. The document then shows how property wrappers can be used to implement these pseudo-keywords more declaratively. This allows patterns like asynchronous code and debouncing to be written in a cleaner way without extra boilerplate.
This document discusses using the jq command line tool and Python to filter and format JSON data within Xcode's debugger LLDB. It describes running jq filters on JSON strings extracted from variables, saving the filter and JSON to temporary files for jq to process instead of using stdin. A Python function is defined to run jq from LLDB and return the output.
The document discusses monads and functional programming concepts. It begins by explaining that monads are structures that put values in computational contexts. It then provides a technical definition of a monad involving endofunctors, natural transformations, and laws. Several examples are given to illustrate monads, including the Optional monad in Java to handle null values, and the Stream monad to represent sequences. The document advocates using monads to make aspects like errors, state, and effects explicit in a program's type system.
This document discusses various techniques for optimizing Python code, including:
1. Using the right algorithms and data structures to minimize time complexity, such as choosing lists, sets or dictionaries based on needed functionality.
2. Leveraging Python-specific optimizations like string concatenation, lookups, loops and imports.
3. Profiling code with tools like timeit, cProfile and visualizers to identify bottlenecks before optimizing.
4. Optimizing only after validating a performance need and starting with general strategies before rewriting hotspots in Python or other languages. Premature optimization can complicate code.
This document discusses observations on implementing design patterns in C# and .NET. It covers local inversion of control using extension methods, composite patterns to expose collections and scalar objects uniformly, and using dynamic features like dynamic proxies and dynamic dispatch to implement patterns like null objects, visitors, and logging proxies at runtime without static constraints. The key points are:
1. Design patterns remain relevant when translated to modern OOP languages like C#.
2. Features like extension methods and dynamic objects allow new implementations of patterns like local inversion of control and runtime proxies.
3. The composite pattern can expose collections and individual objects through a uniform interface at different scales from properties to entire classes.
4. Dynamic features enable implementing patterns
Map(), flatmap() and reduce() are your new best friends: simpler collections,...Chris Richardson
This document summarizes a presentation about functional programming and how functions like map(), flatMap(), and reduce() can simplify collection processing, concurrency, and big data problems. The presentation introduces functional programming concepts and how languages like Java 8 have adopted these with features like lambda expressions and streams. It provides examples of how to use streams to map, filter, and reduce collections in a more declarative way compared to imperative for loops. It also discusses how functions and futures can help simplify concurrent operations by allowing asynchronous work to be expressed more clearly.
The document provides an overview of functional programming in Java. It discusses functional programming concepts like higher-order functions and avoiding side effects. It gives examples of functional-style code in Java for filtering lists and transforming objects. It also discusses how functional programming can be used to implement customizable business logic by passing functions as parameters and looking up functions through a dependency injection container.
C# 7.x What's new and what's coming with C# 8Christian Nagel
C# is extended in a fast pace – with new features allow to reduce the code you need to write, offer more safety, and gives better performance – and you still write safe code. In this session you are introduced to the new C# 7.0-7.3 features including tuples and pattern matching, and learn about the features planned with C# 8.0 such as nullable reference types, extensions for pattern matching, and the new switch expression.
The document discusses clean code principles such as writing code for readability by other programmers, using meaningful names, following the DRY principle of not repeating yourself, and focusing on writing code that is maintainable and changeable. It provides examples of clean code versus less clean code and emphasizes that code is written primarily for human consumption by other programmers, not for computers. The document also discusses principles like the Single Responsibility Principle and the Boy Scout Rule of leaving the code cleaner than how you found it. It questions how to measure clean code and emphasizes the importance of writing tests for code and refactoring legacy code without tests.
TypeScript is a superset of JavaScript that compiles to JavaScript. It adds optional static typing, classes, interfaces, and other features to JavaScript to help catch errors. TypeScript files use the .ts extension and can be compiled to JavaScript using the TypeScript compiler. Key features of TypeScript include static typing for variables, interfaces for defining object structures, classes and inheritance for object-oriented programming, and modules for code organization.
A brief overview about how to write human readable and meaningful code. Here is described why and how to write meaningful names of variables or method, what to follow about writing a function for SRP / Open-Closed principle rule, when to write comments and rules of Code Formatting. Advantages of clean code is also described here.
TypeScript is a superset of JavaScript that adds static typing and class-based object-oriented programming. It allows developers to migrate existing JavaScript code incrementally by adding type annotations and migrating files to the .ts extension over time. The document discusses TypeScript's architecture, transpilation to JavaScript, typing system, and provides recommendations for migrating JavaScript code to TypeScript.
Groovy is a dynamic language for the Java Virtual Machine that simplifies programming through features like closures, properties, and built-in support for lists, maps, ranges, and regular expressions. The latest version 1.5 adds support for Java 5 features like annotations and generics to leverage frameworks that use them. Groovy can be integrated into applications through mechanisms like JSR-223, Spring, and Groovy's own GroovyClassLoader to externalize business rules, provide extension points, and customize applications.
This document discusses upcoming features in C# based on presentations by Christian Nagel. It covers features already implemented in C# 7.x like tuples, deconstruction, and pattern matching as well as features still in progress or being prototyped for C# 8 like records, caller expression attributes, async streams, indexes and ranges, extended patterns, and nullable reference types. The goal of new features is to make C# code safer, more efficient, give more freedom, and require less code.
1. The document discusses using Kotlin with MicroProfile for building microservices, teaching Kotlin newer techniques from Java and MicroProfile.
2. It provides examples of configuring Kotlin projects using Maven to work with MicroProfile libraries and annotations for dependency injection and JAX-RS.
3. The examples demonstrate a demo project using Kotlin with Jakarta EE and MicroProfile for entities, repositories, and controllers, and deploying the application to Oracle Cloud.
This document discusses transitioning from .NET/XAML development to web development using HTML, JavaScript, and TypeScript. It covers choosing TypeScript and a MVVM framework like Knockout to leverage existing skills in data binding, object-oriented programming, and requirements handling. The document demonstrates TypeScript features like classes, inheritance, interfaces and generics. It also shows how to implement the MVVM pattern in Knockout through data binding, commands, and iterating over collections.
The document discusses abstract syntax tree (AST) transformations in Groovy and Java. It covers several tools and techniques for AST transformations including Lombok, Groovy, CodeNarc, IntelliJ IDEA, Mirah macros, and how they allow generating code, performing static analysis, and rewriting code at compile time through analyzing and modifying the AST. The key topics are how these tools work by compiling code to an AST, analyzing and modifying the AST nodes, and sometimes generating source code from the transformed AST.
The document discusses the history and architecture of Microsoft's .NET framework and C# programming language. It provides an overview of key .NET concepts like assemblies, application domains, and interoperability. It also summarizes major features of C# like namespaces, control flow, iterators, properties, attributes, delegates and events, LINQ, structs and constructors.
This document discusses refactoring Java code to Clojure using macros. It provides examples of refactoring Java code that uses method chaining to equivalent Clojure code using the threading macros (->> and -<>). It also discusses other Clojure features like type hints, the doto macro, and polyglot projects using Leiningen.
The document discusses function overloading in C++ and provides an example program to calculate the area of different shapes using function overloading. It then discusses constructors and destructors with examples and explains polymorphism with an example. Next, it discusses different types of inheritance in C++ and provides an example program to implement operator overloading for a distance class. It also discusses virtual functions with an example and access specifiers in classes. Finally, it provides examples to define a student class, implement quicksort using templates and overloading relational operators.
Scala 3 Is Coming: Martin Odersky Shares What To KnowLightbend
Scala 3 is coming and will introduce many new features and changes while maintaining compatibility with Scala 2 code. The roadmap outlines stabilizing Scala 3.0 in fall 2019 and 2020, with Scala 2.x continuing in parallel. Key changes include replacing implicits with "givens", introducing enums, union types, and other features to improve the language for beginners, everyday usage, and experts. While significant, the changes are aimed at regularizing Scala and addressing longstanding issues like implicits in a way that eases migration from Scala 2 to 3 through common intermediate representations like Tasty.
Groovy is a dynamic language for the Java Virtual Machine that aims to provide a concise, readable syntax with features like closures, metaprogramming and domain-specific language support. Some key features include dynamic typing, operator overloading, builders for generating XML/Swing code and the ability to extend any class or category of objects with additional methods. Groovy aims to be fully interoperable with Java while allowing more compact representations of common patterns.
Kotlin - The Swiss army knife of programming languages - Visma Mobile Meet-up...Tudor Dragan
Kotlin is a powerful language, but it also comes with its traps and pitfalls. This presentation is about uncovering the very nice features and strange particularities that the language has to offer.
Clojure and Swing – a new productivity sweet spot? discusses how Clojure, a Lisp dialect that runs on the JVM, can be used to develop graphical user interfaces (GUIs) using Java Swing in a more productive way than plain Java. It presents several advantages of Clojure for Swing development, such as reducing boilerplate code, easier definition of actions and event bindings, and increased flexibility and reusability through functional programming techniques. Examples are provided of common Swing programming tasks implemented more concisely and readably in Clojure compared to Java. The document concludes that Clojure is a powerful and flexible language that offers opportunities to apply Lisp concepts to Swing GUI development
"Scaling Product Mindset: From Individual Ideas to Team Culture", Oksana Holu...Fwdays
Developing a product mindset is a long-term process that requires effective communication, team engagement, and a culture of experimentation. When developers feel like they are part of the product, they go beyond just coding—they create real value for users.
"AI-Driven Automation for High-Performing Teams: Optimize Routine Tasks & Lea...Fwdays
Every day, managers and team leads face numerous routine tasks: creating and updating issues in Jira, running meetings, syncing the team, handling retrospectives, and managing documentation. Most of these processes take up valuable time that could be spent on strategic leadership and team development.
In this talk, I will show how AI can optimize team processes, automate routine tasks, and make workflows more efficient. You will learn how AI enhances Scrum processes and helps streamline team management.
I will also share my experience in automating workflows in Jira and Slack: how to reduce manual work with simple automation rules, set up automatic notifications for blockers, generate Confluence pages, track team productivity, and extract valuable insights. What will you gain from this talk??
"Constructive Interaction During Emotional Burnout: With Local and Internatio...Fwdays
One of the biggest challenges in workplace communication is expressing dissatisfaction and providing feedback. Over 50% of misunderstandings arise in these situations, regardless of the project. Add emotional burnout and cultural differences, and the consequences can become serious.
In his speech, Alexey will tell share feedback tools that work effectively for IT professionals. He will explore why many cultures struggle with giving and receiving constructive criticism and how fundamental argumentation principles, combined with simple empathy-based techniques, can help prevent more than half of potential conflicts.
"Perfectionisin: What Does the Medicine for Perfectionism Look Like?", Manoil...Fwdays
Every true perfectionist has heard at least once in their life that nothing and no one is perfect, so you just need to lower your standards, stop stressing over details, and allow yourself to make mistakes. After all, we learn from our mistakes, and only those who do nothing never make mistakes. And while all of this is true, the likelihood that it has helped you in any way is about 0.0000000000001%.
In her presentation, Maria will talk about the revolutionary drug Perfectionisin. We will take a deeper look at perfectionism, understand what lies behind it, and focus on addressing the root causes. In other words, treating the disease, not just the symptoms.
"39 offers for my mentees in a year. How to create a professional environment...Fwdays
Mentoring is not only about sharing experience from an established specialist with someone new in the field but also beneficial for the mentor than for the mentee.
Creating a positive reputation among recruiters and the community, scaling yourself and your impact through content, reviewing pet projects to develop confidence, and increasing the number of proposals from employers are just some of the benefits that a tech professional can achieve through mentoring.
I will also share how mentoring beginners helped me to be hired into my current position.
The presentation will help experienced specialists who want to build a professional community but are unsure of its benefits.
"From “doing tasks” to leadership: how to adapt management style to the conte...Fwdays
Ever noticed that one team runs like a well-oiled machine while another keeps getting stuck? Why does one developer thrive on freedom while another panics without clear instructions? And most importantly—how do you handle this when you’re no longer just coding, but leading?
In this talk, we’ll break down how to choose the right leadership style depending on the situation and the maturity level of your team:
🔹 When to control and when to step back (Hersey-Blanchard Situational Leadership Model).
🔹 How to assess uncertainty levels and respond effectively (Stacey Matrix & Cynefin Framework).
🔹 How to delegate without endless clarifications (Management 3.0 Delegation Levels).
🔹 Why simply “assigning tasks” is a failure and how to communicate effectively (Leadership Ladder).
🔹 What motivates people beyond money and how to use it (Moving Motivators).
This talk is for those who want to stop “putting out fires” and start influencing people and outcomes like a pro.
[QUICK TALK] "Why Some Teams Grow Better Under Pressure", Oleksandr Marchenko...Fwdays
What will be discussed?
What distinguishes pressure from chaos in product teams?
Why do these concepts often blur, and how can teams learn to navigate the fine line between them?
What helps teams grow beyond their limits?
Why do mature teams lose sensitivity to growth stimuli, while younger teams struggle to define their approach to growth?
What breaks teams, and what strengthens them?
How can managers develop a strategy for managing team pressure, and how can teams properly perceive and leverage that pressure?
[QUICK TALK] "How to study to acquire a skill, not a certificate?", Uliana Du...Fwdays
How many certificates do you have on your shelf or on LinkedIn? Now the real question is: did these courses really help you develop your skills?
Learning is not just a line on your resume, it makes a real difference in your work and life. In her speech, Uliana will share practical tools that will help you learn so that your knowledge works and your skills are strengthened, not just add to your collection of certificates.
We will talk about effective approaches to learning, motivation, and how to avoid the trap of the “eternal student”.
[QUICK TALK] "Coaching 101: How to Identify and Develop Your Leadership Quali...Fwdays
What does it mean to be a leader, and what qualities should you develop in yourself? And how do you know if you even have these skills? This isn’t just a question—it’s the key to understanding where to start and how to move forward in unlocking your potential.
Let’s break down leadership and coaching as a tool for unleashing your leadership potential. We’ll explore how coaching differs from mentoring, psychotherapy, and training—and why they’re not all the same. Special focus will be on self-coaching: learning to engage in an internal dialogue so you can keep moving forward even when external support is lacking.
I’ll share a few practical life hacks and real-world examples that will help you create a plan and start taking action as soon as tomorrow.
"Dialogue about fakapas: how to pass an interview without unnecessary mistake...Fwdays
A mix of practical advice and real-life stories, where two experts share the secrets of successfully passing all stages from the prescreen to the final conversation.
An interview is always a challenge, regardless of experience. Is it possible to avoid common mistakes and increase your chances of success? Yes! The main thing is to know how to prepare properly and what tricks to avoid.
At this talk, two experts will share real-life stories and practical advice on how to go through all the stages from the first prescreen to the final conversation. We will analyze typical mistakes of candidates, explain how not to disrupt the offer at the last moment, and give recommendations that will help you feel confident during the interview.
"Conflicts within a Team: Not an Enemy, But an Opportunity for Growth", Orest...Fwdays
Conflicts within a team are not always a bad sign. On the contrary, they can become a powerful tool for development. In this talk, Orest will share my experience and practical tools for resolving conflicts constructively, which help not only maintain harmony in the team but also improve its overall performance. You will learn how to turn conflicts into opportunities to strengthen team bonds, enhance communication skills, and achieve better results.
"Surfing the IT Waves: How Not to Drown in the Information Ocean", Serhii Nem...Fwdays
In the world of IT, where technologies develop at the speed of light, it's crucial to understand not only what to learn but also when to do it. In this presentation, we will explore a practical approach to the professional development of an IT specialist and figure out how to effectively track industry innovations without compromising your main work.
We will discuss what truly influences your value as a developer, when it's worth investing time in learning new technologies, and how this relates to other important skills - from English proficiency to understanding the business value of projects.
The presentation will be useful for both beginners who are just entering the job market and experienced developers who strive to remain competitive.
"Seeing vs. Understanding: The Hidden Psychology of Design", Irene Shkarovska...Fwdays
🤔 Looks matter. But do they really help? In design, we often glorify aesthetics, but does making something “pretty” actually make it more usable? This talk breaks down the psychological battle between visual appeal and functional clarity, exploring how design influences both emotion and cognition.
We'll take you through:
- How composition theory shapes both aesthetics and usability.
- Why visual design is crucial for some products but useless for others.
- The role of cognitive load: real reason users click (or don’t).
- How visual triggers manipulate emotions and decision-making.
- The secret to balancing eye candy with functionality to create truly effective design.
🔥 Get ready for a mix of psychology, interaction design, and a few hard truths. If you've ever wondered whether you should lean into visuals or focus on usability—this talk will help you decide.
"Spin-up pgbouncer for fun and profit", Vitaliy KharytonskiyFwdays
In this presentation I will try to analyze the experience of using pgbouncer and other database proxies at prom.ua. What profit does it bring in organizational sense, what new flexibility it gives to the infrastructure and everyday maintenance and scaling, which additional enchancements we managed to implement and test, what worked and what did not.
"Building Trust: Strengthening Your Software Supply Chain Security", Serhii V...Fwdays
The talk focuses on developing and integrating automation tools to enhance Supply Chain security. It addresses reproducible security practices with tools like Renovate and Wiz, as well as GitLab and JFrog Artifactory, to enforce consistent security scans seamlessly within existing workflows.
We will cover centralized artifact management for improved oversight and consistency. Furthermore, we will discuss the seamless integration of security scans into deployment tooling, featuring automatic deployment blocks for vulnerabilities and a controlled override option for flexibility.
The talk also examines tactics to keep the source code secure and up to date. We will explore the integration of runtime monitoring systems with detection capabilities and SLAs to manage and resolve issues on time.
"10 Pitfalls of a Platform Team", Yura RochniakFwdays
There are many obstacles and pitfalls on the path towards operational zen. Many routes could lead to dead ends and many detours could end up being loops.
In this semi-comedy talk I share some examples of how processes fail for engineering teams that I observed through my career, using two pillars of the Internet culture - memes and numbered lists.
"Reality of Managing 100+ “Managed” RDS Postgres Databases", Mykyta HlushakFwdays
During the lecture, Mykyta will share the story of Solidgate's journey in building a high-performing and reliable fintech company, striving for 99.999% uptime on AWS’s SaaS platform. He'll uncover numerous caveats in doing things right without full system access, addressing product requirements, and staying up to date.
"Zero-sales lost — Incident Management", Igor DrozdFwdays
In my presentation, I will discuss the key aspects of the Zero Sales Lost strategy, focusing on incident management in the context of E-commerce development and the "Silpo" ecosystem. I will share our experience in building an incident management process, the specifics of monitoring and alerting system architecture, and how we scaled these processes across 19 products and 41 teams.
Additionally, we will explore the role of DevOps culture and team responsibility in product development. Using real case studies, we will analyze whether critical failures can be prevented and how to achieve that effectively.
"Turning Kubernetes into a full-fledged private cloud", Volodymyr TsapFwdays
At the conference, I will present an approach to extending the capabilities of Kubernetes, transforming it into a fully-fledged private Cloud with support for virtualization, isolated networks, and multi-organization authentication.
The goal of the presentation is to demonstrate that Kubernetes is not just a platform for containers, but a fully-featured private cloud that can be easily adapted to business needs.
"Kubernetes operators. How we migrated Release Management to controllers", De...Fwdays
Kubernetes Controllers and Operators are a trending topic in conferences, interviews, and production today. I will share the story of the evolution of our Promotion (Release) system, from simple Kubernetes API REST calls to Informers and Controllers, based on my own experience. This story is particularly interesting because it serves as a great case for personal growth for you as well as for your DevOps/SRE team. It touches on Kubernetes architecture details, Networking, GitOps, IaC, Caching, development patterns, and Golang data structures. Even if you have no development experience (as is the case for most of our team), I will share how a Cursor AI assistant became yet another — though virtual — engineer on our team.
Bonus: 10 years of Kubernetes & trends KubeCon24 North America.
Sugarlab AI: How Much Does an XXX AI Porn Generator Cost in 2025Sugarlab AI
The cost of an XXX AI porn generator in 2025 varies depending on factors like AI sophistication, subscription plans, and additional expenses. Whether you're looking for a free AI porn video generator or a premium adult AI image generator, pricing ranges from basic tools to enterprise-level solutions. This article breaks down the costs, features, and what to expect from AI-driven adult content platforms.
Research Data Management (RDM): the management of dat in the research processHeilaPienaar
Presented as part of the M.IT degree at the Department of Information Science, University of Pretoria, South Africa. Module: Data management. 2023, 2024.
Elevate your online presence with Malachite Technologies where creativity meets technology. Our web design experts craft visually stunning and interactive websites that not only capture your brand’s essence but also enhance user engagement.
Why Outsource Accounting to India A Smart Business Move!.pdfanjelinajones6811
Outsource Accounting to India to reduce costs, access skilled professionals, and streamline financial operations. Indian accounting firms offer expert services, advanced technology, and round-the-clock support, making it a smart choice for businesses looking to improve efficiency and focus on growth.
Mastering Azure Durable Functions - Building Resilient and Scalable WorkflowsCallon Campbell
The presentation aims to provide a comprehensive understanding of how Azure Durable Functions can be used to build resilient and scalable workflows in serverless applications. It includes detailed explanations, application patterns, components, and constraints of Durable Functions, along with performance benchmarks and new storage providers.
This presentation provides a comprehensive overview of the Transactional Outbox Pattern and the Inbox Pattern, two essential techniques for ensuring reliable and consistent communication in distributed systems.
We start by clearly outlining the problem these patterns aim to solve—namely, maintaining data consistency between databases and message brokers in event-driven architectures. From there, we delve into what the Outbox Pattern is, how it works under the hood, and how it guarantees message delivery even in the face of failures.
The presentation then shifts focus to the Inbox Pattern, explaining its role in ensuring idempotency and preventing duplicate processing of messages. Each concept is explained with simple language, diagrams, and a logical flow that builds a solid understanding from the ground up.
Whether you’re an engineer building microservices or just exploring distributed system patterns, this talk provides clarity, practical insights, and a helpful demo to see the patterns in action.
Topics Covered:
* Problem Statement
* Transactional Outbox Pattern
* How It Solves the Problem
* Internal Mechanics
* Delivery Guarantees
* Inbox Pattern Explained
* Internal Workflow
* Conclusions & Further Reading
* Demo
Automating Behavior-Driven Development: Boosting Productivity with Template-D...DOCOMO Innovations, Inc.
https://bit.ly/4ciP3mZ
We have successfully established our development process for Drupal custom modules, including automated testing using PHPUnit, all managed through our own GitLab CI/CD pipeline. This setup mirrors the automated testing process used by Drupal.org, which was our goal to emulate.
Building on this success, we have taken the next step by learning Behavior-Driven Development (BDD) using Behat. This approach allows us to automate the execution of acceptance tests for our Cloud Orchestration modules. Our upcoming session will provide a thorough explanation of the practical application of Behat, demonstrating how to effectively use this tool to write and execute comprehensive test scenarios.
In this session, we will cover:
1. Introduction to Behavior-Driven Development (BDD):
- Understanding the principles of BDD and its advantages in the software development lifecycle.
- How BDD aligns with agile methodologies and enhances collaboration between developers, testers, and stakeholders.
2. Overview of Behat:
- Introduction to Behat as a testing framework for BDD.
- Key features of Behat and its integration with other tools and platforms.
3. Automating Acceptance Tests:
- Running Behat tests in our GitLab CI/CD pipeline.
- Techniques for ensuring that automated tests are reliable and maintainable.
- Strategies for continuous improvement and scaling the test suite.
4. Template-Based Test Scenario Reusability:
- How to create reusable test scenario templates in Behat.
- Methods for parameterizing test scenarios to enhance reusability and reduce redundancy.
- Practical examples of how to implement and manage these templates within your testing framework.
By the end of the session, attendees will have a comprehensive understanding of how to leverage Behat for BDD in their own projects, particularly within the context of Drupal and cloud orchestration. They will gain practical knowledge on writing and running automated acceptance tests, ultimately enhancing the quality and efficiency of their development processes.
Next.js Development: The Ultimate Solution for High-Performance Web Appsrwinfotech31
The key benefits of Next.js development, including blazing-fast performance, enhanced SEO, seamless API and database integration, scalability, and expert support. It showcases how Next.js leverages Server-Side Rendering (SSR), Static Site Generation (SSG), and other advanced technologies to optimize web applications. RW Infotech offers custom solutions, migration services, and 24/7 expert support for seamless Next.js operations. Explore more :- https://www.rwit.io/technologies/next-js
Automated Engineering of Domain-Specific Metamorphic Testing EnvironmentsPablo Gómez Abajo
Context. Testing is essential to improve the correctness of software systems. Metamorphic testing (MT) is an approach especially suited when the system under test lacks oracles, or they are expensive to compute. However, building an MT environment for a particular domain (e.g., cloud simulation, model transformation, machine learning) requires substantial effort.
Objective. Our goal is to facilitate the construction of MT environments for specific domains.
Method. We propose a model-driven engineering approach to automate the construction of MT environments. Starting from a meta-model capturing the domain concepts, and a description of the domain execution environment, our approach produces an MT environment featuring comprehensive support for the MT process. This includes the definition of domain-specific metamorphic relations, their evaluation, detailed reporting of the testing results, and the automated search-based generation of follow-up test cases.
Results. Our method is supported by an extensible platform for Eclipse, called Gotten. We demonstrate its effectiveness by creating an MT environment for simulation-based testing of data centres and comparing with existing tools; its suitability to conduct MT processes by replicating previous experiments; and its generality by building another MT environment for video streaming APIs.
Conclusion. Gotten is the first platform targeted at reducing the development effort of domain-specific MT environments. The environments created with Gotten facilitate the specification of metamorphic relations, their evaluation, and the generation of new test cases.
All-Data, Any-AI Integration: FME & Amazon Bedrock in the Real-WorldSafe Software
Join us for an exclusive webinar featuring special guest speakers from Amazon, Amberside Energy, and Avineon-Tensing as we explore the power of Amazon Bedrock and FME in AI-driven geospatial workflows.
Discover how Avineon-Tensing is using AWS Bedrock to support Amberside Energy in automating image classification and streamlining site reporting. By integrating Bedrock’s generative AI capabilities with FME, image processing and categorization become faster and more efficient, ensuring accurate and organized filing of site imagery. Learn how this approach reduces manual effort, standardizes reporting, and leverages AWS’s secure AI tooling to optimize their workflows.
If you’re looking to enhance geospatial workflows with AI, automate image processing, or simply explore the potential of FME and Bedrock, this webinar is for you!
SAP Automation with UiPath: Solution Accelerators and Best Practices - Part 6...DianaGray10
Join us for a comprehensive webinar on SAP Solution Accelerators and best practices for implementing them using UiPath. This session is designed to help SAP professionals and automation enthusiasts understand how to effectively leverage UiPath’s SAP Solution Accelerators to automate standard SAP process quickly. Learn about the benefits, best ways to do it, and real-world success stories to speed up.
GDG Cloud Southlake #41: Shay Levi: Beyond the Hype:How Enterprises Are Using AIJames Anderson
Beyond the Hype: How Enterprises Are Actually Using AI
Webinar Abstract:
AI promises to revolutionize enterprises - but what’s actually working in the real world? In this session, we cut through the noise and share practical, real-world AI implementations that deliver results. Learn how leading enterprises are solving their most complex AI challenges in hours, not months, while keeping full control over security, compliance, and integrations. We’ll break down key lessons, highlight recent use cases, and show how Unframe’s Turnkey Enterprise AI Platform is making AI adoption fast, scalable, and risk-free.
Join the session to get actionable insights on enterprise AI - without the fluff.
Bio:
Shay Levi is the Co-Founder and CEO of Unframe, a company redefining enterprise AI with scalable, secure solutions. Previously, he co-founded Noname Security and led the company to its $500M acquisition by Akamai in just four years. A proven innovator in cybersecurity and technology, he specializes in building transformative solutions.
9. Speaker: Alexey Golub @Tyrrrz
Expression Tree
describes the structure of an expression
10. Expression Trees in .NET
• Object model represented by types deriving from
System.Linq.Expressions.Expression
• Can be constructed manually using factory methods
• Can be inferred from lambdas by the compiler
• Lambda expression trees can be converted into delegates
Speaker: Alexey Golub @Tyrrrz
15. Speaker: Alexey Golub @Tyrrrz
public Func<string, string?> ConstructGreetingFunction()
{
var personNameParameter = Expression.Parameter(typeof(string), "personName");
var isNullOrWhiteSpaceMethod = typeof(string)
.GetMethod(nameof(string.IsNullOrWhiteSpace));
var condition = Expression.Not(
Expression.Call(isNullOrWhiteSpaceMethod, personNameParameter));
var trueClause = Expression.Add(
Expression.Constant("Greetings, "),
personNameParameter);
var falseClause = Expression.Constant(null, typeof(string));
var conditional = Expression.Condition(condition, trueClause, falseClause);
var lambda = Expression.Lambda<Func<string, string?>>(conditional, personNameParameter);
return lambda.Compile();
}
16. Speaker: Alexey Golub @Tyrrrz
var getGreeting = ConstructGreetingFunction();
var greetingForJohn = getGreeting("John");
The binary operator Add is not defined for the types
'System.String' and 'System.String'.
17. Speaker: Alexey Golub @Tyrrrz
We need to call string.Concat() directly
var concatMethod = typeof(string)
.GetMethod(nameof(string.Concat), new[] {typeof(string), typeof(string)});
var trueClause = Expression.Call(
concatMethod,
Expression.Constant("Greetings, "),
personNameParameter);
18. Speaker: Alexey Golub @Tyrrrz
var getGreetings = ConstructGreetingFunction();
var greetingsForJohn = getGreetings("John");
var greetingsForNobody = getGreetings(" ");
// "Greetings, John"
// <null>
20. Speaker: Alexey Golub @Tyrrrz
How can we invoke Execute() from the outside?
public class Command
{
private int Execute() /> 42;
}
public static int CallExecute(Command command) =>
(int) typeof(Command)
.GetMethod("Execute", BindingFlags.NonPublic | BindingFlags.Instance)
.Invoke(command, null);
21. Speaker: Alexey Golub @Tyrrrz
public static class ReflectionCached
{
private static MethodInfo ExecuteMethod { get; } = typeof(Command)
.GetMethod("Execute", BindingFlags.NonPublic | BindingFlags.Instance);
public static int CallExecute(Command command) =>
(int) ExecuteMethod.Invoke(command, null);
}
public static class Re/lectionDelegate
{
private static MethodInfo ExecuteMethod { get; } = typeof(Command)
.GetMethod("Execute", Binding/lags.NonPublic | Binding/lags.Instance);
private static Func<Command, int> Impl { get; } =
(Func<Command, int>) Delegate
.CreateDelegate(typeof(Func<Command, int>), ExecuteMethod);
public static int CallExecute(Command command) /> Impl(command);
}
Using cached MethodInfo
Using Delegate.CreateDelegate
22. public static class ExpressionTrees
{
private static MethodInfo ExecuteMethod { get; } = typeof(Command)
.GetMethod("Execute", Binding/lags.NonPublic | Binding/lags.Instance);
private static Func<Command, int> Impl { get; }
static ExpressionTrees()
{
var instance = Expression.Parameter(typeof(Command));
var call = Expression.Call(instance, ExecuteMethod);
Impl = Expression.Lambda<Func<Command, int/>(call, instance).Compile();
}
public static int CallExecute(Command command) /> Impl(command);
}
Speaker: Alexey Golub @Tyrrrz
Lazy thread-safe
initialization via static
constructor
25. Speaker: Alexey Golub @Tyrrrz
What can we do to support multiple types?
public int ThreeFourths(int x) => 3 * x / 4;
public int ThreeFourths(int x) => 3 * x / 4;
public long ThreeFourths(long x) => 3 * x / 4;
public float ThreeFourths(float x) => 3 * x / 4;
public double ThreeFourths(double x) => 3 * x / 4;
public decimal ThreeFourths(decimal x) => 3 * x / 4;
public T ThreeFourths<T>(T x) /> 3 * x / 4;
But we actually want something like this instead
26. Speaker: Alexey Golub @Tyrrrz
public T ThreeFourths<T>(T x)
{
var param = Expression.Parameter(typeof(T));
var three = Expression.Convert(Expression.Constant(3), typeof(T));
var four = Expression.Convert(Expression.Constant(4), typeof(T));
var operation = Expression.Divide(Expression.Multiply(param, three), four);
var lambda = Expression.Lambda<Func<T, T>>(operation, param);
var func = lambda.Compile();
return func(x);
}
var a = ThreeFourths(18); // 13
var b = ThreeFourths(6.66); // 4.995
var c = ThreeFourths(100M); // 75M
27. Speaker: Alexey Golub @Tyrrrz
public dynamic ThreeFourths(dynamic x) /> 3 * x / 4;
Wait, how is it different from this?
28. public static class ThreeFourths
{
private static class Impl<T>
{
public static Func<T, T> Of { get; }
static Impl()
{
var param = Expression.Parameter(typeof(T));
var three = Expression.Convert(Expression.Constant(3), typeof(T));
var four = Expression.Convert(Expression.Constant(4), typeof(T));
var operation = Expression.Divide(Expression.Multiply(param, three), four);
var lambda = Expression.Lambda<Func<T, T>>(operation, param);
Of = lambda.Compile();
}
}
public static T Of<T>(T x) => Impl<T>.Of(x);
}
Speaker: Alexey Golub @Tyrrrz
Generic, thread-safe
lazy initialization
34. Speaker: Alexey Golub @Tyrrrz
Func<int, int, int> div =
(a, b) => a / b;
Expression<Func<int, int, int>> divExpr =
(a, b) => a / b;
Same value, different type
Console.WriteLine(divExpr.Type);
// System.Func`3[System.Int32,System.Int32,System.Int32]
35. Speaker: Alexey Golub @Tyrrrz
Func<int, int, int> div =
(a, b) /> a / b;
Expression<Func<int, int, int/> divExpr =
(a, b) /> a / b;
Same value, different type
foreach (var param in divExpr.Parameters)
Console.WriteLine($"Param: {param.Name} ({param.Type.Name})");
// Param: a (Int32)
// Param: b (Int32)
36. Speaker: Alexey Golub @Tyrrrz
Func<int, int, int> div =
(a, b) /> a / b;
Expression<Func<int, int, int/> divExpr =
(a, b) /> a / b;
Same value, different type
var div = divExpr.Compile();
var c = div(10, 2); // 5
37. Speaker: Alexey Golub @Tyrrrz
Func<int, int, int> div =
(a, b) => a / b;
Expression<Func<int, int, int>> divExpr =
(a, b) => a / b;
Product
Recipe
38. Speaker: Alexey Golub @Tyrrrz
Limitations
Func<int, int, int> div = (a, b) /> a / b;
Expression<Func<int, int, int/> divExpr = div;
Compilation error
39. Speaker: Alexey Golub @Tyrrrz
Limitations
Expression<Func<int, int, int/> divExpr = (a, b) />
{
var result = a / b;
return result;
};
Compilation error
Expression<Action> writeToConsole = () =>
{
Console.Write("Hello ");
Console.WriteLine("world!");
};
Compilation error
40. Speaker: Alexey Golub @Tyrrrz
Limitations
• Null-coalescing operator (obj?.Prop)
• Dynamic variables (dynamic)
• Asynchronous code (async/await)
• Default or named parameters (func(a, b: 5), func(a))
• Parameters passed by reference (int.TryParse("123", out var i))
• Multi-dimensional array initializers (new int[2, 2] { { 1, 2 }, { 3, 4 } })
• Assignment operations (a = 5)
• Increment and decrement (a++, a--, --a, ++a)
• Base type access (base.Prop)
• Dictionary initialization (new Dictionary<string, int> { ["foo"] = 100 })
• Unsafe code (via unsafe)
• Throw expressions (throw new Exception())
• Tuple literals ((5, x))
Can’t use any of the following:
42. Speaker: Alexey Golub @Tyrrrz
How can we get PropertyInfo of Dto.Id?
public class Dto
{
public Guid Id { get; set; }
public string Name { get; set; }
}
var idProperty = typeof(Dto).GetProperty(nameof(Dto.Id));
Console.WriteLine($"Type: {idProperty.DeclaringType.Name}");
Console.WriteLine($"Property: {idProperty.Name} ({idProperty.PropertyType.Name})");
// Type: Dto
// Property: Id (Guid)
43. Speaker: Alexey Golub @Tyrrrz
public class Validator<T>
{
// Add validation predicate to the list
public void AddValidation<TProp>(string propertyName, Func<TProp, bool> predicate)
{
var propertyInfo = typeof(T).GetProperty(propertyName);
if (propertyInfo is null)
throw new InvalidOperationException("Please provide a valid property name.");
// //.
}
// Evaluate all predicates
public bool Validate(T obj) { /* //. // }
/* //. //
}
var validator = new Validator<Dto>();
validator.AddValidation<Guid>(nameof(Dto.Id), id => id != Guid.Empty);
validator.AddValidation<string>(nameof(Dto.Name), name => !string.IsNullOrWhiteSpace(name));
var isValid = validator.Validate(new Dto { Id = Guid.NewGuid() }); // false
44. Speaker: Alexey Golub @Tyrrrz
What if we wanted to change the property type?
public class Dto
{
public int Id { get; set; }
public string Name { get; set; }
}
validator.AddValidation<Guid>(nameof(Dto.Id), id => id != Guid.Empty);
Still compiles, even though there is now an error
45. Speaker: Alexey Golub @Tyrrrz
public class Validator<T>
{
public void AddValidation<TProp>(
Expression<Func<T, TProp>> propertyExpression,
Func<TProp, bool> predicate)
{
var propertyInfo = (propertyExpression.Body as MemberExpression)?.Member as PropertyInfo;
if (propertyInfo is null)
throw new InvalidOperationException("Please provide a valid property expression.");
// ...
}
public bool Validate(T obj) { /* ... */ }
/* ... */
}
Expression is used to
identify a property
var validator = new Validator<Dto>();
validator.AddValidation(dto => dto.Id, id => id != Guid.Empty);
validator.AddValidation(dto => dto.Name, name => !string.IsNullOrWhiteSpace(name));
var isValid = validator.Validate(new Dto { Id = Guid.NewGuid() }); // false
47. Speaker: Alexey Golub @Tyrrrz
[Test]
public void IntTryParse_Test()
{
// Arrange
const string s = "123";
// Act
var result = int.TryParse(s, out var value);
// Assert
Assert.That(result, Is.True, "Parsing was unsuccessful");
Assert.That(value, Is.EqualTo(124), "Parsed value is incorrect");
}
X IntTryParse_Test [60ms]
Error Message:
Parsed value is incorrect
Expected: 124
But was: 123
48. Speaker: Alexey Golub @Tyrrrz
public static class AssertEx
{
public static void Express(Expression<Action> expression)
{
var act = expression.Compile();
try
{
act();
}
catch (AssertionException ex)
{
throw new AssertionException(
expression.Body.ToReadableString() +
Environment.NewLine +
ex.Message);
}
}
}
Extension method from
ReadableExpressions package
49. Speaker: Alexey Golub @Tyrrrz
X IntTryParse_Test [60ms]
Error Message:
Assert.That(value, Is.EqualTo(124))
Expected: 124
But was: 123
[Test]
public void IntTryParse_Test()
{
// Arrange
const string s = "123";
// Act
var result = int.TryParse(s, out var value);
// Assert
AssertEx.Express(() => Assert.That(result, Is.True));
AssertEx.Express(() => Assert.That(value, Is.EqualTo(124)));
}
60. Speaker: Alexey Golub @Tyrrrz
var fsharpCode = FSharpTranspiler.Convert<Action<int, int>>(
(a, b) => Console.WriteLine("a + b = {0}", a + b));
> let foo = fun (a, b) -> printfn "a + b = %O" (a + b)
val foo : a:int * b:int -> unit
> foo (3, 5)
a + b = 8
val it : unit = ()
// fun (a, b) > printfn "a + b = %O" (a + b)
61. Summary
• Expression trees are fun
• We can make reflection-heavy code much faster
• We can do late-binding with almost no performance penalties
• We can write our own runtime-compiled DSL
• We can provide refactor-safe identification for type members
• We can analyze specified lambdas and reflect on their structure
• We can rewrite existing expressions to behave differently
• We can transpile code into other languages
Speaker: Alexey Golub @Tyrrrz
63. Learn more
• Working with expression trees in C# (by me)
https://tyrrrz.me/blog/expression-trees
• Introduction to expression trees (MS docs)
https://docs.microsoft.com/en-us/dotnet/csharp/expression-trees
• Expression trees in enterprise software (Maksim Arshinov)
https://youtube.com/watch?v=J2XzsCoJM4o
Speaker: Alexey Golub @Tyrrrz