Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Agile Technical Practices Distilled

You're reading from   Agile Technical Practices Distilled A learning journey in technical practices and principles of software design

Arrow left icon
Product type Paperback
Published in Jun 2019
Publisher
ISBN-13 9781838980849
Length 442 pages
Edition 1st Edition
Concepts
Arrow right icon
Authors (3):
Arrow left icon
Marco Consolaro Marco Consolaro
Author Profile Icon Marco Consolaro
Marco Consolaro
Alessandro Di Gioia Alessandro Di Gioia
Author Profile Icon Alessandro Di Gioia
Alessandro Di Gioia
Pedro M. Santos Pedro M. Santos
Author Profile Icon Pedro M. Santos
Pedro M. Santos
Arrow right icon
View More author details
Toc

Table of Contents (31) Chapters Close

Preface 1. Section 1 FREE CHAPTER
2. Chapter 1 3. Chapter 2 4. Chapter 3 5. Chapter 4 6. Chapter 5 7. Section 2
8. Chapter 6 9. Chapter 7 10. Chapter 8 11. Chapter 9 12. Chapter 10 13. Section 3
14. Chapter 11 15. Chapter 12 16. Chapter 13 17. Chapter 14 18. Chapter 15 19. Section 4
20. Chapter 16 21. Chapter 17 22. Chapter 18 23. Chapter 19 24. Chapter 20 25. Chapter 21
26. Chapter 22 27. Chapter 23 28. License: CyberDojo
29. Sample Solutions
30. Feedback

Rules, Principles, and Values

To do your best is not enough. First you must know what to do, and then do your best.

– W. Edwards Deming

What is the difference between rules, principles, and values?

Here is what the dictionary says:

  • Rule: One of a set of explicit or understood regulations or principles governing conduct or a procedure within a particular area of activity. A principle that operates within a particular sphere of knowledge, describing or prescribing what is possible or allowable. A code of practice and discipline for a religious order or community.
  • Principle: A fundamental truth or proposition that serves as the foundation for a system of belief or behavior or for a chain of reasoning. A general scientific theorem or law that has numerous special applications across a wide field. A fundamental source or basis of something.
  • Value: The regard that something is held to deserve; the importance, worth, or usefulness of something. Principles or standards of behavior; one's judgment of what is important in life.

We live in a world with rules everywhere. On the road, at work, at school, or at the movies: we have to respect the rules of the environment we are in.

Sometimes, we are overwhelmed by the number of rules. Most of the time, we don't really even know the exact rules, yet we are able to behave correctly in (almost) any situation. That's because when rules follow common principles and values (which together make up common sense), it's pretty easy to work out the most important ones.

For example, you don't need to memorize the rules of the cinema to understand that if your phone rings in the middle of the show, it would annoy those around you. Or, you don't need to consciously remember the rule of the road that requires you to stop at the red light; you just know it's a very wise thing to do. That's because sensible rules are expressions of principles and values valid in a specific context. In the cinema, we want to be nice and let everybody enjoy the show, so we try not to be noisy. On the street, we want everybody to travel safely, so we respect the convention of traffic lights at crossing points.

How Rules Can Lead to Intellectual Laziness

We are so used to having rules to observe that many of us seem to be lost without them. Rules are obviously useful, but can unfortunately lead to a dangerous habit for a software developer: switching off critical thinking.

The main problem is that there are very few rules valid in any situation (the infamous silver bullet). Most rules are tightly bound to a context and, if the context changes, the rules might not be relevant anymore. Furthermore, the habit of following rules without questioning the context can lead in the long run to intellectual laziness. In this case, it seems easier to blindly follow some rules instead of working them out (based on principles and values) for the particular context.

Our profession is about instructing a machine to follow rules written in the form of coding. Critical thinking is one of the most relevant and hard-to-emulate qualities that define the difference between human beings and the artificial intelligence way of thinking. Switching off critical thinking only moves you steadily down the path of uselessness. If it were just about following rules, since robots are much better then us in doing that, they would have already filled all the programming jobs available.

