The document discusses the author's experience with optional types in software design. It describes the author's shifting views on types over their career from enthusiast to professional to advocate for optional types. The author details how optional types can lead to cleaner, smaller code that is easier to change and requires fewer tests. Deep questions are also posed about the cognitive costs of abstractions, whether strong typing enables strong coupling, and how important names and contracts are in minimalist design. The conclusion is that minimalism exerts positive pressure on design through smaller code, better names, clear responsibilities and contracts, and clear tests.
JavaScript Roadmap - The Basics event presentation covers:
- JavaScript Applications
- History of JavaScript
- Basics of JavaScript programming
- Announcements from Codecademy JU chapter
One of the main reasons Titanium Mobile has been so successful is that the technology has significantly lowered the barrier to entry for native mobile development. A major force behind this is JavaScript, Titanium's primary programming language. The JavaScript programming language is small enough where the basics can be learned in a matter of hours, which has enabled developers from many different backgrounds to become productive using Titanium. But there's much more to JavaScript than just control structures and a handful of primitive data types - JavaScript is a beautiful functional programming language with great features you might not be using.
Most developers working on the web today have had some exposure to JavaScript, but there's a difference between using jQuery for DOM manipulation on a web page and writing an entire application in JavaScript. This talk, intended for beginner or intermediate JavaScript developers, will focus on the essential language features you will need to write professional JavaScript applications, including but not limited to:
Object Oriented Programming in JavaScript
The Good Parts and Bad Parts of JavaScript
Useful JavaScript Patterns, Tricks, and Style Guidelines
The JavaScript runtime in Titanium Mobile
Further Reading and ways to stay up to date on JavaScript
In this whitepaper, LearnItFirst founder Scott Whigham talks about how you can become a good (or better) C# programmer. This whitepaper is long - 15 pages - but it includes both a step-by-step system to follow as well as an in-depth discussion of each step.
If you follow this 13-step system (with a bonus 14th step), you can’t help but become a good C# developer!
We will cover whole of the web development basics comprising of HTML, CSS, JavaScript in this series.
Following are topics useful for any newbie to intermediate who is interested in learning Web Development
JavaScript Roadmap - The Basics event presentation covers:
- JavaScript Applications
- History of JavaScript
- Basics of JavaScript programming
- Announcements from Codecademy JU chapter
One of the main reasons Titanium Mobile has been so successful is that the technology has significantly lowered the barrier to entry for native mobile development. A major force behind this is JavaScript, Titanium's primary programming language. The JavaScript programming language is small enough where the basics can be learned in a matter of hours, which has enabled developers from many different backgrounds to become productive using Titanium. But there's much more to JavaScript than just control structures and a handful of primitive data types - JavaScript is a beautiful functional programming language with great features you might not be using.
Most developers working on the web today have had some exposure to JavaScript, but there's a difference between using jQuery for DOM manipulation on a web page and writing an entire application in JavaScript. This talk, intended for beginner or intermediate JavaScript developers, will focus on the essential language features you will need to write professional JavaScript applications, including but not limited to:
Object Oriented Programming in JavaScript
The Good Parts and Bad Parts of JavaScript
Useful JavaScript Patterns, Tricks, and Style Guidelines
The JavaScript runtime in Titanium Mobile
Further Reading and ways to stay up to date on JavaScript
In this whitepaper, LearnItFirst founder Scott Whigham talks about how you can become a good (or better) C# programmer. This whitepaper is long - 15 pages - but it includes both a step-by-step system to follow as well as an in-depth discussion of each step.
If you follow this 13-step system (with a bonus 14th step), you can’t help but become a good C# developer!
We will cover whole of the web development basics comprising of HTML, CSS, JavaScript in this series.
Following are topics useful for any newbie to intermediate who is interested in learning Web Development
What is JavaScript?
JavaScript is a very powerful client-side scripting language. JavaScript is used mainly for enhancing the interaction of a user with the webpage. In other words, you can make your webpage more lively and interactive, with the help of JavaScript. JavaScript is also being used widely in game development and Mobile application development.
TypeScript is a super set of JavaScript. This slide covers the key features of TypeScript including basics of typescript, basic types, Interfaces, Functions, Classes, Generics, Modules.
We will cover whole of the web development basics comprising of HTML, CSS, JavaScript in this series.
Following are topics useful for any newbie to intermediate who is interested in learning Web Development
How to JavaOne 2016 - Generate Customized Java 8 Code from Your Database [TUT...Malin Weiss
The best code is the one you never need to write. Using code generation and automated builds, you can minimize the risk of human error when developing software, but how do you maintain control over code when large parts of it are handed over to a machine? In this tutorial, you will learn how to use open source software to create and control code automation. You will see how you can generate a completely object-oriented domain model by automatically analyzing your database schemas. Every aspect of the process is transparent and configurable, giving you, as a developer, 100 percent control of the generated code. This will not only increase your productivity but also help you build safer, more maintainable Java applications and is a perfect solution for Microservices.
We will cover whole of the web development basics comprising of HTML, CSS, JavaScript in this series.
Following are topics useful for any newbie to intermediate who is interested in learning Web Development
Beyond JavaScript Frameworks: Writing Reliable Web Apps With Elm - Erik Wende...Codemotion
In times where a jungle of JavaScript frameworks wants to solve every conceivable problem in web app development, Elm offers a different approach. Elm is a functional language that compiles to JavaScript. It has a user-friendly compiler, a sound type system, built-in immutability and lots of other features that come in handy when developing large, hopefully bug-free, single-page apps. While having fun in the process! In this talk you'll see how Elm works and learn how to use it to build a web app. More importantly, you'll learn the pros and cons of using it over a JavaScript-based solution.
The first deck of a two part learning deck about TypeScript.
Here you can view a first introduction to the language and some attention call for some of TypeScript detailes.
We will cover whole of the web development basics comprising of HTML, CSS, JavaScript in this series.
Following are topics useful for any newbie to intermediate who is interested in learning Web Development
Алексей Ященко и Ярослав Волощук "False simplicity of front-end applications"Fwdays
It’s easy to underestimate a front-end project's complexity, which leads to shallow and thus incorrect implementation. Attempts to fix this problem result in uncontrolled complexity growth and undefined behavior in corner cases.
We'll discuss ways of revealing the inherent complexity of a problem and dealing with it both on theoretical and practical levels.
What is JavaScript?
JavaScript is a very powerful client-side scripting language. JavaScript is used mainly for enhancing the interaction of a user with the webpage. In other words, you can make your webpage more lively and interactive, with the help of JavaScript. JavaScript is also being used widely in game development and Mobile application development.
TypeScript is a super set of JavaScript. This slide covers the key features of TypeScript including basics of typescript, basic types, Interfaces, Functions, Classes, Generics, Modules.
We will cover whole of the web development basics comprising of HTML, CSS, JavaScript in this series.
Following are topics useful for any newbie to intermediate who is interested in learning Web Development
How to JavaOne 2016 - Generate Customized Java 8 Code from Your Database [TUT...Malin Weiss
The best code is the one you never need to write. Using code generation and automated builds, you can minimize the risk of human error when developing software, but how do you maintain control over code when large parts of it are handed over to a machine? In this tutorial, you will learn how to use open source software to create and control code automation. You will see how you can generate a completely object-oriented domain model by automatically analyzing your database schemas. Every aspect of the process is transparent and configurable, giving you, as a developer, 100 percent control of the generated code. This will not only increase your productivity but also help you build safer, more maintainable Java applications and is a perfect solution for Microservices.
We will cover whole of the web development basics comprising of HTML, CSS, JavaScript in this series.
Following are topics useful for any newbie to intermediate who is interested in learning Web Development
Beyond JavaScript Frameworks: Writing Reliable Web Apps With Elm - Erik Wende...Codemotion
In times where a jungle of JavaScript frameworks wants to solve every conceivable problem in web app development, Elm offers a different approach. Elm is a functional language that compiles to JavaScript. It has a user-friendly compiler, a sound type system, built-in immutability and lots of other features that come in handy when developing large, hopefully bug-free, single-page apps. While having fun in the process! In this talk you'll see how Elm works and learn how to use it to build a web app. More importantly, you'll learn the pros and cons of using it over a JavaScript-based solution.
The first deck of a two part learning deck about TypeScript.
Here you can view a first introduction to the language and some attention call for some of TypeScript detailes.
We will cover whole of the web development basics comprising of HTML, CSS, JavaScript in this series.
Following are topics useful for any newbie to intermediate who is interested in learning Web Development
Алексей Ященко и Ярослав Волощук "False simplicity of front-end applications"Fwdays
It’s easy to underestimate a front-end project's complexity, which leads to shallow and thus incorrect implementation. Attempts to fix this problem result in uncontrolled complexity growth and undefined behavior in corner cases.
We'll discuss ways of revealing the inherent complexity of a problem and dealing with it both on theoretical and practical levels.
The natural way to develop software is to start with requirements - the expected behavior - of the system. We work our way through design to implementation and somewhere in there we write tests. Unit testing focuses on implementation, even if you write the tests first. Behavior-Driven Development lets you write the expected behavior in a testable format so that you can develop software outside-in, in a natural manner.
Maintaining the product is one (if not the most) expensive area of the overall product costs. Writing clean code can significantly lower these costs, making it more efficient during the initial development and results in more stable code. In this session participants will learn how to apply C# techniques in order to improve the efficiency, readability, testability and extensibility of code.
An overview of the Django rapid application development framework. Topics include the history of the framework, an architectural overview, how to get started, and a brief comparison to Ruby on Rails.
Getting started with Appcelerator TitaniumTechday7
Techday7, Cross platform application development using Appcelerator Titanium event's Getting started with Appcelerator Titanium By Naga Harish M, Lead Developer of Anubavam Technologies
Existing methods for refactoring legacy code are either unsafe, or slow and require a lot of rare skills. I'm proposing a new method composed of three steps: refactor to pure functions, write tests for the pure functions, and refactor the pure functions to classes or something else. I believe that with a few mechanical steps a trained developer can safely refactor legacy code faster using this method.
A talk from CppEurope 2019 about functional programming in C++.
It talks about lambdas, immutability, operations with functions (partial application, currying, functional composition), shows an example and ends with a procedure for refactoring legacy code.
What can we learn from other design disciplines? How do they learn design? What can we copy from them?
This is a challenge for software developers to start thinking as code designers, as people who use code as a material to prototype solutions to problems.
What is good software design? Why does it matter?
In this keynote, I addressed this complex problem. Going from the history of programming, through analogies with other design disciplines, ending with conclusions on what is good software design, and how to become a better designer.
Slides for a workshop on agile technical leadership.
Agile teams are complex adaptive systems. In order to obtain a certain level of consistency, required when you want effective teams, teams have to set constraints on themselves and to make strategic decisions. This workshop explores some of the constraints and the difficulties of making strategic technical decisions.
One of the difficulties of developers starting to apply Test Driven Development (TDD) is letting go of preconceived notions of design and allowing themselves to evolve it. I have successfully used TDD As If You Meant It as a way of showcasing how design grows when doing TDD. TDD As If You Meant It is a set of constraints created by Keith Braithwaite that forces developers to let go of their set blueprints and allow the design to evolve. I've noticed in code retreats and dojos that the technique is very difficult to get right. In this session, I will explain the core technique, the value of the technique and what I've learned by applying it and by helping others applying it.
How to identify, when to remove and how to remove a common pattern in code: duplication that can be refactored towards loops and more complex data structures. Also with code examples.
Docker is a tool that didn't exist 2 years ago. Yet I am convinced that we will hear about it for a long time. We will almost certainly use containers to test and deploy our applications.
This talk is about the reasons to start using docker in your daily work as a programmer, tester, sysadmin or IT professional.
As a programmer, you are wondering what it takes to grow your career in a fast-changing environment. This talk is about a path for your career growth.
As a manager you are wondering how you can optimize your software development teams. This talk is about a model to use for a rough evaluation and improvement of your teams.
As a business owner, CEO or CTO, your primary request for development teams is to quickly add features. This talk is about a model for optimizing implementation time.
The pyramid of programming skillsets is a model based on the usefulness of programming skills when changing code fast is the most important business objective. Let’s explore five skillset levels I identified when working with teams of programmers around Europe. We will discuss each level and how to move from one level to another.
We've been discussing software craftsmanship for years. But does it match the realities of a business? How?
This is a story about applying the ideas and practices of software craftsmanship for a real project in a difficult context. The conclusion? It helped us, it might help you as well.
How can you advance your career as a software developer? How can you assess your team as a team leader / technical lead / manager?
I created a simple model to answer these questions based upon the most common need in modern software applications: the need to add features fast.
All models are wrong, but some are useful. I found this model useful and I hope you will too.
An introduction to Kanban I presented with Flavius Stef at the Bucharest Agile Meetup Group in February 2014. See the event details on http://www.meetup.com/The-Bucharest-Agile-Software-Meetup-Group/events/146222892/. See http://mozaicworks.com for articles and events about Kanban and agile
This talk answers questions asked about unit testing by attendees at ALE 2013.
It was created in two hours, starting from an open space session where we gathered the questions.
Understanding Nidhi Software Pricing: A Quick Guide 🌟
Choosing the right software is vital for Nidhi companies to streamline operations. Our latest presentation covers Nidhi software pricing, key factors, costs, and negotiation tips.
📊 What You’ll Learn:
Key factors influencing Nidhi software price
Understanding the true cost beyond the initial price
Tips for negotiating the best deal
Affordable and customizable pricing options with Vector Nidhi Software
🔗 Learn more at: www.vectornidhisoftware.com/software-for-nidhi-company/
#NidhiSoftwarePrice #NidhiSoftware #VectorNidhi
GraphSummit Paris - The art of the possible with Graph TechnologyNeo4j
Sudhir Hasbe, Chief Product Officer, Neo4j
Join us as we explore breakthrough innovations enabled by interconnected data and AI. Discover firsthand how organizations use relationships in data to uncover contextual insights and solve our most pressing challenges – from optimizing supply chains, detecting fraud, and improving customer experiences to accelerating drug discoveries.
Code reviews are vital for ensuring good code quality. They serve as one of our last lines of defense against bugs and subpar code reaching production.
Yet, they often turn into annoying tasks riddled with frustration, hostility, unclear feedback and lack of standards. How can we improve this crucial process?
In this session we will cover:
- The Art of Effective Code Reviews
- Streamlining the Review Process
- Elevating Reviews with Automated Tools
By the end of this presentation, you'll have the knowledge on how to organize and improve your code review proces
First Steps with Globus Compute Multi-User EndpointsGlobus
In this presentation we will share our experiences around getting started with the Globus Compute multi-user endpoint. Working with the Pharmacology group at the University of Auckland, we have previously written an application using Globus Compute that can offload computationally expensive steps in the researcher's workflows, which they wish to manage from their familiar Windows environments, onto the NeSI (New Zealand eScience Infrastructure) cluster. Some of the challenges we have encountered were that each researcher had to set up and manage their own single-user globus compute endpoint and that the workloads had varying resource requirements (CPUs, memory and wall time) between different runs. We hope that the multi-user endpoint will help to address these challenges and share an update on our progress here.
Check out the webinar slides to learn more about how XfilesPro transforms Salesforce document management by leveraging its world-class applications. For more details, please connect with sales@xfilespro.com
If you want to watch the on-demand webinar, please click here: https://www.xfilespro.com/webinars/salesforce-document-management-2-0-smarter-faster-better/
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...Globus
The Earth System Grid Federation (ESGF) is a global network of data servers that archives and distributes the planet’s largest collection of Earth system model output for thousands of climate and environmental scientists worldwide. Many of these petabyte-scale data archives are located in proximity to large high-performance computing (HPC) or cloud computing resources, but the primary workflow for data users consists of transferring data, and applying computations on a different system. As a part of the ESGF 2.0 US project (funded by the United States Department of Energy Office of Science), we developed pre-defined data workflows, which can be run on-demand, capable of applying many data reduction and data analysis to the large ESGF data archives, transferring only the resultant analysis (ex. visualizations, smaller data files). In this talk, we will showcase a few of these workflows, highlighting how Globus Flows can be used for petabyte-scale climate analysis.
A Study of Variable-Role-based Feature Enrichment in Neural Models of CodeAftab Hussain
Understanding variable roles in code has been found to be helpful by students
in learning programming -- could variable roles help deep neural models in
performing coding tasks? We do an exploratory study.
- These are slides of the talk given at InteNSE'23: The 1st International Workshop on Interpretability and Robustness in Neural Software Engineering, co-located with the 45th International Conference on Software Engineering, ICSE 2023, Melbourne Australia
Quarkus Hidden and Forbidden ExtensionsMax Andersen
Quarkus has a vast extension ecosystem and is known for its subsonic and subatomic feature set. Some of these features are not as well known, and some extensions are less talked about, but that does not make them less interesting - quite the opposite.
Come join this talk to see some tips and tricks for using Quarkus and some of the lesser known features, extensions and development techniques.
Atelier - Innover avec l’IA Générative et les graphes de connaissancesNeo4j
Atelier - Innover avec l’IA Générative et les graphes de connaissances
Allez au-delà du battage médiatique autour de l’IA et découvrez des techniques pratiques pour utiliser l’IA de manière responsable à travers les données de votre organisation. Explorez comment utiliser les graphes de connaissances pour augmenter la précision, la transparence et la capacité d’explication dans les systèmes d’IA générative. Vous partirez avec une expérience pratique combinant les relations entre les données et les LLM pour apporter du contexte spécifique à votre domaine et améliorer votre raisonnement.
Amenez votre ordinateur portable et nous vous guiderons sur la mise en place de votre propre pile d’IA générative, en vous fournissant des exemples pratiques et codés pour démarrer en quelques minutes.
Need for Speed: Removing speed bumps from your Symfony projects ⚡️Łukasz Chruściel
No one wants their application to drag like a car stuck in the slow lane! Yet it’s all too common to encounter bumpy, pothole-filled solutions that slow the speed of any application. Symfony apps are not an exception.
In this talk, I will take you for a spin around the performance racetrack. We’ll explore common pitfalls - those hidden potholes on your application that can cause unexpected slowdowns. Learn how to spot these performance bumps early, and more importantly, how to navigate around them to keep your application running at top speed.
We will focus in particular on tuning your engine at the application level, making the right adjustments to ensure that your system responds like a well-oiled, high-performance race car.
Providing Globus Services to Users of JASMIN for Environmental Data AnalysisGlobus
JASMIN is the UK’s high-performance data analysis platform for environmental science, operated by STFC on behalf of the UK Natural Environment Research Council (NERC). In addition to its role in hosting the CEDA Archive (NERC’s long-term repository for climate, atmospheric science & Earth observation data in the UK), JASMIN provides a collaborative platform to a community of around 2,000 scientists in the UK and beyond, providing nearly 400 environmental science projects with working space, compute resources and tools to facilitate their work. High-performance data transfer into and out of JASMIN has always been a key feature, with many scientists bringing model outputs from supercomputers elsewhere in the UK, to analyse against observational or other model data in the CEDA Archive. A growing number of JASMIN users are now realising the benefits of using the Globus service to provide reliable and efficient data movement and other tasks in this and other contexts. Further use cases involve long-distance (intercontinental) transfers to and from JASMIN, and collecting results from a mobile atmospheric radar system, pushing data to JASMIN via a lightweight Globus deployment. We provide details of how Globus fits into our current infrastructure, our experience of the recent migration to GCSv5.4, and of our interest in developing use of the wider ecosystem of Globus services for the benefit of our user community.
Navigating the Metaverse: A Journey into Virtual Evolution"Donna Lenk
Join us for an exploration of the Metaverse's evolution, where innovation meets imagination. Discover new dimensions of virtual events, engage with thought-provoking discussions, and witness the transformative power of digital realms."
OpenMetadata Community Meeting - 5th June 2024OpenMetadata
The OpenMetadata Community Meeting was held on June 5th, 2024. In this meeting, we discussed about the data quality capabilities that are integrated with the Incident Manager, providing a complete solution to handle your data observability needs. Watch the end-to-end demo of the data quality features.
* How to run your own data quality framework
* What is the performance impact of running data quality frameworks
* How to run the test cases in your own ETL pipelines
* How the Incident Manager is integrated
* Get notified with alerts when test cases fail
Watch the meeting recording here - https://www.youtube.com/watch?v=UbNOje0kf6E
Unleash Unlimited Potential with One-Time Purchase
BoxLang is more than just a language; it's a community. By choosing a Visionary License, you're not just investing in your success, you're actively contributing to the ongoing development and support of BoxLang.
We describe the deployment and use of Globus Compute for remote computation. This content is aimed at researchers who wish to compute on remote resources using a unified programming interface, as well as system administrators who will deploy and operate Globus Compute services on their research computing infrastructure.
Globus Compute wth IRI Workflows - GlobusWorld 2024Globus
As part of the DOE Integrated Research Infrastructure (IRI) program, NERSC at Lawrence Berkeley National Lab and ALCF at Argonne National Lab are working closely with General Atomics on accelerating the computing requirements of the DIII-D experiment. As part of the work the team is investigating ways to speedup the time to solution for many different parts of the DIII-D workflow including how they run jobs on HPC systems. One of these routes is looking at Globus Compute as a way to replace the current method for managing tasks and we describe a brief proof of concept showing how Globus Compute could help to schedule jobs and be a tool to connect compute at different facilities.
Do you want Software for your Business? Visit Deuglo
Deuglo has top Software Developers in India. They are experts in software development and help design and create custom Software solutions.
Deuglo follows seven steps methods for delivering their services to their customers. They called it the Software development life cycle process (SDLC).
Requirement — Collecting the Requirements is the first Phase in the SSLC process.
Feasibility Study — after completing the requirement process they move to the design phase.
Design — in this phase, they start designing the software.
Coding — when designing is completed, the developers start coding for the software.
Testing — in this phase when the coding of the software is done the testing team will start testing.
Installation — after completion of testing, the application opens to the live server and launches!
Maintenance — after completing the software development, customers start using the software.
15. Personal History
Code Designer (40 - now)
• what can I use to solve problems as quickly as possible?
Stance on types: optional types have distinct advantages
17. Minimalism in Code - Reasoning
• Custom code is expensive: to build, to test, to change, to refine until it
works, to run, to maintain
• The more lines of code, the higher the probability to have bugs
• Less code => smaller cognitive pressure
19. Rules
• Type not specified unless it’s important
• No casting
• No thinking about the types used, only about their capabilities
20. What I’ve expected
• bugs
• weird problems
• need to write more tests
• code that’s more difficult to understand
21. What I’ve got from optional types
• cleaner & smaller code
• easier to change
• fewer tests than I expected
• fewer bugs than I expected
NB: Some things were enabled by the language (groovy + grails), others are
strongly related to the idea of optional types
22. Project
• eventrix.co
• web platform for conference organizers
• groovy on grails (JVM language)
Not perfect!
• too much custom code - learned the hard way
23. Cleaner and smaller code
// Typical Java version
User user = new User(); // Duplication: 3 * User + ';'!!!
var user = new User(); // Optional type: 2 * User + ';'
// Groovy version
def user = new User() // 2 * User
// GORM
def user = User.get(userId)
24. Cleaner and smaller code
// Functional programming
// C++ lambda
auto increment = [](int value){ return first + 1;};
// C++ lambda with optional type
auto increment = [](auto value){ return first + 1;};
25. Cleaner and smaller code
// Functional programming
// C++ lambda
auto increment = [](int value){ return first + 1;};
// C++ lambda with optional type
auto increment = [](auto value){ return first + 1;};
// Simplest Groovy lambda
def increment = {it + 1} // optional type
// also some magic: what is 'it'?
26. Cleaner and smaller code
// C++ get list of names of users
auto names = transform(
users.begin(), users.end(),
[](auto user){ return user.getName(); }
);
27. Cleaner and smaller code
// C++ get list of names of users
auto names = transform(
users.begin(), users.end(),
[](auto user){ return user.getName(); }
);
// groovy get list of names of users
def names = users*.name
28. Cleaner and smaller code
// Do the same, assuming User class has firstName and lastName
// C++
auto names = transform(users.begin(), users.end(),
[](auto user){
return user.getFirstName()
+ ” ”
+ users.getLastName();
}
);
29. Cleaner and smaller code
// Do the same, assuming User class has firstName and lastName
// C++
auto names = transform(users.begin(), users.end(),
[](auto user){
return user.getFirstName()
+ ” ”
+ users.getLastName();
}
);
// groovy
def names = users.collect{it.firstName + ” ” + it.lastName}
30. A taste of optional types
• Tests using Spock
• Query
• Controller
• Command
36. Strong Coupling
What if I change the type from int to UserID?
(e.g. my company buys another company and we need to merge the systems)
• change User
• change UserDbService
• and change everywhere where int userId is used
37. Optional Type => looser coupling
class UserDbService {
boolean confirmEmail(userId) {
def user = User.get(userId)
user.emailConfirmed = true
user.save()
}
...
}
class User{
int userId;
...
}
38. Q3: How Important Are Names?
// a design pattern we use for
// transactional classes that
// interact with database
class UserDbService {
def confirmEmail(userId) {
def user = User.get(userId)
user.emailConfirmed = true
user.save()
}
...
}
39. Q4: How Important Are Contracts?
TEST_CASE(”X wins”){
Board board = {
{'X', 'X', 'X'},
{' ', 'O', ' '},
{' ', ' ', 'O'}
};
CHECK(xWins(board));
}
40. Let’s see the code!
Contract: Coordinates have two values
42. Beyond Types: Design Entities
We use clear, well defined design entities:
• Model: class defining the entity structure and mapping to database
43. Beyond Types: Design Entities
We use clear, well defined design entities:
• Model: class defining the entity structure and mapping to database
• Query: class that encapsulates database queries
44. Beyond Types: Design Entities
We use clear, well defined design entities:
• Model: class defining the entity structure and mapping to database
• Query: class that encapsulates database queries
• DbCommand: class that saves data to the database
45. Beyond Types: Design Entities
We use clear, well defined design entities:
• Model: class defining the entity structure and mapping to database
• Query: class that encapsulates database queries
• DbCommand: class that saves data to the database
• DbService: class that is called by Command or BusinessService to
make multiple operations in the database, usually with the help of
DbCommands
46. Beyond Types: Design Entities
We use clear, well defined design entities:
• Model: class defining the entity structure and mapping to database
• Query: class that encapsulates database queries
• DbCommand: class that saves data to the database
• DbService: class that is called by Command or BusinessService to
make multiple operations in the database, usually with the help of
DbCommands
• BusinessService: class that is called by Command to facilitate a
business process
47. Beyond Types: Design Entities
We use clear, well defined design entities:
• Model: class defining the entity structure and mapping to database
• Query: class that encapsulates database queries
• DbCommand: class that saves data to the database
• DbService: class that is called by Command or BusinessService to
make multiple operations in the database, usually with the help of
DbCommands
• BusinessService: class that is called by Command to facilitate a
business process
• Command: class that is called by Controller to validate specific HTTP
requests and delegate to the right Services the execution.
49. Minimalism exerts a positive pressure on design
We still need to understand the code. Without types, how do we understand
it?
• smaller code
50. Minimalism exerts a positive pressure on design
We still need to understand the code. Without types, how do we understand
it?
• smaller code
• better names
51. Minimalism exerts a positive pressure on design
We still need to understand the code. Without types, how do we understand
it?
• smaller code
• better names
• clear responsibilities
52. Minimalism exerts a positive pressure on design
We still need to understand the code. Without types, how do we understand
it?
• smaller code
• better names
• clear responsibilities
• clear contracts
53. Minimalism exerts a positive pressure on design
We still need to understand the code. Without types, how do we understand
it?
• smaller code
• better names
• clear responsibilities
• clear contracts
• clear tests
54. Always Optional Types? NO
Clear problem domain, clear solution, not expecting change, used by
specialists => strong types, validation at compile time
Expecting change, evolving problem and solution domain => minimalism,
changeable code, fewer constraints
56. Let’s think differently!
“I want the compiler to do as much checking for me as possible”
vs.
“I want to write the code that makes sense, and the compiler / interpreter to
figure it out”