SlideShare a Scribd company logo
1 of 12
Refuctoring
(The process of taking a well-designed piece of code and, through a series of
small, reversible changes, making it completely unmaintainable by anyone
except yourself.)
Code Smells
Well it doesn't have a nose... but it
definitely can stink!
Ingredients
● Comments
● Long Method, Large Class
● Long parameter list
● Duplicated code
● Dead Code
● Temporary variables
● Conditional Complexity
● Combinatorial Explosion
● Uncommunicative/Inconsistent
Names
Comments
● The best comment is a good name for a
method or class.
● The code is is supposed to explain itself. In
that case comments are not needed
Comments can be useful
● When explaining why something is being
implemented in a particular way.
● When explaining complex algorithms (when all
other methods for simplifying the algorithm
have been tried and come up short).
Long Methods &
Long Classes (God Class)
Classes usually start small. But over
time, they get bloated as the program
grows.
As is the case with long methods as
well,
Long Parameters
Duplicated
Code
Duplicated code is the bane of
software development. Stamp
out duplication whenever
possible. You should always be
on the lookout for more subtle
cases of near-duplication, too.
Don't Repeat Yourself!
Dead Code
● When requirements for the software
have changed or corrections have been
made, nobody had time to clean up the
old code.
● Such code could also be found in
complex conditionals, when one of
the branches becomes unreachable
(due to error or other circumstances).
Temporary
Variables
● Temporary variables are
quick and easy way to store
and manipulate data around.
● But over time they stick
around you with bad smell.
Conditional Complexity
● Watch out for large conditional logic
blocks, particularly blocks that tend to
grow larger or change significantly over
time. Consider alternative object-
oriented approaches such as decorator,
strategy.
Combinatorial
Explosion
● You have lots of code that
does almost the same thing..
but with tiny variations in
data or behavior.
Uncommunicative/Inconsistent Names
● Does the name of the method succinctly
describe what that method does? Could
you read the method's name to another
developer and have them explain to you
what it does? If not, rename it or rewrite
it.
● $category or $cat ?
● $cat or $c ?
● $subcategory or $SubCategory or
$sub_category or $s_cat or $s_c
There are two ways to write
error-free programs;
Only the third one works.(Alan Jay Perlis)
Shobi P P
shobi@storat.com
Reference
https://blog.codinghorror.com/code-smells/

More Related Content

What's hot

Revisit: Best Practices in Scala
Revisit: Best Practices in ScalaRevisit: Best Practices in Scala
Revisit: Best Practices in ScalaKnoldus Inc.
 
Competitive Programming Guide
Competitive Programming GuideCompetitive Programming Guide
Competitive Programming GuideAjay Khatri
 
Better programmer overview
Better programmer   overviewBetter programmer   overview
Better programmer overviewCourseHunt
 
Software Design Principles and Best Practices - Satyajit Dey
Software Design Principles and Best Practices - Satyajit DeySoftware Design Principles and Best Practices - Satyajit Dey
Software Design Principles and Best Practices - Satyajit DeyCefalo
 
Introduction to Competitive programming
Introduction to Competitive programmingIntroduction to Competitive programming
Introduction to Competitive programmingAyoub Eddakhly
 
Black Box Machine Learning Models: Issues and Opportunities | Thomas Y. Chen,...
Black Box Machine Learning Models: Issues and Opportunities | Thomas Y. Chen,...Black Box Machine Learning Models: Issues and Opportunities | Thomas Y. Chen,...
Black Box Machine Learning Models: Issues and Opportunities | Thomas Y. Chen,...HostedbyConfluent
 
Fundamentals of programming)
Fundamentals of programming)Fundamentals of programming)
Fundamentals of programming)jakejakejake2
 
Code Smells and Refactoring - Satyajit Dey & Ashif Iqbal
Code Smells and Refactoring - Satyajit Dey & Ashif IqbalCode Smells and Refactoring - Satyajit Dey & Ashif Iqbal
Code Smells and Refactoring - Satyajit Dey & Ashif IqbalCefalo
 
What not to study for the apcs exam, and other exam tips
What not to study for the apcs exam, and other exam tipsWhat not to study for the apcs exam, and other exam tips
What not to study for the apcs exam, and other exam tipsPokequesthero
 