Use Rules as a Shortcut to Internalize Principles

Nevertheless, we use rules as shortcut in order to practice and learn how to behave in a particular scenario. The final goal should never be an exercise of the mere memorization of rules. The ultimate achievement of practicing a ruleset is the internalization of the basic principles underlying them.

In the following lessons, we will introduce several rulesets for different contexts. Please don't force yourself to memorize them. If you don't remember something, open the page and consult the book as a reference. Try to work out the rules in your mind, starting from the principles. Experiment with different variations and evaluate the pros and cons of each outcome. Exercise until you understand and remember the principles, not the rules.

Once you master most of the principles we discuss here, something very cool might happen: you will find yourself more naturally predisposed to think about software design using a particular subset of those principles. Or, even more cool, you might want to find your very own principles, those that work and make sense for you, driving every single line of your code.

Either way, congratulations. That means you have started to build your own set of software design values.

In the first lessons of the book, we focus mostly on rules and then slowly move into principles and values. Be patient. Just imagine you are a young driver: in the beginning, you focus on following the rules, but once you are an experienced driver, you are able to extract your own rules from internalized principles and your core values.

Learn the rules like a pro, so you can break them like an artist.

– Pablo Picasso

How This Book Is Organized

The content we present is structured like a journey. As with every journey into a new environment, the beginning is slow and safe, but it is crucial for setting the stage for what comes next. The adventure then gains momentum as confidence grows, learning new subjects that introduce new techniques and principles to advance more steadily. Finally, in the final lessons, we demonstrate how the learned principles can be applied in several contexts, converging to allow the best solutions.

This is why we have divided the journey in four main sections:

  • First steps
  • Walking
  • Running
  • Flying

Each part is divided into several lessons with a common structure:

  • New principles: New concepts are added on top of the previous materials.
  • Katas: Exercises for you to spend some time practicing the new material.
  • Great habits: We build up a collection of good practices step by step.
  • Where we are in the big picture of OO software design?

    A bird's eye view of where the lesson practices belong in the world of software design. It relates lesson practices with other practices, rules, and principles.

  • When I should move to the next lesson?

    A few questions to help you decide whether you are ready to move on.

  • Resources: In case you want to go deeper into the material presented, the Resources sections provide web links and recommended books.

How to Get the Most out of This Book

To perform the katas, you will need access to a computer with your favorite development environment configured.

This book does not focus on any languages or tools in particular. We firmly believe that habits, principles, and values are the most crucial part of a developer's knowledge and that they are technologically agnostic. Hence, you are welcome to choose the ones that best suit you.

We have organized and presented the information in this book in a logical sequence. We strongly feel that practice and exercise are the fundamental resources needed for this journey. That's why you will find code challenges and katas at every lesson. They were selected to stimulate critical thinking about the subjects, leading you on a fun and pragmatic step-by-step learning path.

Mastery is applied knowledge, and even the most talented person can't skip practicing to reach it. Spend time going through the exercises to master the concepts and practices presented.

Caution

Our brain is addicted to information. Resist the urge to read this book without performing the exercises. Information per se is not very useful.

Programming is a skill best acquired by practice and example rather than from books.

– Alan Turing

Asking for Help or Feedback

If you want to get feedback or help from the community about the topics presented in this book, go to the book's community page at http://community.agiletechpraxis.com/.

Helping Others

Ideally, you should work on the exercises as a pair. Even better, have a journey companion. Either working on your own or with a pair, we strongly encourage you to join the community.

As soon as you feel confident, you can help others along the path. Help by answering questions and sharing your experience. Helping others is a great way to challenge your knowledge and internalize what you have learned!

Feedback about This Book

We would love to hear your feedback about this book:

  • What you liked?
  • What inspired you?
  • What you learned?
  • What we missed?
  • What we could have explained better?
  • What you disagree with?

We value your opinions and feelings about this work, and we will be always thankful if you decide to share them with us. You can go to Our Quick Feedback Form at http://www.agiletechpraxis.com/feedback or send us an email at info@agiletechpraxis.com.

Resources

Web

Books

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image