The document discusses the principles of clean code as outlined in the book "Clean Code" by Robert C. Martin. It covers topics like meaningful names, comments, functions, objects and data structures, error handling, and unit tests. The goal of clean code is to produce readable, maintainable code through practices like breaking code into small, single-purpose functions and hiding implementation details in objects.
A summary of clean code concepts and tips along with some examples and good practices.
These are the slides translated in English from my talk on Clean Code to my coworkers back then
Presentación para la charla sobre el libro de Robert C. Martin, Clean Code.
Esta presentación la impartí en CyLicon Valley, aquí tenéis el video con el audio de la charla => https://www.youtube.com/watch?v=1Fss1jBfc3g
A summary of clean code concepts and tips along with some examples and good practices.
These are the slides translated in English from my talk on Clean Code to my coworkers back then
Presentación para la charla sobre el libro de Robert C. Martin, Clean Code.
Esta presentación la impartí en CyLicon Valley, aquí tenéis el video con el audio de la charla => https://www.youtube.com/watch?v=1Fss1jBfc3g
Presentation on writing clean and maintainable good. I have present really simple steps to write high quality code and share many more benefit of writing clean code.
Presentation I held before my colleagues about the book Clean Code (http://www.amazon.com/Clean-Code-Handbook-Software-Craftsmanship/dp/0132350882).
It contains the highlights of several chapters and hint/guidelines a developer should know.
Vladimir Romanov - How to write code that is easy to read and change? What should you do when you see a piece of code written years ago which is hard to understand? In my experience, this boils down to 4 principles that I would like to share along with some examples in Apex
All 3 Clean Code presentations provide great value by themselves, but taken together are designed to offer a holistic approach to successful software creation. This first session creates the foundation for the 2nd and 3rd Clean Code presentation on Dependency Injection, as it explains expected base knowledge. Why writing Clean Code makes us more efficient Over the lifetime of a product, maintaining the product is actually one - if not the most - expensive area(s) of the overall product costs.
Writing clean code can significantly lower these costs. However, writing clean code also makes you more efficient during the initial development time and results in more stable code. You will be presented design patterns and best practices which will make you write better and more easily maintainable code, seeing code in a holistic way.
You will learn how to apply them by using an existing implementation as the starting point of the presentation. Finally, patterns & practices benefits are explained. This presentation is based on C# and Visual Studio 2012. However, the demonstrated patterns and practice can be applied to every other programming language too.
Note: Moving forwards this presentation will be updated with the latest version of the slides for the last event I did the presentation instead of creating new separate slide decks here on SlideShare.
Presentation dates and locations:
2015-10-03 Silicon Valley Code Camp, San Jose, CA
2015-06-27 SoCal Code Camp - San Diego, CA
2014-11-14 SoCal Code Camp - Los Angeles, CA
2014-10-18 Desert Code Camp - Chandler, AZ
2014-10-11 Silicon Valley Code Camp, Los Altos Hills, CA
Clan code is extremely essential to build scalable application which can be maintained quite easily and improved further
Slide was prepared with contribution to my colleague
and i thank them for the help!
How should a professional software developer behave in code? What guidelines should one follow? How should we name our constructs? What about OOP principles? What's their real use?
This classic training module in my training curricula is the cornerstone of my professionalism. These are my conduit guidelines at work. I've held this training > 10 times, including at Voxxed Days Bucharest 2016 and at a Bucharest Java User Group meetup.
Slides of the talk held at JEEConf, Kiev and jPrime, Sofia. A personal view on the classic topics from the Uncle Bob's Clean Code bible, with some personal additions and tips&tricks. This topic actually represents the core of the training sessions that I provide as an independent trainer (www.victorrentea.ro)
Rule 1: Follow a consistent coding standard
Rule 2: Name things properly, long variable and function names are allowed
Rule 3: Be expressive, write code as you speak and be optimally verbose
Rule 4: Max indent per method should be 2, in case of exceptions 3
Rule 5: Avoid creating god object and long methods
Rule 6: Keep the method in one place, inject the class and call it, DRY
Rule 7: Avoid in-line comments (comment with code), put comments in the method doc
"Even bad code can function. But if code isn't clean, it can bring a development organization to its knees. Every year, countless hours and significant resources are lost because of poorly written code. But it doesn't have to be that way." In this knolx session, a few important topics for having clean code are covered. Basically the following topics - Meaningful name, Functions, Comments and Classes.
Clean Code talk held at the HSR "Hochschule für Technik Rapperswil" and the FHNW "Fachhochschule Nordwestschweiz" based on the great book by Robert C. Martin and enriched with personal experiences
Presentation on writing clean and maintainable good. I have present really simple steps to write high quality code and share many more benefit of writing clean code.
Presentation I held before my colleagues about the book Clean Code (http://www.amazon.com/Clean-Code-Handbook-Software-Craftsmanship/dp/0132350882).
It contains the highlights of several chapters and hint/guidelines a developer should know.
Vladimir Romanov - How to write code that is easy to read and change? What should you do when you see a piece of code written years ago which is hard to understand? In my experience, this boils down to 4 principles that I would like to share along with some examples in Apex
All 3 Clean Code presentations provide great value by themselves, but taken together are designed to offer a holistic approach to successful software creation. This first session creates the foundation for the 2nd and 3rd Clean Code presentation on Dependency Injection, as it explains expected base knowledge. Why writing Clean Code makes us more efficient Over the lifetime of a product, maintaining the product is actually one - if not the most - expensive area(s) of the overall product costs.
Writing clean code can significantly lower these costs. However, writing clean code also makes you more efficient during the initial development time and results in more stable code. You will be presented design patterns and best practices which will make you write better and more easily maintainable code, seeing code in a holistic way.
You will learn how to apply them by using an existing implementation as the starting point of the presentation. Finally, patterns & practices benefits are explained. This presentation is based on C# and Visual Studio 2012. However, the demonstrated patterns and practice can be applied to every other programming language too.
Note: Moving forwards this presentation will be updated with the latest version of the slides for the last event I did the presentation instead of creating new separate slide decks here on SlideShare.
Presentation dates and locations:
2015-10-03 Silicon Valley Code Camp, San Jose, CA
2015-06-27 SoCal Code Camp - San Diego, CA
2014-11-14 SoCal Code Camp - Los Angeles, CA
2014-10-18 Desert Code Camp - Chandler, AZ
2014-10-11 Silicon Valley Code Camp, Los Altos Hills, CA
Clan code is extremely essential to build scalable application which can be maintained quite easily and improved further
Slide was prepared with contribution to my colleague
and i thank them for the help!
How should a professional software developer behave in code? What guidelines should one follow? How should we name our constructs? What about OOP principles? What's their real use?
This classic training module in my training curricula is the cornerstone of my professionalism. These are my conduit guidelines at work. I've held this training > 10 times, including at Voxxed Days Bucharest 2016 and at a Bucharest Java User Group meetup.
Slides of the talk held at JEEConf, Kiev and jPrime, Sofia. A personal view on the classic topics from the Uncle Bob's Clean Code bible, with some personal additions and tips&tricks. This topic actually represents the core of the training sessions that I provide as an independent trainer (www.victorrentea.ro)
Rule 1: Follow a consistent coding standard
Rule 2: Name things properly, long variable and function names are allowed
Rule 3: Be expressive, write code as you speak and be optimally verbose
Rule 4: Max indent per method should be 2, in case of exceptions 3
Rule 5: Avoid creating god object and long methods
Rule 6: Keep the method in one place, inject the class and call it, DRY
Rule 7: Avoid in-line comments (comment with code), put comments in the method doc
"Even bad code can function. But if code isn't clean, it can bring a development organization to its knees. Every year, countless hours and significant resources are lost because of poorly written code. But it doesn't have to be that way." In this knolx session, a few important topics for having clean code are covered. Basically the following topics - Meaningful name, Functions, Comments and Classes.
Clean Code talk held at the HSR "Hochschule für Technik Rapperswil" and the FHNW "Fachhochschule Nordwestschweiz" based on the great book by Robert C. Martin and enriched with personal experiences
NodeJS: Writing tests -- A Beginners' GuideGrey Ang
This is an introductory slide for web development beginners about software testing, and how to write tests in NodeJS.
For more information, you can check out the project's page at http://conancat.github.com/node-test-examples/
Get the exercises and test project at this page: https://github.com/conancat/node-test-examples.
Need help? Buzz me on Twitter -- @conancat!
360iDev presentation given by Noel Llopis. http://gamesfromwithin.com/?p=360
Session description: This session will cover the experiences of a professional game developer, used to 200+ person teams, multi-million dollar budgets, and 3+ year schedules, who left all that behind to become a one-person indie company developing exclusively for the iPhone. It will explain how things are different and how some things are very much the same, and will show specific examples of graphics technology, development environment, and asset pipeline. I will be using my current iPhone project, Flower Garden, as an example. The audience will learn what the transition is like and what to expect going indie making games for the iPhone.
Read| The latest issue of The Challenger is here! We are thrilled to announce that our school paper has qualified for the NATIONAL SCHOOLS PRESS CONFERENCE (NSPC) 2024. Thank you for your unwavering support and trust. Dive into the stories that made us stand out!
How to Create Map Views in the Odoo 17 ERPCeline George
The map views are useful for providing a geographical representation of data. They allow users to visualize and analyze the data in a more intuitive manner.
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdfTechSoup
In this webinar you will learn how your organization can access TechSoup's wide variety of product discount and donation programs. From hardware to software, we'll give you a tour of the tools available to help your nonprofit with productivity, collaboration, financial management, donor tracking, security, and more.
The Roman Empire A Historical Colossus.pdfkaushalkr1407
The Roman Empire, a vast and enduring power, stands as one of history's most remarkable civilizations, leaving an indelible imprint on the world. It emerged from the Roman Republic, transitioning into an imperial powerhouse under the leadership of Augustus Caesar in 27 BCE. This transformation marked the beginning of an era defined by unprecedented territorial expansion, architectural marvels, and profound cultural influence.
The empire's roots lie in the city of Rome, founded, according to legend, by Romulus in 753 BCE. Over centuries, Rome evolved from a small settlement to a formidable republic, characterized by a complex political system with elected officials and checks on power. However, internal strife, class conflicts, and military ambitions paved the way for the end of the Republic. Julius Caesar’s dictatorship and subsequent assassination in 44 BCE created a power vacuum, leading to a civil war. Octavian, later Augustus, emerged victorious, heralding the Roman Empire’s birth.
Under Augustus, the empire experienced the Pax Romana, a 200-year period of relative peace and stability. Augustus reformed the military, established efficient administrative systems, and initiated grand construction projects. The empire's borders expanded, encompassing territories from Britain to Egypt and from Spain to the Euphrates. Roman legions, renowned for their discipline and engineering prowess, secured and maintained these vast territories, building roads, fortifications, and cities that facilitated control and integration.
The Roman Empire’s society was hierarchical, with a rigid class system. At the top were the patricians, wealthy elites who held significant political power. Below them were the plebeians, free citizens with limited political influence, and the vast numbers of slaves who formed the backbone of the economy. The family unit was central, governed by the paterfamilias, the male head who held absolute authority.
Culturally, the Romans were eclectic, absorbing and adapting elements from the civilizations they encountered, particularly the Greeks. Roman art, literature, and philosophy reflected this synthesis, creating a rich cultural tapestry. Latin, the Roman language, became the lingua franca of the Western world, influencing numerous modern languages.
Roman architecture and engineering achievements were monumental. They perfected the arch, vault, and dome, constructing enduring structures like the Colosseum, Pantheon, and aqueducts. These engineering marvels not only showcased Roman ingenuity but also served practical purposes, from public entertainment to water supply.
How to Split Bills in the Odoo 17 POS ModuleCeline George
Bills have a main role in point of sale procedure. It will help to track sales, handling payments and giving receipts to customers. Bill splitting also has an important role in POS. For example, If some friends come together for dinner and if they want to divide the bill then it is possible by POS bill splitting. This slide will show how to split bills in odoo 17 POS.
Instructions for Submissions thorugh G- Classroom.pptxJheel Barad
This presentation provides a briefing on how to upload submissions and documents in Google Classroom. It was prepared as part of an orientation for new Sainik School in-service teacher trainees. As a training officer, my goal is to ensure that you are comfortable and proficient with this essential tool for managing assignments and fostering student engagement.
1. Clean Code
Hendrik Ebel
10. Mar. 2009
Tuesday, March 10, 2009
2. Topics
Motivation
Meaningful Names
Comments
Functions
By Robert C. Martin & Co.
Objects and Data Structures Object Mentor Inc.
Error Handling
Unit Tests
Tuesday, March 10, 2009
3. What is Clean Code?
One Question ...
Tuesday, March 10, 2009
4. What is Clean Code?
One Question ...
elegant
efficient
simple and direct
readability easy to enhance
like a well-written prose
care
no duplications
was made for the problem
...many answers!
Tuesday, March 10, 2009
5. What is Clean Code?
One Question ...
elegant
efficient
simple and direct
readability easy to enhance
like a well-written prose
care
no duplications
was made for the problem
...many answers!
Tuesday, March 10, 2009
6. Motivation
The Total Cost of Owning a Mess
productivity vs. time
Tuesday, March 10, 2009
7. Aims of Clean Code
producing better code
@author writing for readers
code has to be kept clean over time
„Leave the campground cleaner than
you found it.“
Tuesday, March 10, 2009
9. Meaningful Names
variable, function or class names should
answer all the big questions:
why it exists?
what it does?
how it is used?
Tuesday, March 10, 2009
10. Meaningful Names
If a name requires a comment, then the
name does not reveal its intent
avoid disinformation
don't use type information in names
(example: personList)
Spelling similar concepts similarly is
information. Using inconsistent spellings is
disinformation.
Tuesday, March 10, 2009
12. Good and Bad Comments
• Public API Comments • Redundant Comments
• Legal Comments • Noise Comments
• Explanation of Intent • Position Markers
• Warning for • Closing Brace Comments
• Commented-Out Code
Consequences
• real TODO Comments • Obsolete Comments
• Nonpublic JavaDocs
Tuesday, March 10, 2009
13. Comments
„Purpose of a comment is to explain code
that does not explain itself.“
Comments do not make up for bad code
Don‘t use a comment when you can use a
function or a variable
Comments can contains lies
Tuesday, March 10, 2009
15. Functions
The goal is to tell the story of the
system.
„The first rule of functions is that they
should be small.“
Do One Thing!
Stepdown Rule
Tuesday, March 10, 2009
16. Functions
Ideal number of arguments is zero
More than three should‘t be used
anyway
Flag arguments are ugly.
Avoid output arguments
Side effects are lies.
Tuesday, March 10, 2009
18. Objects
hide data and expose functions
easy to add new objects
hard to add new behaviors
Tuesday, March 10, 2009
19. Data Structures
expose data and have no meaningful
functions
easy to add new behaviors
hard to add new data structures
Choose the approach that is best for the job.
Tuesday, March 10, 2009
21. Error Handling
Write code that is clean and rebust
See error handling as a separate concern
Use exceptions rather than return codes
Use unchecked exceptions
Tuesday, March 10, 2009
22. Error Handling
Don‘t return NULL
throwing an exception or a special
case object like
„Collections.emptyList()“
Don‘t pass NULL
InvalidArgumentExceptions or assert
better: forbid passing NULL by default
Tuesday, March 10, 2009
24. Unit Tests
Test Driven Development (TDD)
test and production code are written
together
tests just a few seconds ahead
Keeping tests clean
Test code is just as important as
production code.
Tuesday, March 10, 2009
25. Unit Tests
One Assert or Single Concept per Test
F.I.R.S.T.
Fast
Independent
Repeatable (in any environment)
Self-Validation
Timly
Tuesday, March 10, 2009
27. Sources
Book
„Clean Code“ by Robert C. Martin
ISBN: 0132350882
Images
http://www.failblog.org
http://www.flickr.com/photos/hugovk/199425487/
http://www.flickr.com/photos/jackpot321/1809424991/
http://www.osnews.com/story/19266/WTFs_m
Tuesday, March 10, 2009