Code smells quality of code
Code smells   quality of codeCode smells   quality of code
Code smells quality of codeHasan Al Mamun
 
Emarsys XP reggeli 2016.08.12.
Emarsys XP reggeli 2016.08.12.Emarsys XP reggeli 2016.08.12.
Emarsys XP reggeli 2016.08.12.Milán Unicsovics
 
I'm a TDD cheat and I'm not afraid to admit it
I'm a TDD cheat and I'm not afraid to admit itI'm a TDD cheat and I'm not afraid to admit it
I'm a TDD cheat and I'm not afraid to admit itDaniel Irvine
 
When to use abstract class and methods in java
When to use abstract class and methods in java When to use abstract class and methods in java
When to use abstract class and methods in java kritikumar16
 
Lab view (Getting Started)
Lab view (Getting Started)Lab view (Getting Started)
Lab view (Getting Started)Nitesh Pradhan
 

What's hot (20)

JavaScript Variables
JavaScript VariablesJavaScript Variables
JavaScript Variables
 
Revisit: Best Practices in Scala
Revisit: Best Practices in ScalaRevisit: Best Practices in Scala
Revisit: Best Practices in Scala
 
Competitive Programming Guide
Competitive Programming GuideCompetitive Programming Guide
Competitive Programming Guide
 
Better programmer overview
Better programmer   overviewBetter programmer   overview
Better programmer overview
 
Software Design Principles and Best Practices - Satyajit Dey
Software Design Principles and Best Practices - Satyajit DeySoftware Design Principles and Best Practices - Satyajit Dey
Software Design Principles and Best Practices - Satyajit Dey
 
Introduction to Competitive programming
Introduction to Competitive programmingIntroduction to Competitive programming
Introduction to Competitive programming
 
Clean code-Coding Rules
Clean code-Coding RulesClean code-Coding Rules
Clean code-Coding Rules
 
Black Box Machine Learning Models: Issues and Opportunities | Thomas Y. Chen,...
Black Box Machine Learning Models: Issues and Opportunities | Thomas Y. Chen,...Black Box Machine Learning Models: Issues and Opportunities | Thomas Y. Chen,...
Black Box Machine Learning Models: Issues and Opportunities | Thomas Y. Chen,...
 
Fundamentals of programming)
Fundamentals of programming)Fundamentals of programming)
Fundamentals of programming)
 
Clean code
Clean codeClean code
Clean code
 
Code Smells and Refactoring - Satyajit Dey & Ashif Iqbal
Code Smells and Refactoring - Satyajit Dey & Ashif IqbalCode Smells and Refactoring - Satyajit Dey & Ashif Iqbal
Code Smells and Refactoring - Satyajit Dey & Ashif Iqbal
 
What not to study for the apcs exam, and other exam tips
What not to study for the apcs exam, and other exam tipsWhat not to study for the apcs exam, and other exam tips
What not to study for the apcs exam, and other exam tips
 
Code smells quality of code
Code smells   quality of codeCode smells   quality of code
Code smells quality of code
 
Emarsys XP reggeli 2016.08.12.
Emarsys XP reggeli 2016.08.12.Emarsys XP reggeli 2016.08.12.
Emarsys XP reggeli 2016.08.12.
 
I'm a TDD cheat and I'm not afraid to admit it
I'm a TDD cheat and I'm not afraid to admit itI'm a TDD cheat and I'm not afraid to admit it
I'm a TDD cheat and I'm not afraid to admit it
 
15 interfaces
15   interfaces15   interfaces
15 interfaces
 
DRY or die
DRY or dieDRY or die
DRY or die
 
13. interfaces
13. interfaces13. interfaces
13. interfaces
 
When to use abstract class and methods in java
When to use abstract class and methods in java When to use abstract class and methods in java
When to use abstract class and methods in java
 
Lab view (Getting Started)
Lab view (Getting Started)Lab view (Getting Started)
Lab view (Getting Started)
 

Similar to Code Smells - Refactoring

Clean Code - Part 2
Clean Code - Part 2Clean Code - Part 2
Clean Code - Part 2Knoldus Inc.
 
Code Smell and Refactoring
Code Smell and RefactoringCode Smell and Refactoring
Code Smell and Refactoringkimsrung lov
 
