This document discusses functional programming concepts. It explains that functional programming treats functions as first-class citizens and avoids side effects. Pure functions are easier to reason about because their outputs only depend on their inputs. The document also discusses avoiding null values and exceptions by using options and monads. Functional programming encourages immutability, referential transparency, and honesty in function signatures to make code more readable and easier to test.
This document discusses functional programming in TypeScript. It begins by defining functional programming concepts like immutability, higher order functions, and avoiding side effects. It then outlines three tenets of functional programming: taming side effects, using expressions over statements, and higher order functions. Finally, it details TypeScript features that support functional programming, including spread/rest operators, lambda expressions, union types, type inference, and tagged union types.
Functional Patterns for C++ Multithreading (C++ Dev Meetup Iasi)Ovidiu Farauanu
Discussing Design Patterns and OOP popularity,
Multithreading and OOP,
Functional Design for Multithreaded programming
and how Multithreading does not mean always concurency but multicore paralelism.
The document provides an overview of functional programming in JavaScript. It discusses key functional programming concepts like pure functions, referential transparency, and higher-order functions. It also covers functional techniques like mapping, filtering, reducing, and recursion that are commonly used in functional programming. The document uses examples with Lodash functions to demonstrate how these concepts and techniques can be implemented in JavaScript.
The document discusses various techniques and tools that can help software developers reduce errors in code, including:
1) Following a structured approach with clear modular structure, single logical tasks per subroutine, and documentation.
2) Using stubs, flags, and debugging output statements to isolate errors.
3) Performing desk checking and peer reviewing to catch logical errors.
4) Leveraging breakpoints, program traces, and single-line stepping in development environments.
In programming languages, a closure (also lexical closure or function closure) is a function or reference to a function together with a referencing environment as a block
The document discusses why software developers should use FlexUnit, an automated unit testing framework for Flex and ActionScript projects. It notes that developers spend 80% of their time debugging code and that errors found later in the development process can cost 100x more to fix than early errors. FlexUnit allows developers to automate unit tests so that tests can be run continually, finding errors sooner when they are cheaper to fix. Writing automated tests also encourages developers to write better structured, more testable and maintainable code. FlexUnit provides a testing architecture and APIs to facilitate automated unit and integration testing as well as different test runners and listeners to output test results.
The document provides an introduction to object-oriented programming concepts. It discusses procedural programming and its limitations. It then introduces key concepts of OOP like objects, classes, encapsulation, inheritance, polymorphism, and message passing. It explains how OOP addresses issues like code reuse and maintenance. The document also discusses benefits of OOP and its applications. It concludes by comparing C and C++, highlighting features like classes, objects, and inheritance that make C++ an object-oriented language.
LESSON 4: INTRODUCING FUNCTIONS AND MODULAR DESIGN
Learn about Functions in Python. Advantages and disadvantages of functions. Introduction to Modular design. Local and Global Variables and their use. Passing parameters. What are arguments? Big questions: Evolution vs Intelligent design in light of functions (and modular design). A closer look at Robotics and advances in this field. Challenges and tasks including with solutions. Suggested research/HW and YouTube video recommendations. A note on Python’s built in functions.
This document discusses functional programming in TypeScript. It begins by defining functional programming concepts like immutability, higher order functions, and avoiding side effects. It then outlines three tenets of functional programming: taming side effects, using expressions over statements, and higher order functions. Finally, it details TypeScript features that support functional programming, including spread/rest operators, lambda expressions, union types, type inference, and tagged union types.
Functional Patterns for C++ Multithreading (C++ Dev Meetup Iasi)Ovidiu Farauanu
Discussing Design Patterns and OOP popularity,
Multithreading and OOP,
Functional Design for Multithreaded programming
and how Multithreading does not mean always concurency but multicore paralelism.
The document provides an overview of functional programming in JavaScript. It discusses key functional programming concepts like pure functions, referential transparency, and higher-order functions. It also covers functional techniques like mapping, filtering, reducing, and recursion that are commonly used in functional programming. The document uses examples with Lodash functions to demonstrate how these concepts and techniques can be implemented in JavaScript.
The document discusses various techniques and tools that can help software developers reduce errors in code, including:
1) Following a structured approach with clear modular structure, single logical tasks per subroutine, and documentation.
2) Using stubs, flags, and debugging output statements to isolate errors.
3) Performing desk checking and peer reviewing to catch logical errors.
4) Leveraging breakpoints, program traces, and single-line stepping in development environments.
In programming languages, a closure (also lexical closure or function closure) is a function or reference to a function together with a referencing environment as a block
The document discusses why software developers should use FlexUnit, an automated unit testing framework for Flex and ActionScript projects. It notes that developers spend 80% of their time debugging code and that errors found later in the development process can cost 100x more to fix than early errors. FlexUnit allows developers to automate unit tests so that tests can be run continually, finding errors sooner when they are cheaper to fix. Writing automated tests also encourages developers to write better structured, more testable and maintainable code. FlexUnit provides a testing architecture and APIs to facilitate automated unit and integration testing as well as different test runners and listeners to output test results.
The document provides an introduction to object-oriented programming concepts. It discusses procedural programming and its limitations. It then introduces key concepts of OOP like objects, classes, encapsulation, inheritance, polymorphism, and message passing. It explains how OOP addresses issues like code reuse and maintenance. The document also discusses benefits of OOP and its applications. It concludes by comparing C and C++, highlighting features like classes, objects, and inheritance that make C++ an object-oriented language.
LESSON 4: INTRODUCING FUNCTIONS AND MODULAR DESIGN
Learn about Functions in Python. Advantages and disadvantages of functions. Introduction to Modular design. Local and Global Variables and their use. Passing parameters. What are arguments? Big questions: Evolution vs Intelligent design in light of functions (and modular design). A closer look at Robotics and advances in this field. Challenges and tasks including with solutions. Suggested research/HW and YouTube video recommendations. A note on Python’s built in functions.
The document discusses object-oriented programming (OOP) and compares it to procedure-oriented programming. It covers key concepts of OOP like objects, classes, encapsulation, inheritance, polymorphism, and message passing. It also discusses benefits of OOP like reusability, extensibility and managing complexity. The document provides examples of OOP concepts and differences between C and C++ programming languages.
The document outlines the topics covered in an introductory Visual Basic for Applications (VBA) course for Microsoft Access. The 3-hour sessions cover event-driven programming in Access, VBA language constructs and programming techniques, and working programmatically with data. Key concepts discussed include using the VBA editor, differentiating between functions and sub procedures, variable scope, and built-in VBA functions. Interactive exercises are provided to help learn organizing code and using functions.
Try and Future are abstractions in Scala that allow effects like exceptions and latency to be modeled and handled in a functional way. Try treats exceptions as effects by wrapping them and providing a pure functional interface. Future treats latency as an effect by delegating long-running computations to background threads. Both Try and Future are monads, meaning they support operations like flatMap that allow effects to be composed. This allows domain logic with potential effects to be written cleanly and resiliently.
The document discusses best practices for writing clear and maintainable C++ code. It summarizes the first six of twelve recommendations: 1) make class roots fully abstract, 2) inherit only for subtyping, 3) include only necessary files, 4) avoid duplicate code, 5) use self-contained objects, and 6) make acquisition and release of resources symmetric. The remaining recommendations continue the theme of avoiding unnecessary complexity and exposure to risk.
This document summarizes the Null Object pattern. The Null Object pattern addresses how to handle null references in code elegantly. It describes replacing null references with an object that implements the necessary interface but does nothing. This simplifies code by eliminating null checks and making the relationship mandatory. The pattern is then demonstrated with an example of adding logging to a server where logging is optional. Introducing a NullLog object removes the need for null checks when writing log messages.
The document discusses improving code quality through effective code review processes. It outlines common coding mistakes like redundant code, long or deeply nested functions, large modules, poor comments, and hardcoding. It recommends following best practices like coding guidelines, centralized server communication, and the single responsibility principle. The document also discusses measuring and reducing code complexity, avoiding memory leaks, optimizing images, static code analysis, and profiling to improve code quality.
The document discusses programming concepts including programming languages, switch case statements, and looping. It provides examples of how to write code using switch case statements and different types of loops (for, while, do-while). The examples demonstrate how to get user input, perform calculations, and repeat blocks of code multiple times.
The document discusses the key concepts of functional programming including:
- Functional programming uses functions as building blocks and avoids mutable state and side effects.
- Pure functions, immutability, recursion, and function composition are important characteristics.
- Functional programming is well-suited for concurrency since immutable data prevents data races.
- Some benefits of functional programming include simpler code for complex problems, increased correctness from avoiding side effects, and ease of parallelization for concurrency.
This document provides an introduction to C++ and covers 10 topics: 1) Object-oriented programming principles, 2) Classes and objects, 3) Functions, 4) Constructors and destructors, 5) Operator overloading and type conversion, 6) Inheritance, 7) Pointers, virtual functions and polymorphism, 8) Working with files, 9) Templates, and 10) Exception handling. Each topic is briefly described in 1-2 paragraphs with examples provided for some concepts like encapsulation, inheritance, polymorphism, and exception handling. The document serves as a high-level overview of key C++ concepts and features.
Object Oriented Programming Short Notes for Preperation of ExamsMuhammadTalha436
The document appears to be lecture notes on object-oriented programming using C++. It covers key concepts like classes, objects, encapsulation, inheritance, and polymorphism. It also provides examples of input/output statements, arithmetic operators, assignment operators, and relational operators in C++ code. The document is divided into multiple chapters with topics like classes, inheritance, templates, and exceptions.
The document discusses switch case statements and looping in programming. It provides examples of switch case statements that check the value of a variable and execute different code blocks depending on the value. It also discusses the different types of loops - for, while, and do-while loops - and provides examples of each. The examples demonstrate how to use switch cases and loops to repeat blocks of code or make decisions based on variable values.
Reliability Patterns for Distributed ApplicationsAndrew Hamilton
Description of different practices to help improve the reliability of a distributed applications. This presentation starts by establishing a good base of practices and then build upon those practices to create a robust and reliable system.
This document provides a lab manual for the fourth semester computer science engineering course on Object Oriented Technology. It includes the syllabus, rationale for object oriented programming, hardware and software requirements, a list of practical experiments to be conducted, and sample code for some of the experiments. The experiments cover topics like function overloading, inheritance, polymorphism, constructors, destructors, copy constructors, friend functions, and use of local, static and global objects. Each experiment is followed by sample output and questions related to the concepts covered in the program. The document aims to provide guidance to students on the practical implementation of object oriented programming concepts using C++.
A la découverte des google/mock (aka gmock)Thierry Gayet
The document provides an introduction and overview of using Google Mock for unit testing in C++. It discusses defining a mock class that implements the same interface as the system under test's dependencies. The mock class can then be configured to return expected values and verify method calls during tests. Writing mock classes with Google Mock involves using macros to declare mocked methods, which then generate the method definitions. The document provides an example of defining a MockTurtle class that implements the Turtle interface.
This document discusses exception handling in C++. It begins by explaining that errors are inevitable and traditional error handling obscures normal logic. It then introduces exceptions as a way to separate normal and exceptional control flow in C++. Exceptions respect code modularity but can cause problems if code is not exception-safe. The document advocates using resource management objects that ensure cleanup of resources like memory even if an exception occurs. This approach avoids problems with try-catch blocks and does not require language features like finally.
Switch case statements provide an alternative to long if/else statements when comparing a variable to multiple integral values. The basic format compares the variable to case values, executing code for a matching case. A default case handles non-matching values. Loops allow code to repeat, with for, while, and do-while loops. For loops initialize/update a variable and check a condition each repetition. While loops check a condition and repeat until it's false. Loops are useful for repeating tasks like displaying lists of data.
“Lambdas in JAVA 8 is not for what they can do, It is about how we write Program”
It enables Functional Programming, It Adds a New nucleotides in the DNA of Java.
There is a Change in “The Climate” to change our Ways.
The document discusses aspect-oriented programming (AOP) and its benefits and challenges. AOP can help solve problems by identifying cross-cutting concerns that can be modularized into aspects. While AOP is useful for implementing policies and capturing knowledge, programming stateful aspects is difficult and handling aspect side-effects can be challenging. The document expresses hope that AOP will find its place and that tools can help address current issues.
The document discusses object-oriented programming (OOP) and compares it to procedure-oriented programming. It covers key concepts of OOP like objects, classes, encapsulation, inheritance, polymorphism, and message passing. It also discusses benefits of OOP like reusability, extensibility and managing complexity. The document provides examples of OOP concepts and differences between C and C++ programming languages.
The document outlines the topics covered in an introductory Visual Basic for Applications (VBA) course for Microsoft Access. The 3-hour sessions cover event-driven programming in Access, VBA language constructs and programming techniques, and working programmatically with data. Key concepts discussed include using the VBA editor, differentiating between functions and sub procedures, variable scope, and built-in VBA functions. Interactive exercises are provided to help learn organizing code and using functions.
Try and Future are abstractions in Scala that allow effects like exceptions and latency to be modeled and handled in a functional way. Try treats exceptions as effects by wrapping them and providing a pure functional interface. Future treats latency as an effect by delegating long-running computations to background threads. Both Try and Future are monads, meaning they support operations like flatMap that allow effects to be composed. This allows domain logic with potential effects to be written cleanly and resiliently.
The document discusses best practices for writing clear and maintainable C++ code. It summarizes the first six of twelve recommendations: 1) make class roots fully abstract, 2) inherit only for subtyping, 3) include only necessary files, 4) avoid duplicate code, 5) use self-contained objects, and 6) make acquisition and release of resources symmetric. The remaining recommendations continue the theme of avoiding unnecessary complexity and exposure to risk.
This document summarizes the Null Object pattern. The Null Object pattern addresses how to handle null references in code elegantly. It describes replacing null references with an object that implements the necessary interface but does nothing. This simplifies code by eliminating null checks and making the relationship mandatory. The pattern is then demonstrated with an example of adding logging to a server where logging is optional. Introducing a NullLog object removes the need for null checks when writing log messages.
The document discusses improving code quality through effective code review processes. It outlines common coding mistakes like redundant code, long or deeply nested functions, large modules, poor comments, and hardcoding. It recommends following best practices like coding guidelines, centralized server communication, and the single responsibility principle. The document also discusses measuring and reducing code complexity, avoiding memory leaks, optimizing images, static code analysis, and profiling to improve code quality.
The document discusses programming concepts including programming languages, switch case statements, and looping. It provides examples of how to write code using switch case statements and different types of loops (for, while, do-while). The examples demonstrate how to get user input, perform calculations, and repeat blocks of code multiple times.
The document discusses the key concepts of functional programming including:
- Functional programming uses functions as building blocks and avoids mutable state and side effects.
- Pure functions, immutability, recursion, and function composition are important characteristics.
- Functional programming is well-suited for concurrency since immutable data prevents data races.
- Some benefits of functional programming include simpler code for complex problems, increased correctness from avoiding side effects, and ease of parallelization for concurrency.
This document provides an introduction to C++ and covers 10 topics: 1) Object-oriented programming principles, 2) Classes and objects, 3) Functions, 4) Constructors and destructors, 5) Operator overloading and type conversion, 6) Inheritance, 7) Pointers, virtual functions and polymorphism, 8) Working with files, 9) Templates, and 10) Exception handling. Each topic is briefly described in 1-2 paragraphs with examples provided for some concepts like encapsulation, inheritance, polymorphism, and exception handling. The document serves as a high-level overview of key C++ concepts and features.
Object Oriented Programming Short Notes for Preperation of ExamsMuhammadTalha436
The document appears to be lecture notes on object-oriented programming using C++. It covers key concepts like classes, objects, encapsulation, inheritance, and polymorphism. It also provides examples of input/output statements, arithmetic operators, assignment operators, and relational operators in C++ code. The document is divided into multiple chapters with topics like classes, inheritance, templates, and exceptions.
The document discusses switch case statements and looping in programming. It provides examples of switch case statements that check the value of a variable and execute different code blocks depending on the value. It also discusses the different types of loops - for, while, and do-while loops - and provides examples of each. The examples demonstrate how to use switch cases and loops to repeat blocks of code or make decisions based on variable values.
Reliability Patterns for Distributed ApplicationsAndrew Hamilton
Description of different practices to help improve the reliability of a distributed applications. This presentation starts by establishing a good base of practices and then build upon those practices to create a robust and reliable system.
This document provides a lab manual for the fourth semester computer science engineering course on Object Oriented Technology. It includes the syllabus, rationale for object oriented programming, hardware and software requirements, a list of practical experiments to be conducted, and sample code for some of the experiments. The experiments cover topics like function overloading, inheritance, polymorphism, constructors, destructors, copy constructors, friend functions, and use of local, static and global objects. Each experiment is followed by sample output and questions related to the concepts covered in the program. The document aims to provide guidance to students on the practical implementation of object oriented programming concepts using C++.
A la découverte des google/mock (aka gmock)Thierry Gayet
The document provides an introduction and overview of using Google Mock for unit testing in C++. It discusses defining a mock class that implements the same interface as the system under test's dependencies. The mock class can then be configured to return expected values and verify method calls during tests. Writing mock classes with Google Mock involves using macros to declare mocked methods, which then generate the method definitions. The document provides an example of defining a MockTurtle class that implements the Turtle interface.
This document discusses exception handling in C++. It begins by explaining that errors are inevitable and traditional error handling obscures normal logic. It then introduces exceptions as a way to separate normal and exceptional control flow in C++. Exceptions respect code modularity but can cause problems if code is not exception-safe. The document advocates using resource management objects that ensure cleanup of resources like memory even if an exception occurs. This approach avoids problems with try-catch blocks and does not require language features like finally.
Switch case statements provide an alternative to long if/else statements when comparing a variable to multiple integral values. The basic format compares the variable to case values, executing code for a matching case. A default case handles non-matching values. Loops allow code to repeat, with for, while, and do-while loops. For loops initialize/update a variable and check a condition each repetition. While loops check a condition and repeat until it's false. Loops are useful for repeating tasks like displaying lists of data.
“Lambdas in JAVA 8 is not for what they can do, It is about how we write Program”
It enables Functional Programming, It Adds a New nucleotides in the DNA of Java.
There is a Change in “The Climate” to change our Ways.
The document discusses aspect-oriented programming (AOP) and its benefits and challenges. AOP can help solve problems by identifying cross-cutting concerns that can be modularized into aspects. While AOP is useful for implementing policies and capturing knowledge, programming stateful aspects is difficult and handling aspect side-effects can be challenging. The document expresses hope that AOP will find its place and that tools can help address current issues.
Similar to Vendredi Tech_ la programmation fonctionnelle.pptx (20)
1. The document discusses the challenges of building software in a chaotic world, noting that building software is not a linear process and involves much uncertainty.
2. It emphasizes the importance of taking an iterative approach to reduce risks, having a strong user-centered vision rather than being user-led, and focusing on building the right product for the right customer.
3. The author advocates for viewing building software as a human activity involving technical and social complexity, and notes that processes, coordination across and within teams, and roles like product management are important for navigating this complex work.
The document discusses mutation testing and provides tips for implementing it. It explains different types of mutations like statement, value, and decision mutations. It also discusses how to calculate mutation score and challenges like cost. Examples are provided using tools like Pitest and Stryker. Advice is given around using mocks, refactoring complex code, and targeting tests to improve mutation testing.
This document provides an overview of domain-driven design (DDD) based on a feedback session in Amsterdam. It discusses:
1. What DDD is and is not - it is not a method, framework, or tool but has concepts like ubiquitous language, domain model, bounded contexts, and event sourcing.
2. Key DDD principles like having domain experts define the problem and solution, using a ubiquitous language, and designing bounded contexts to separate concerns while maintaining relationships.
3. Techniques for exploring a domain like event storming, user personas, acceptance tests, and distilling the core vs. support domains.
4. Architectural approaches like hexagonal/ports and adapters and
Que se passe t il avec l'Agilité en 2020. Crise de confiance? Manque d'évolutions? La crise du Covid19 a t elle permis de développer l'agilité dans les entreprises. Allons voir...
https://www.youtube.com/watch?v=URO7195UIdM&feature=youtu.be
Sous le feu des critiques: Trop moderne! Pas assez subversive aux yeux de certains! Pas créative! Un effet de mode passager pour les "djeunz"! Ou pire une musique de drogués!! Permettez moi au cours de cette session de vous éclairer sur cette culture et également sur les coulisses de la création des musiques assistées par ordinateur (MAO), et de voir ensemble les relations intéressantes que l'on peut tisser avec nos pratiques du développement logiciel (Software Craftsmanship).
On a pu lire quelques analogies entre pratique des musiques jazz, somme toute une musique très classique, et la pratique du développement logiciel tel que nous la concevons tous ici ("agile" diront certain). Pourtant il y a bien des façons de faire de la musique et en tant que spécialistes de la programmation j'ai été étonné de constater que peu d'entre nous s’intéressent à la musique dite "électronique". Pourtant, dans ces musiques aussi, nous nous servons d'outils logiciels au service de notre inspiration et notre créativité. On retrouve l'approche incrémentale, la technique imposée par les machines, des patterns évidemment, mais aussi de la pratique répétée, de l'amélioration continue et la coopération quand nous formons des groupes collaboratifs.
Au cours de cette session, après les généralités d'usage, je vous montrerai un DAW (digital audio workstation) logiciel, très couramment employé, et pas que pour la musique électronique, j'ai nommé "Live 9" d'Ableton avec sa surface de contrôle dédiée: Push (une sorte de clavier multi-fonctions pour la musique). Live est également extensible grâce à Max MSP, une API de programmation qui permet de scripter/patcher ce logiciel sous bien des formes.
J'espère vous montrer que création et programmation ne sont pas si éloignés que cela... et vous ferai partager mon expérience au sein de la Do It Yourself Music Academy
Collaboration avec le client plutôt que négociation de contrat » est certes l'un des 4 piliers du manifeste agile. Mais quel client, quel fournisseur seraient capables de démarrer un projet sans contrat? Cette présentation n'a pas pour objectif de vous donner la solution clés en main mais d'ouvrir le débat après avoir dépeint les solutions disponibles et donné des pistes de réflexion
WWDC 2024 Keynote Review: For CocoaCoders AustinPatrick Weigel
Overview of WWDC 2024 Keynote Address.
Covers: Apple Intelligence, iOS18, macOS Sequoia, iPadOS, watchOS, visionOS, and Apple TV+.
Understandable dialogue on Apple TV+
On-device app controlling AI.
Access to ChatGPT with a guest appearance by Chief Data Thief Sam Altman!
App Locking! iPhone Mirroring! And a Calculator!!
UI5con 2024 - Keynote: Latest News about UI5 and it’s EcosystemPeter Muessig
Learn about the latest innovations in and around OpenUI5/SAPUI5: UI5 Tooling, UI5 linter, UI5 Web Components, Web Components Integration, UI5 2.x, UI5 GenAI.
Recording:
https://www.youtube.com/live/MSdGLG2zLy8?si=INxBHTqkwHhxV5Ta&t=0
8 Best Automated Android App Testing Tool and Framework in 2024.pdfkalichargn70th171
Regarding mobile operating systems, two major players dominate our thoughts: Android and iPhone. With Android leading the market, software development companies are focused on delivering apps compatible with this OS. Ensuring an app's functionality across various Android devices, OS versions, and hardware specifications is critical, making Android app testing essential.
Mobile app Development Services | Drona InfotechDrona Infotech
Drona Infotech is one of the Best Mobile App Development Company In Noida Maintenance and ongoing support. mobile app development Services can help you maintain and support your app after it has been launched. This includes fixing bugs, adding new features, and keeping your app up-to-date with the latest
Visit Us For :
E-commerce Development Services- Hornet DynamicsHornet Dynamics
For any business hoping to succeed in the digital age, having a strong online presence is crucial. We offer Ecommerce Development Services that are customized according to your business requirements and client preferences, enabling you to create a dynamic, safe, and user-friendly online store.
UI5con 2024 - Bring Your Own Design SystemPeter Muessig
How do you combine the OpenUI5/SAPUI5 programming model with a design system that makes its controls available as Web Components? Since OpenUI5/SAPUI5 1.120, the framework supports the integration of any Web Components. This makes it possible, for example, to natively embed own Web Components of your design system which are created with Stencil. The integration embeds the Web Components in a way that they can be used naturally in XMLViews, like with standard UI5 controls, and can be bound with data binding. Learn how you can also make use of the Web Components base class in OpenUI5/SAPUI5 to also integrate your Web Components and get inspired by the solution to generate a custom UI5 library providing the Web Components control wrappers for the native ones.
Artificia Intellicence and XPath Extension FunctionsOctavian Nadolu
The purpose of this presentation is to provide an overview of how you can use AI from XSLT, XQuery, Schematron, or XML Refactoring operations, the potential benefits of using AI, and some of the challenges we face.
Top 9 Trends in Cybersecurity for 2024.pptxdevvsandy
Security and risk management (SRM) leaders face disruptions on technological, organizational, and human fronts. Preparation and pragmatic execution are key for dealing with these disruptions and providing the right cybersecurity program.
Flutter is a popular open source, cross-platform framework developed by Google. In this webinar we'll explore Flutter and its architecture, delve into the Flutter Embedder and Flutter’s Dart language, discover how to leverage Flutter for embedded device development, learn about Automotive Grade Linux (AGL) and its consortium and understand the rationale behind AGL's choice of Flutter for next-gen IVI systems. Don’t miss this opportunity to discover whether Flutter is right for your project.
Microservice Teams - How the cloud changes the way we workSven Peters
A lot of technical challenges and complexity come with building a cloud-native and distributed architecture. The way we develop backend software has fundamentally changed in the last ten years. Managing a microservices architecture demands a lot of us to ensure observability and operational resiliency. But did you also change the way you run your development teams?
Sven will talk about Atlassian’s journey from a monolith to a multi-tenanted architecture and how it affected the way the engineering teams work. You will learn how we shifted to service ownership, moved to more autonomous teams (and its challenges), and established platform and enablement teams.
Using Query Store in Azure PostgreSQL to Understand Query PerformanceGrant Fritchey
Microsoft has added an excellent new extension in PostgreSQL on their Azure Platform. This session, presented at Posette 2024, covers what Query Store is and the types of information you can get out of it.
Most important New features of Oracle 23c for DBAs and Developers. You can get more idea from my youtube channel video from https://youtu.be/XvL5WtaC20A
10. Functions are First Class citizens
○ The ability to treat functions as values
○ The ability to pass those values into other functions
○ Being able to write small snippets of code as anonymous functions
○ Not having to create deep hierarchies of classes (that sometimes feel “artifical”)
○ Most FP languages are “low ceremony” languages, meaning that they require less
boilerplate code than other languages
19. Pure functions are easier to reason about
First, pure functions are easier to reason about because you know that they can’t do certain things, such as talk to the
outside world, have hidden inputs, or modify hidden state. Because of this, you’re guaranteed that their function signatures
tell you (a) exactly what’s going into each function, and (b) coming out of each function.
In his book, Clean Code (affiliate link), Robert Martin writes:
“The ratio of time spent reading (code) versus writing is well over 10 to 1 ... (therefore) making it
easy to read makes it easier to write.”
I suspect that this ratio is lower with FP. Because pure functions are easier to reason about:
● I spend less time “reading” them.
● I can keep fewer details in my brain for every function that I read.
This is what functional programmers refer to as “a higher level of abstraction.”
20. Dishonest function (1)
function x() { … }
que fait - elle ?
https://enterprisecraftsmanship.com/posts/what-is-functional-programming/
21. Dishonest function (2): referentially
transparent.
A referentially transparent function always produces the same result as long as you supply it the same
arguments. It means that such function should operate only the values we pass in, it shouldn’t refer to the global
state.
Here’s an example:
public long TicksElapsedFrom(int year)
{
DateTime now = DateTime.Now;
DateTime then = new DateTime(year, 1, 1);
return (now - then).Ticks;
}
22. Dishonest function (2): referentially
transparent.
public long TicksElapsedFrom(int year)
{
DateTime now = DateTime.Now;
DateTime then = new DateTime(year, 1, 1);
return (now - then).Ticks;
}
This method is not referentially transparent because it returns different results even if we pass it the
same year. The reason here is that it refers to the global DatetTime.Now property.
23. Dishonest function (2): referentially
transparent.
A referentially transparent alternative for this method would be:
public long TicksElapsedFrom(int year, DateTime now)
{
DateTime then = new DateTime(year, 1, 1);
return (now - then).Ticks;
}
24. Dishonest function (3): method signature
honesty.
public int Divide(int x, int y)
{
return x / y;
}
The Divide method, despite being referentially transparent, is not a mathematical function. Its signature
states that it accepts any two integers and returns another integer. But what happens if we pass it 1 and
0 as input parameters?
25. Dishonest function (3): method signature
honesty.
public int Divide(int x, int y)
{
return x / y;
}
S
SOLUTION ???
26. Dishonest function (3): method signature
honesty.
public static int Divide(int x, NonZeroInteger y)
{
return x / y.Value;
}
27. Dishonest function (3): method signature
honesty.
public static int ? Divide(int x, int y)
{
if (y == 0)
return null;
return x / y;
}
This version is also honest as it now doesn’t guarantee that it will return an integer for any possible
combination of input values.
28. Dishonest function (4): exceptions
Exceptions
Exceptions is another source of dishonesty for your code base. Methods that employ exceptions to
control the program flow are not mathematical functions because, just like side effects, exceptions hide
the actual outcome of the operation the method performs.
Moreover, exceptions have a goto semantics meaning that they allow you to easily jump from any point
of your program to a catch block. In fact, exceptions perform even worse because the goto statement
doesn’t allow for jumping outside a particular method, whereas with exceptions you can cross multiple
layers in your code base with ease.
29. Dishonest function (4): exceptions
Because functional programming is like algebra, there are no null values or exceptions. But of course you can still have
exceptions when you try to access servers that are down or files that are missing, so what can you do?
Option/Some/None
Try/Success/Failure
def toInt(s: String): Option[Int] = {
try {
Some(Integer.parseInt(s.trim))
} catch {
case e: Exception => None
}
def toInt(s: String): Try[Int] = Try {
Integer.parseInt(s.trim)
}
toInt(x) match {
case Success(i) => println(i)
case Failure(s) => println(s"Failed. Reason: $s")
}
31. Dishonest function (5): effets de bord
The first such practice is avoiding side effects as much as possible by employing immutability all over your code base. This
technique is important because the act of mutating state contradicts the functional principles.
The signature of a method with a side effect doesn’t communicate enough information about what the actual result of the
operation is, and that hinders our ability to reason about it. In order to validate your assumptions regarding the code you
are writing, not only do you have to look at the method’s signature itself, but you also need to fall down to its
implementation details and see if this method leaves any side effects that you didn’t expect.
32. Dishonest function (5): effets de bord
Overall, code with data structures that change over time is harder to debug and is more error-prone. It brings even more
problems in multi-threaded applications where you can have all sorts of nasty race conditions.
When you operate immutable data only, you force yourself to reveal hidden side effects by stating them in the method’s
signature and thus making it honest. This makes the code more readable because you don’t have to fall down to the
methods' implementation details in order to reason about the program flow. With immutable classes, you can just look at
the signature of a method and get a good understanding of what is going on right away, without too much effort.
33. Avoid nulls
Another practice in this list is avoiding nulls. It turns out that the use of nulls makes your code dishonest
as the signature of the methods using them doesn’t tell all information about the possible outcome the
corresponding operation may have.
34.
35.
36.
37.
38. Testing is easier, and pure functions lend
themselves well to techniques like property-
based testing
https://alvinalexander.com/scala/fp-book/benefits-of-functional-programming/#testing-is-easier-and-pure-
functions-lend-themselves-well-to-techniques-like-property-based-testing
42. Quelles différences?
On the scale of abstraction, the Turing Machine sits at one end, where Lambda
Calculus sits at the other.
Two extremes, yet with lots in common:
there is no problem one can solve that the other one cannot.
https://www.eonics.nl/story/functional-programming-part-1-historical-context/
43. Avantages
1. Pure functions are easier to reason about
2. Testing is easier, and pure functions lend themselves well to techniques like property-
based testing
3. Debugging is easier
4. Programs are more bulletproof
5. Programs are written at a higher level, and are therefore easier to comprehend
6. Function signatures are more meaningful
7. Parallel/concurrent programming is easier
44. Take away
● Paramètres de fonction plutôt que données globales (même de classe)
● Créer des objets plutôt que de les modifier (immutable)
● Option plutôt que ‘null’
● Option / Try / Either / Result ... (monads) plutôt qu’une exception
● Collection API / récursivité plutôt que boucles for/while
● Eviter les ‘if’ autant que possible
● Séparation technique / métier
● Functionnal core / Imperative shell
https://www.slideshare.net/loicknuchel/comprendre-la-programmation-fonctionnelle-blend-web-mix-le-02112016/60