This document discusses the principles of "Object Calisthenics", which are nine rules of thumb for writing better object-oriented code. The rules focus on ideas like reducing indentation levels, avoiding else keywords, wrapping primitive types, keeping collections as first-class objects, limiting dots/arrows per line, avoiding abbreviations, keeping entities small, limiting instance variables per class, and avoiding getters/setters. Following these rules aims to improve code qualities like cohesion, loose coupling, readability and testability. The document provides examples of refactoring code according to these principles.
Lithium: The Framework for People Who Hate FrameworksNate Abele
This is the presentation was given at ConFoo on March 11th by Nate Abele and Joël Perras, and is an introduction to the architectural problems with other frameworks that Lithium was designed to address, and how it addresses them. It also introduces programming paradigms like functional and aspect-oriented programming which address issues that OOP doesn't account for.
Finally, the talk provides a quick overview of the innovative and unparalleled features that Lithium provides, including the data layer, which supports both relational and non-relational databases.
This talk is an overview of the history of the PHP language and major framework projects that have emerged in the last 5 years. It examines what we've learned in the development of these frameworks, how that education has been brought to bear in Lithium. Most of this talk ended up being me demoing and answering questions, so there's not a lot of content in the slides, sorry.
Can't Miss Features of PHP 5.3 and 5.4Jeff Carouth
If you're like me you remember the days of PHP3 and PHP4; you remember when PHP5 was released, and how it was touted to change to your life. It's still changing and there are some features of PHP 5.3 and new ones coming with PHP 5.4 that will improve your code readability and reusability. Let's look at some touted features such as closures, namespaces, and traits, as well as some features being discussed for future releases.
Lithium: The Framework for People Who Hate FrameworksNate Abele
This is the presentation was given at ConFoo on March 11th by Nate Abele and Joël Perras, and is an introduction to the architectural problems with other frameworks that Lithium was designed to address, and how it addresses them. It also introduces programming paradigms like functional and aspect-oriented programming which address issues that OOP doesn't account for.
Finally, the talk provides a quick overview of the innovative and unparalleled features that Lithium provides, including the data layer, which supports both relational and non-relational databases.
This talk is an overview of the history of the PHP language and major framework projects that have emerged in the last 5 years. It examines what we've learned in the development of these frameworks, how that education has been brought to bear in Lithium. Most of this talk ended up being me demoing and answering questions, so there's not a lot of content in the slides, sorry.
Can't Miss Features of PHP 5.3 and 5.4Jeff Carouth
If you're like me you remember the days of PHP3 and PHP4; you remember when PHP5 was released, and how it was touted to change to your life. It's still changing and there are some features of PHP 5.3 and new ones coming with PHP 5.4 that will improve your code readability and reusability. Let's look at some touted features such as closures, namespaces, and traits, as well as some features being discussed for future releases.
PYTHON-Chapter 3-Classes and Object-oriented Programming: MAULIK BORSANIYAMaulik Borsaniya
Classes and Object-oriented Programming:
Classes: Creating a Class, The Self Variable, Constructor, Types of Variables, Namespaces, Types of Methods (Instance Methods, Class Methods, Static Methods), Passing Members of One Class to Another Class, Inner Classes
Inheritance and Polymorphism: Constructors in Inheritance, Overriding Super Class Constructors and Methods, The super() Method, Types of Inheritance, Single Inheritance, Multiple Inheritance, Method Resolution Order (MRO), Polymorphism, Duck Typing Philosophy of Python, Operator Overloading, Method Overloading, Method Overriding
Abstract Classes and Interfaces: Abstract Method and Abstract Class, Interfaces in Python, Abstract Classes vs. Interfaces,
Inheritance and Polymorphism in Python. Inheritance is a mechanism which allows us to create a new class – known as child class – that is based upon an existing class – the parent class, by adding new attributes and methods on top of the existing class.
Full-day tutorial for the dutch php conference 2011 giving a very quick tour around all the various areas of the ZCE syllabus and some tips on the exam styles
A lot of people using PHPunit for testing their source code. While I was observing my team I recognized most of them are only using the standard assertions like 'assertEquals()' and are complaining about how hard it is to test the code even when the tests are written first. This talk is about all the stuff not used on a daily basis and it digs deep into uncommon features of PHPUnit.
PYTHON-Chapter 3-Classes and Object-oriented Programming: MAULIK BORSANIYAMaulik Borsaniya
Classes and Object-oriented Programming:
Classes: Creating a Class, The Self Variable, Constructor, Types of Variables, Namespaces, Types of Methods (Instance Methods, Class Methods, Static Methods), Passing Members of One Class to Another Class, Inner Classes
Inheritance and Polymorphism: Constructors in Inheritance, Overriding Super Class Constructors and Methods, The super() Method, Types of Inheritance, Single Inheritance, Multiple Inheritance, Method Resolution Order (MRO), Polymorphism, Duck Typing Philosophy of Python, Operator Overloading, Method Overloading, Method Overriding
Abstract Classes and Interfaces: Abstract Method and Abstract Class, Interfaces in Python, Abstract Classes vs. Interfaces,
Inheritance and Polymorphism in Python. Inheritance is a mechanism which allows us to create a new class – known as child class – that is based upon an existing class – the parent class, by adding new attributes and methods on top of the existing class.
Full-day tutorial for the dutch php conference 2011 giving a very quick tour around all the various areas of the ZCE syllabus and some tips on the exam styles
A lot of people using PHPunit for testing their source code. While I was observing my team I recognized most of them are only using the standard assertions like 'assertEquals()' and are complaining about how hard it is to test the code even when the tests are written first. This talk is about all the stuff not used on a daily basis and it digs deep into uncommon features of PHPUnit.
Selling the Open-Source Philosophy - DrupalCon Latin AmericaLucas Arruda
This talk consolidates positive experiences in the inclusion of the open source philosophy (not only the open code) in proposals to big companies.
We will highlight topics about the open source philosophy using the drupal community as our example and talk about some common questions that clients bring about open-source and some answers that worked well for us.
We will show how companies can benefit in security and ROI by adopting open-source code, and by contributing back with code.
We will try to make this talk very participative, so bring your questions, experiences (good or bad) and let's share!
Presentation made at GTA meetup in 2012-02-07.
Object Calisthenics is a set of exercise rules to reach better code, maintainable, testable and readable.
Your code sucks, let's fix it - DPC UnConRafael Dohms
How do you measure the quality of your code? Performance and testing are just one aspect of code, in order to meet deadlines and make maintenance quicker you also need your code to be readable, decoupled and generally easier to comprehend and work with. This talk will go over tips and exercises to help you identify trouble areas, refactor them and train you to write better code in future projects. Come make your code look and function better.
Scala is a general purpose programming language designed to express common programming patterns in a concise, elegant, and type-safe way. It smoothly integrates features of object-oriented and functional languages, enabling Java and other programmers to be more productive." This session is an introduction of Scala for Java developers.
Presentation & Fetured Video Included.
A lot of people using PHPunit for testing their source code. While I was observing my team
I recognized most of them are only using the standard ssertions like 'assertEquals()' or
'assertTrue()' and are complaining about how hard it is to test the code even when the tests are written first. This talk is about all the stuff not used on a daily basis. It shows you some nice features of PHPUnit and how to use them for your benefit.
This session will introduce you to the new Form component in Symfony2. With the new domain-driven paradigma and its flexible design, the component opens a door to a wide range of possibilities. The brand new architecture makes creating complex forms easier and faster than ever before. This talk will teach you today what you need to know to build powerful forms tomorrow.
How to build an ETL pipeline with Apache Beam on Google Cloud DataflowLucas Arruda
Nowadays more and more companies are searching for insights with potential to grow their business by analyzing large amounts of data from many different systems. However, in order to reach this level of Big Data Analysis it's necessary to build an ETL pipeline that allows us to process raw data coming from different sources into an appropriate format that is possible to use against visualization tools such as Tableau.
This kind of data processing can be done by a variety of tools and in this presentation I show how to do it by using an unified programming model created by Google and open-sourced as the name of Apache Beam. We will build a simple pipeline that will be executed in the Cloud by a fully-managed service called Google Cloud Dataflow.
Escalando PHP e Drupal: performance ao infinito e além! - DrupalCamp SP 2015Lucas Arruda
Esta apresentação é dividida em duas partes: a primeira aborda aspectos de performance em relação ao ambiente no qual seu Drupal estará rodando. Iremos passar por questões básicas como versões de software, ajustes de configuração, aceleradores e caching de bytecode até assuntos mais avançados como boas práticas de desenvolvimento que permitem que sua aplicação Drupal escale e portanto seja possível implantá-la na nuvem. Uma vez lá, como podemos tirar proveito deste ambiente volátil para aumentar ainda mais a performance e escalabilidade de maneira horizontal. A segunda parte trata sobre questões específicas de Drupal, como tuning de banco de dados, mecanismos de caching (memcache, varnish, Akamai, etc), cuidados com consumo de memória e tratamento de arquivos estáticos. Você sairá com um checklist gigantesco que irá lhe garantir bons momentos de alegria ao "tunar" sua aplicação Drupal ;-)
Tips and hits on how to scale your PHP application, from tuning your php.ini settings and using accelerators till going through caching mechanisms, reverse proxying and infrastructure setups.
Drupal Day SP 2014 - Virtualize seu Ambiente e Seja Produtivo!Lucas Arruda
Já pensou que sua stack consome recursos de sua máquina em momentos que você não está desenvolvendo? E o setup de ambiente que precisamos fazer a cada projeto/pessoa nova? Como garantir que todos estão usando as mesmas versões para garantir compatibilidade entre os ambientes? Venha conhecer a combinação entre duas tecnologias que irá automatizar processos manuais tornando-o mais produtivo!
QCon SP - ShortTalk - Virtualização e Provisionamento de Ambientes com Vagr...Lucas Arruda
Você já parou pra pensar que sua stack de desenvolvimento (Apache, PHP, MySQL, etc) consome recursos de sua máquina do trabalho ou pessoal em momentos que você não está desenvolvendo?
E quanto ao setup de ambiente e as muitas configurações que precisamos fazer a cada projeto novo que chega ou quando algum membro novo entra no time?
Logo depois, como garantir que todos do time estão utilizando exatamente as mesmas versões para garantir máxima compatibilidade entre os diversos ambientes (local, staging, produção, etc)?
Venha conhecer como a combinação entre duas tecnologias irá automatizar bastante processo manual economizando tempo e recursos e garantindo maior compatibilidade.
PHP Conference Brasil 2013 - Virtualização e Provisionamento de Ambientes c...Lucas Arruda
[This is an updated version of http://goo.gl/AoN9Tm]
Você já parou pra pensar que sua stack de desenvolvimento (Apache, PHP, MySQL, etc) consome recursos de sua máquina do trabalho ou pessoal em momentos que você não está desenvolvendo?
E quanto ao setup de ambiente e as muitas configurações que precisamos fazer a cada projeto novo que chega ou quando algum membro novo entra no time?
Logo depois, como garantir que todos do time estão utilizando exatamente as mesmas versões para garantir máxima compatibilidade entre os diversos ambientes (local, staging, produção, etc)?
Venha conhecer como a combinação entre duas tecnologias irá automatizar bastante processo manual economizando tempo e recursos e garantindo maior compatibilidade.
TDC2013 - PHP - Virtualização e Provisionamento de Ambientes com Vagrant e ...Lucas Arruda
Você já parou pra pensar que sua stack de desenvolvimento (Apache, PHP, MySQL, etc) consome recursos de sua máquina do trabalho ou pessoal em momentos que você não está desenvolvendo?
E quanto ao setup de ambiente e as muitas configurações que precisamos fazer a cada projeto novo que chega ou quando algum membro novo entra no time?
Logo depois, como garantir que todos do time estão utilizando exatamente as mesmas versões para garantir máxima compatibilidade entre os diversos ambientes (local, staging, produção, etc)?
Venha conhecer como a combinação entre duas tecnologias irá automatizar bastante processo manual economizando tempo e recursos e garantindo maior compatibilidade.
Elevating Tactical DDD Patterns Through Object CalisthenicsDorra BARTAGUIZ
After immersing yourself in the blue book and its red counterpart, attending DDD-focused conferences, and applying tactical patterns, you're left with a crucial question: How do I ensure my design is effective? Tactical patterns within Domain-Driven Design (DDD) serve as guiding principles for creating clear and manageable domain models. However, achieving success with these patterns requires additional guidance. Interestingly, we've observed that a set of constraints initially designed for training purposes remarkably aligns with effective pattern implementation, offering a more ‘mechanical’ approach. Let's explore together how Object Calisthenics can elevate the design of your tactical DDD patterns, offering concrete help for those venturing into DDD for the first time!
The Art of the Pitch: WordPress Relationships and SalesLaura Byrne
Clients don’t know what they don’t know. What web solutions are right for them? How does WordPress come into the picture? How do you make sure you understand scope and timeline? What do you do if sometime changes?
All these questions and more will be explored as we talk about matching clients’ needs with what your agency offers without pulling teeth or pulling your hair out. Practical tips, and strategies for successful relationship building that leads to closing the deal.
UiPath Test Automation using UiPath Test Suite series, part 4DianaGray10
Welcome to UiPath Test Automation using UiPath Test Suite series part 4. In this session, we will cover Test Manager overview along with SAP heatmap.
The UiPath Test Manager overview with SAP heatmap webinar offers a concise yet comprehensive exploration of the role of a Test Manager within SAP environments, coupled with the utilization of heatmaps for effective testing strategies.
Participants will gain insights into the responsibilities, challenges, and best practices associated with test management in SAP projects. Additionally, the webinar delves into the significance of heatmaps as a visual aid for identifying testing priorities, areas of risk, and resource allocation within SAP landscapes. Through this session, attendees can expect to enhance their understanding of test management principles while learning practical approaches to optimize testing processes in SAP environments using heatmap visualization techniques
What will you get from this session?
1. Insights into SAP testing best practices
2. Heatmap utilization for testing
3. Optimization of testing processes
4. Demo
Topics covered:
Execution from the test manager
Orchestrator execution result
Defect reporting
SAP heatmap example with demo
Speaker:
Deepak Rai, Automation Practice Lead, Boundaryless Group and UiPath MVP
Communications Mining Series - Zero to Hero - Session 1DianaGray10
This session provides introduction to UiPath Communication Mining, importance and platform overview. You will acquire a good understand of the phases in Communication Mining as we go over the platform with you. Topics covered:
• Communication Mining Overview
• Why is it important?
• How can it help today’s business and the benefits
• Phases in Communication Mining
• Demo on Platform overview
• Q/A
DevOps and Testing slides at DASA ConnectKari Kakkonen
My and Rik Marselis slides at 30.5.2024 DASA Connect conference. We discuss about what is testing, then what is agile testing and finally what is Testing in DevOps. Finally we had lovely workshop with the participants trying to find out different ways to think about quality and testing in different parts of the DevOps infinity loop.
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdfPaige Cruz
Monitoring and observability aren’t traditionally found in software curriculums and many of us cobble this knowledge together from whatever vendor or ecosystem we were first introduced to and whatever is a part of your current company’s observability stack.
While the dev and ops silo continues to crumble….many organizations still relegate monitoring & observability as the purview of ops, infra and SRE teams. This is a mistake - achieving a highly observable system requires collaboration up and down the stack.
I, a former op, would like to extend an invitation to all application developers to join the observability party will share these foundational concepts to build on:
Removing Uninteresting Bytes in Software FuzzingAftab Hussain
Imagine a world where software fuzzing, the process of mutating bytes in test seeds to uncover hidden and erroneous program behaviors, becomes faster and more effective. A lot depends on the initial seeds, which can significantly dictate the trajectory of a fuzzing campaign, particularly in terms of how long it takes to uncover interesting behaviour in your code. We introduce DIAR, a technique designed to speedup fuzzing campaigns by pinpointing and eliminating those uninteresting bytes in the seeds. Picture this: instead of wasting valuable resources on meaningless mutations in large, bloated seeds, DIAR removes the unnecessary bytes, streamlining the entire process.
In this work, we equipped AFL, a popular fuzzer, with DIAR and examined two critical Linux libraries -- Libxml's xmllint, a tool for parsing xml documents, and Binutil's readelf, an essential debugging and security analysis command-line tool used to display detailed information about ELF (Executable and Linkable Format). Our preliminary results show that AFL+DIAR does not only discover new paths more quickly but also achieves higher coverage overall. This work thus showcases how starting with lean and optimized seeds can lead to faster, more comprehensive fuzzing campaigns -- and DIAR helps you find such seeds.
- These are slides of the talk given at IEEE International Conference on Software Testing Verification and Validation Workshop, ICSTW 2022.
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...SOFTTECHHUB
The choice of an operating system plays a pivotal role in shaping our computing experience. For decades, Microsoft's Windows has dominated the market, offering a familiar and widely adopted platform for personal and professional use. However, as technological advancements continue to push the boundaries of innovation, alternative operating systems have emerged, challenging the status quo and offering users a fresh perspective on computing.
One such alternative that has garnered significant attention and acclaim is Nitrux Linux 3.5.0, a sleek, powerful, and user-friendly Linux distribution that promises to redefine the way we interact with our devices. With its focus on performance, security, and customization, Nitrux Linux presents a compelling case for those seeking to break free from the constraints of proprietary software and embrace the freedom and flexibility of open-source computing.
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdfPeter Spielvogel
Building better applications for business users with SAP Fiori.
• What is SAP Fiori and why it matters to you
• How a better user experience drives measurable business benefits
• How to get started with SAP Fiori today
• How SAP Fiori elements accelerates application development
• How SAP Build Code includes SAP Fiori tools and other generative artificial intelligence capabilities
• How SAP Fiori paves the way for using AI in SAP apps
GraphRAG is All You need? LLM & Knowledge GraphGuy Korland
Guy Korland, CEO and Co-founder of FalkorDB, will review two articles on the integration of language models with knowledge graphs.
1. Unifying Large Language Models and Knowledge Graphs: A Roadmap.
https://arxiv.org/abs/2306.08302
2. Microsoft Research's GraphRAG paper and a review paper on various uses of knowledge graphs:
https://www.microsoft.com/en-us/research/blog/graphrag-unlocking-llm-discovery-on-narrative-private-data/
Dr. Sean Tan, Head of Data Science, Changi Airport Group
Discover how Changi Airport Group (CAG) leverages graph technologies and generative AI to revolutionize their search capabilities. This session delves into the unique search needs of CAG’s diverse passengers and customers, showcasing how graph data structures enhance the accuracy and relevance of AI-generated search results, mitigating the risk of “hallucinations” and improving the overall customer journey.
Climate Impact of Software Testing at Nordic Testing DaysKari Kakkonen
My slides at Nordic Testing Days 6.6.2024
Climate impact / sustainability of software testing discussed on the talk. ICT and testing must carry their part of global responsibility to help with the climat warming. We can minimize the carbon footprint but we can also have a carbon handprint, a positive impact on the climate. Quality characteristics can be added with sustainability, and then measured continuously. Test environments can be used less, and in smaller scale and on demand. Test techniques can be used in optimizing or minimizing number of tests. Test automation can be used to speed up testing.
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024Neo4j
Neha Bajwa, Vice President of Product Marketing, 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.
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
1st CI&T Lightning Talks: Writing better code with Object Calisthenics
1. Writing better
code with
Object Calisthenics
Lucas Arruda
lucas@ciandt.com
github.com/larruda
Adapted from Jeff Bay’s paper from
“The ThoughtWorks Anthology”
and Guilherme Blanco’s presentation.
6. 1. One level of indentation per method
class Board {
...
String board() {
StringBuffer buf = new StringBuffer();
for (int i = 0; i < 10; i++) {
for (int j = 0; j < 10; j++)
buf.append(data[i][j]);
buf.append(“n”);
}
return buf.toString();
}
}
7. 1. One level of indentation per method
class Board {
...
String Board() {
StringBuffer buf = new StringBuffer();
collectRows(buf);
return buf.toString();
}
void collectRows(StringBuffer buf) {
for (int i = 0; i < 10; i++)
collectRow(buf, i);
}
void collectRow(StringBuffer buf, int row) {
for (int i = 0; i < 10; i++)
Buf.append(data[row][i]);
buf.append(“n”);
}
}
8. 1. One level of indentation per method
public function validateForm($filters='', $validators='', $options='')
{
$data = $_POST;
$input = new Zend_Filter_Input($filters, $validators, $data);
$input->setDefaultEscapeFilter(new Zend_Filter_StringTrim());
if ($input->hasInvalid() || $input->hasMissing()) {
foreach ($input->getMessages() as $field => $messageList) {
foreach ($messageList as $message) {
if (strpos($message, "empty")) {
throw new Tss_FormException(
"The field {$field} cannot be empty!",
3, 'javascript:history.back();'
);
} else {
throw new Tss_FormException(
"{$message}", 3, 'javascript:history.back();'
);
}
}
}
}
return $input;
}
9. 1. One level of indentation per method
public function validateForm($filters='', $validators='', $options='')
{
$data = $_POST;
$input = new Zend_Filter_Input($filters, $validators, $data);
$input->setDefaultEscapeFilter(new Zend_Filter_StringTrim());
if ( ! ($input->hasInvalid() || $input->hasMissing())) {
return $input;
}
foreach ($input->getMessages() as $field => $messageList) {
foreach ($messageList as $message) {
if (strpos($message, "empty")) {
throw new Tss_FormException(
"The field {$field} cannot be empty!",
3, 'javascript:history.back();'
);
} else {
throw new Tss_FormException(
"{$message}", 3, 'javascript:history.back();'
);
}
}
}
}
10. 1. One level of indentation per method
public function validateForm($filters='', $validators='', ...
{
$data = $_POST;
$input = new Zend_Filter_Input ($filters, $validators, $data);
$input->setDefaultEscapeFilter( new Zend_Filter_StringTrim ());
if ( ! ($input->hasInvalid() || $input->hasMissing())) {
return $input;
}
foreach ($input->getMessages() as $field => $messageList) {
foreach ($messageList as $message) {
$errorMessage = (strpos($message, "empty") === false)
? "The field {$field} cannot be empty!"
: "{$message}";
throw new Tss_FormException (
$errorMessage, 3, 'javascript:history.back();'
);
}
}
}
11. 1. One level of indentation per method
public function validateForm($filters='', $validators='', ...
{
$data = $_POST;
$input = new Zend_Filter_Input ($filters, $validators, $data);
$input->setDefaultEscapeFilter( new Zend_Filter_StringTrim ());
if ( ! ($input->hasInvalid() || $input->hasMissing())) {
return $input;
}
foreach ($input->getMessages() as $field => $messageList) {
$messageKey = key($message);
$message = $message[$messageKey];
$errorMessage = (strpos($message, "empty") === false)
? "The field {$field} cannot be empty!"
: "{$message}";
throw new Tss_FormException (
$errorMessage, 3, 'javascript:history.back();'
);
}
}
12. 2. Don’t use the ELSE keyword
if (status == DONE) {
doSomething();
} else {
…
}
20. 3. Wrap all primitives and Strings
class UIComponent
{
// ...
public function repaint($animate = true)
{
// …
}
// ...
$component->repaint(false);
}
21. 3. Wrap all primitives and Strings
class UIComponent
{
// ...
public function repaint(Animate $animate)
{
// ...
}
}
class Animate
{
public $animate;
public function __construct($animate = true)
{
$this->animate = $animate;
}
}
// ...
$component->repaint(new Animate(false));
22. 4. First class collections
Any class that contains a collection/array
should not contain any other member
variables
Java Collections follow this rule
23. 4. First class collections
Transversable
Countable
Iterator
Filtering
Mapping
Combining
24. 5. One dot/arrow per line
Sign of misplaced responsibilities
The Law of Demeter
“Only talk to your friends”
25. 5. One dot/arrow per line
class Board {
...
class Piece {
...
String representation;
}
class Location {
...
Piece current;
}
String boardRepresentation () {
StringBuffer buf = new StringBuffer();
for (Location l: squares())
buf .append(l.current.representation .substring(0,
1));
return buf.toString();
}
}
26. 5. One dot/arrow per line
class Board {
...
class Piece {
...
private String representation;
String character() {
return representation.substring(0, 1);
}
void addTo(StringBuffer buf) {
buf.append(character());
}
}
class Location {
...
private Piece current;
void addTo(StringBuffer buf) {
current.addTo(buf);
}
}
String boardRepresentation() {
StringBuffer buf = new StringBuffer();
for (Location l: squares())
l.addTo(buf);
return buf.toString();
}
}
27. 6. Don’t abbreviate
Are you writing the same name repeatedly?
method being used multiple times
sign of code duplication
Is the method name too long?
class with multiple responsibilities
missing additional class
redundancy
28. 7. Keep all entities small
Java
No class over 50 lines
No packages over 10 files
PHP
No class over 100 lines
No packages over 15 files
Packages, like classes, should be
cohesive and have a purpose
29. 8. No classes with more than two/five instance variables
Improve cohesion
Split on more entities