Software Craftmanship - Cours Polytech
Software Craftmanship - Cours PolytechSoftware Craftmanship - Cours Polytech
Software Craftmanship - Cours Polytechyannick grenzinger
 
Single Responsibility Principle
Single Responsibility PrincipleSingle Responsibility Principle
Single Responsibility PrincipleBADR
 
Clean code - DSC DYPCOE
Clean code - DSC DYPCOEClean code - DSC DYPCOE
Clean code - DSC DYPCOEPatil Shreyas
 
A Pragmatic Approach
A Pragmatic ApproachA Pragmatic Approach
A Pragmatic ApproachHakanCanpek
 
YAGNI Principle and Clean Code
YAGNI Principle and Clean CodeYAGNI Principle and Clean Code
YAGNI Principle and Clean CodeLuan Reffatti
 
Cinci ug-january2011-anti-patterns
Cinci ug-january2011-anti-patternsCinci ug-january2011-anti-patterns
Cinci ug-january2011-anti-patternsSteven Smith
 
Another Tale of Two Patterns
Another Tale of Two PatternsAnother Tale of Two Patterns
Another Tale of Two PatternsKevlin Henney
 
Principled And Clean Coding
Principled And Clean CodingPrincipled And Clean Coding
Principled And Clean CodingMetin Ogurlu
 
Writing Readable Code
Writing Readable CodeWriting Readable Code
Writing Readable Codeeddiehaber
 
Basics of writing clean code
Basics of writing clean codeBasics of writing clean code
Basics of writing clean codeKnoldus Inc.
 

Similar to Code Smells - Refactoring (20)

Clean Code
Clean CodeClean Code
Clean Code
 
Clean Code - Part 2
Clean Code - Part 2Clean Code - Part 2
Clean Code - Part 2
 
Refactoring
RefactoringRefactoring
Refactoring
 
Code Smell and Refactoring
Code Smell and RefactoringCode Smell and Refactoring
Code Smell and Refactoring
 
Software Craftmanship - Cours Polytech
Software Craftmanship - Cours PolytechSoftware Craftmanship - Cours Polytech
Software Craftmanship - Cours Polytech
 
Bad Smells in Code
Bad Smells in CodeBad Smells in Code
Bad Smells in Code
 
How to code
How to codeHow to code
How to code
 
Single Responsibility Principle
Single Responsibility PrincipleSingle Responsibility Principle
Single Responsibility Principle
 
Clean code - DSC DYPCOE
Clean code - DSC DYPCOEClean code - DSC DYPCOE
Clean code - DSC DYPCOE
 
Code quality
Code quality Code quality
Code quality
 
A Pragmatic Approach
A Pragmatic ApproachA Pragmatic Approach
A Pragmatic Approach
 
YAGNI Principle and Clean Code
YAGNI Principle and Clean CodeYAGNI Principle and Clean Code
YAGNI Principle and Clean Code
 
Code Metrics
Code MetricsCode Metrics
Code Metrics
 
Cinci ug-january2011-anti-patterns
Cinci ug-january2011-anti-patternsCinci ug-january2011-anti-patterns
Cinci ug-january2011-anti-patterns
 
Another Tale of Two Patterns
Another Tale of Two PatternsAnother Tale of Two Patterns
Another Tale of Two Patterns
 
Code smell overview
Code smell overviewCode smell overview
Code smell overview
 
Principled And Clean Coding
Principled And Clean CodingPrincipled And Clean Coding
Principled And Clean Coding
 
Writing Readable Code
Writing Readable CodeWriting Readable Code
Writing Readable Code
 
Clean code-v2.2
Clean code-v2.2Clean code-v2.2
Clean code-v2.2
 
Basics of writing clean code
Basics of writing clean codeBasics of writing clean code
Basics of writing clean code
 

Recently uploaded

Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...soniya singh
 
Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Velvetech LLC
 
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanySuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanyChristoph Pohl
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackVICTOR MAESTRE RAMIREZ
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...Christina Lin
 
Intelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmIntelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmSujith Sukumaran
 
Implementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureImplementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureDinusha Kumarasiri
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...gurkirankumar98700
 
What are the key points to focus on before starting to learn ETL Development....
What are the key points to focus on before starting to learn ETL Development....What are the key points to focus on before starting to learn ETL Development....
What are the key points to focus on before starting to learn ETL Development....kzayra69
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)OPEN KNOWLEDGE GmbH
 
MYjobs Presentation Django-based project
MYjobs Presentation Django-based projectMYjobs Presentation Django-based project
MYjobs Presentation Django-based projectAnoyGreter
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...OnePlan Solutions
 
chapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptchapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptkotipi9215
 
Folding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesFolding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesPhilip Schwarz
 
Asset Management Software - Infographic
Asset Management Software - InfographicAsset Management Software - Infographic
Asset Management Software - InfographicHr365.us smith
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...stazi3110
 
Cloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEECloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEEVICTOR MAESTRE RAMIREZ
 
Unveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsUnveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsAhmed Mohamed
 
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024StefanoLambiase
 
Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)Hr365.us smith
 

Recently uploaded (20)

Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
 
Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...
 
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanySuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStack
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
 
Intelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmIntelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalm
 
Implementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureImplementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with Azure
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
 
What are the key points to focus on before starting to learn ETL Development....
What are the key points to focus on before starting to learn ETL Development....What are the key points to focus on before starting to learn ETL Development....
What are the key points to focus on before starting to learn ETL Development....
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)
 
MYjobs Presentation Django-based project
MYjobs Presentation Django-based projectMYjobs Presentation Django-based project
MYjobs Presentation Django-based project
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...
 
chapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptchapter--4-software-project-planning.ppt
chapter--4-software-project-planning.ppt
 
Folding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesFolding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a series
 
Asset Management Software - Infographic
Asset Management Software - InfographicAsset Management Software - Infographic
Asset Management Software - Infographic
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
 
Cloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEECloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEE
 
Unveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsUnveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML Diagrams
 
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
 
Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)
 

Code Smells - Refactoring

  • 1. Refuctoring (The process of taking a well-designed piece of code and, through a series of small, reversible changes, making it completely unmaintainable by anyone except yourself.)
  • 2. Code Smells Well it doesn't have a nose... but it definitely can stink! Ingredients ● Comments ● Long Method, Large Class ● Long parameter list ● Duplicated code ● Dead Code ● Temporary variables ● Conditional Complexity ● Combinatorial Explosion ● Uncommunicative/Inconsistent Names
  • 3. Comments ● The best comment is a good name for a method or class. ● The code is is supposed to explain itself. In that case comments are not needed Comments can be useful ● When explaining why something is being implemented in a particular way. ● When explaining complex algorithms (when all other methods for simplifying the algorithm have been tried and come up short).
  • 4. Long Methods & Long Classes (God Class) Classes usually start small. But over time, they get bloated as the program grows. As is the case with long methods as well,
  • 6. Duplicated Code Duplicated code is the bane of software development. Stamp out duplication whenever possible. You should always be on the lookout for more subtle cases of near-duplication, too. Don't Repeat Yourself!
  • 7. Dead Code ● When requirements for the software have changed or corrections have been made, nobody had time to clean up the old code. ● Such code could also be found in complex conditionals, when one of the branches becomes unreachable (due to error or other circumstances).
  • 8. Temporary Variables ● Temporary variables are quick and easy way to store and manipulate data around. ● But over time they stick around you with bad smell.
  • 9. Conditional Complexity ● Watch out for large conditional logic blocks, particularly blocks that tend to grow larger or change significantly over time. Consider alternative object- oriented approaches such as decorator, strategy.
  • 10. Combinatorial Explosion ● You have lots of code that does almost the same thing.. but with tiny variations in data or behavior.
  • 11. Uncommunicative/Inconsistent Names ● Does the name of the method succinctly describe what that method does? Could you read the method's name to another developer and have them explain to you what it does? If not, rename it or rewrite it. ● $category or $cat ? ● $cat or $c ? ● $subcategory or $SubCategory or $sub_category or $s_cat or $s_c
  • 12. There are two ways to write error-free programs; Only the third one works.(Alan Jay Perlis) Shobi P P shobi@storat.com Reference https://blog.codinghorror.com/code-smells/

Editor's Notes

  1. getListingBanners()