SlideShare a Scribd company logo
linkedin/borislit github.com/borislit@borislitborisl@wix.com
Name in Vain
Improving design one word at a time
Hi.
I am Boris Litvinsky
Frontend Developer @ WIX Bookings
Lithuania
Ukraine
Vilnius
Kiev
Dnipro
Wix Engineering Locations
Israel
Tel-Aviv
Be’er Sheva
Readable
Code
01
Readable by Computer
is Easy
Readable by Humans
is Difficult
It’s much more like
studying 17th century
French poetry -
WTF did this guy mean?
“
“
“
David Heinemeier Hansson
You can name
your kid anything
you want.
There are no laws.
There should be
couple of laws
- Louis CK
“
“
Naming
Matters
02
Naming Matters
▪ Discussing Names = Discussing the Product
▪ May signify a problem in a design
▪ Shortens the learning curve
▪ “The Six Month Rule”
http://blog.marcomonteiro.net/post/the-six-months-rule
The reason that they think
the old code is a mess is
because of a fundamental
law of programming:
It’s harder to read code
than to write it.
“
“
“
David Heinemeier HanssonJoel Spolsky
Anatomy of
Bad Names
03
Vague, Meaningless Names
▪ Your “Managers”, Your “Services”, Your “Handler”
▪ Your “object”, Your “data”
Don't express
their role in
the system
Eventually
become a
bag of
methods
Usually cause
SRP violation
=
Increase size
& coupling
Don't express
their role in
the system
Eventually
become a
bag of
methods
Abbreviations are Ambitious
▪ char - is it a “character” or “characteristic” ?
▪ mod - is it “modify” or “modulo”?
Compels you
to read the
code
You can’t use
them in a
conversation
Compels you
to read the
code
Too Many Words
▪ dontTryToWriteWholeSentencesWithYourDamnFunctionName
▪ How is “company_person” better than “employee” ?
http://wiki.c2.com/?MeaningfulName
http://hilton.org.uk/blog/naming-smells
Difficult to
remember
Difficult to
spot differences
Difficult to
remember
oneHorribleDescriptiveLongNameVersion
vs
oneHorribleDestructiveLongSameVersion
You probably
don’t know
what it is
You probably
don’t know
what it is
× ✓car.startEngine() car.start()
Excess Nouns in Function Names
Nouns are
implementation
details, that the
caller knows
about
▪ Perfectly fine if the noun is one of the parameters, e.g.,
car.startPowerProvider(powerProvider)
▪ Getters are horrible
Too Much Context
×
✓
class PendingPaymentRecord() {}
class PaymentRecord() {}
Prevents
reuse of
objects/meth
ods in other
valid cases
We Resolve to Basic Instincts
Lack of Domain Knowledge
Domain - A subject the software is being developed for.
But...
▪ How can you build software without understanding the problem it’s solving?
▪ How can you apply new requirements to software that doesn't reflect the domain?
▪ How can you name something you don’t understand?
Name in Vain: Improving design one word at a time
Consumer Vocabulary
Domain Model
A simplified representation of
domain knowledge.
* Created by software expert & domain expert
Defines a
Ubiquitous
Language -
vocabulary used
by everybody,
everywhere
Names should reference the
Ubiquitous Language
Name in Vain: Improving design one word at a time
Clean code reads like
well-written prose
“ “
“
David Heinemeier HanssonRobert C. Martin
Well Written Prose
“Prose is a form of
language that exhibits a
grammatical structure and
a natural flow of speech” -
Wikipedia
https://en.wikipedia.org/wiki/Prose
https://www.citerus.se/specification-pattern-as-a-re
factoring-tool
//Example 1
if(car.speed() > 2 * SPEED_LIMIT) {
speaker.generateAlert('Police reported ahead');
}
//Example 2
const candidateCarSpecification = colorRed
.and(inApprovedCity.or(convertible));
if (candidateCarSpecification.isSatisfiedBy(car)) {
//...
}
Classes Nouns
● Should describe the role it fulfils in the system
● Should allow the class to be easily located and evaluated
Methods
▪ Help us identify additional responsibilities, e.g., DoesThisAndThat()
https://www.youtube.com/watch?v=4cVZvoFGJTU&t=239s
RuleEvaluator
+evaluate(string)
-parseAdjunctTerm()
-parseFactorTerm()
-parseAdjunct()
-hasMoreTokens()
-getNextToken()
RuleEvaluator
+evaluate(string)
-parseAdjunctTerm()
-parseFactorTerm()
-parseAdjunct()
RuleTokenizer
+hasMoreTokens()
+getNextToken()
Methods
▪ Help us identify additional responsibilities
▪ Those without side-effects should read as noun e.g player.balance()
▪ Those with side-effects should read as verbs e.g player.start()
▪ Can include prepositions (Of, To, For) to help describe relationships to
parameters e.g payAmountOf(...) or moveTo(...)
▪ Describe everything it does - no surprises!
Interfaces Adjectives
▪ There’s no “I” in Interface
▪ Describes a capability
▪ Deliverable, Shippable, Printable
Booleans Auxiliary / Helping Verbs
▪ is, should, can, has
▪ if( piece.isOn(square) ) {...}
if( player.hasBalanceOf(amount) ) {...}
if( player.canPurchase(property) ) {...}
6 Things to Remember
★
Renaming
is part of
refactoring!
★
Use the
consumer’s
vocabulary
★
Make sure you
can read what
you write
★
Be open for
feedback
★
Communicate
names/renames
to other people.
Be consistent
Don’t give up!
Struggle for every word.
Thank You
linkedin/borislit github.com/borislit@borislitborisl@wix.com
Q&A
linkedin/borislit github.com/borislit@borislitborisl@wix.com

More Related Content

PDF
Being a "Mobile Designer"
PPTX
50 Shades of Green
PDF
AMAR - Projeto Jardim Oceânico Presente
PPTX
Planificaciondesistemas er
PPTX
3Com ACCB-100
PPTX
3Com 08004E34R5B9
PDF
Kim kleps 10 most dangerous sports
PPTX
Pembangunan mapan
Being a "Mobile Designer"
50 Shades of Green
AMAR - Projeto Jardim Oceânico Presente
Planificaciondesistemas er
3Com ACCB-100
3Com 08004E34R5B9
Kim kleps 10 most dangerous sports
Pembangunan mapan

Viewers also liked (7)

PPTX
Forced marriage
PDF
2.5 Bhk Flats in Pune
PPTX
Circuito electrico 11 2
PDF
The art of writing proper paragraphs
DOCX
Informe presupuesto de produccion
PPT
Untitled-228
Forced marriage
2.5 Bhk Flats in Pune
Circuito electrico 11 2
The art of writing proper paragraphs
Informe presupuesto de produccion
Untitled-228
Ad

Similar to Name in Vain: Improving design one word at a time (20)

PDF
Agile_goa_2013_clean_code_tdd
PDF
Code Inspection
PDF
Naming Things
PPT
Raya code quality guidelines - enhancing readability
PPTX
Code reviews
PPT
Coding Standards
PDF
Clean code and code smells
PDF
Clean code: meaningful Name
PPT
Clean code
PDF
Clean Code
PDF
[DevDay2018] Let’s all get along. Clean Code please! - By: Christophe K. Ngo,...
PDF
A Primer on High-Quality Identifier Naming [ASE 2022]
PDF
How to tell a better story (in code)(final)
PDF
Naming Things Book : Simple Book Review!
PPTX
Naming Conventions
PDF
Naming guidelines for professional programmers
PDF
高品質軟體的基本動作 101 for NTHU
PDF
Naming Things (with notes)
TXT
PPT
Clean Code
Agile_goa_2013_clean_code_tdd
Code Inspection
Naming Things
Raya code quality guidelines - enhancing readability
Code reviews
Coding Standards
Clean code and code smells
Clean code: meaningful Name
Clean code
Clean Code
[DevDay2018] Let’s all get along. Clean Code please! - By: Christophe K. Ngo,...
A Primer on High-Quality Identifier Naming [ASE 2022]
How to tell a better story (in code)(final)
Naming Things Book : Simple Book Review!
Naming Conventions
Naming guidelines for professional programmers
高品質軟體的基本動作 101 for NTHU
Naming Things (with notes)
Clean Code
Ad

More from Boris Litvinsky (7)

PDF
Road to Async Nirvana
PDF
ReactiveConf - Not all indecision are bad
PDF
Your IDE Deserves Better
PDF
The ultimate guide for Software Procrastination
PDF
CDD @ FED
PDF
Test Driven Culture
PDF
How to build 100m websites
Road to Async Nirvana
ReactiveConf - Not all indecision are bad
Your IDE Deserves Better
The ultimate guide for Software Procrastination
CDD @ FED
Test Driven Culture
How to build 100m websites

Recently uploaded (20)

PDF
Product Update: Alluxio AI 3.7 Now with Sub-Millisecond Latency
PDF
How to Make Money in the Metaverse_ Top Strategies for Beginners.pdf
PDF
EN-Survey-Report-SAP-LeanIX-EA-Insights-2025.pdf
DOCX
Greta — No-Code AI for Building Full-Stack Web & Mobile Apps
PDF
DNT Brochure 2025 – ISV Solutions @ D365
PDF
Cost to Outsource Software Development in 2025
PPTX
Computer Software and OS of computer science of grade 11.pptx
PPTX
Oracle Fusion HCM Cloud Demo for Beginners
PDF
STL Containers in C++ : Sequence Container : Vector
PDF
EaseUS PDF Editor Pro 6.2.0.2 Crack with License Key 2025
PPTX
Weekly report ppt - harsh dattuprasad patel.pptx
PPTX
Why Generative AI is the Future of Content, Code & Creativity?
PDF
Topaz Photo AI Crack New Download (Latest 2025)
PDF
AI/ML Infra Meetup | Beyond S3's Basics: Architecting for AI-Native Data Access
PPTX
Patient Appointment Booking in Odoo with online payment
PPTX
Advanced SystemCare Ultimate Crack + Portable (2025)
PPTX
Embracing Complexity in Serverless! GOTO Serverless Bengaluru
PPTX
assetexplorer- product-overview - presentation
PDF
Designing Intelligence for the Shop Floor.pdf
PDF
AI-Powered Threat Modeling: The Future of Cybersecurity by Arun Kumar Elengov...
Product Update: Alluxio AI 3.7 Now with Sub-Millisecond Latency
How to Make Money in the Metaverse_ Top Strategies for Beginners.pdf
EN-Survey-Report-SAP-LeanIX-EA-Insights-2025.pdf
Greta — No-Code AI for Building Full-Stack Web & Mobile Apps
DNT Brochure 2025 – ISV Solutions @ D365
Cost to Outsource Software Development in 2025
Computer Software and OS of computer science of grade 11.pptx
Oracle Fusion HCM Cloud Demo for Beginners
STL Containers in C++ : Sequence Container : Vector
EaseUS PDF Editor Pro 6.2.0.2 Crack with License Key 2025
Weekly report ppt - harsh dattuprasad patel.pptx
Why Generative AI is the Future of Content, Code & Creativity?
Topaz Photo AI Crack New Download (Latest 2025)
AI/ML Infra Meetup | Beyond S3's Basics: Architecting for AI-Native Data Access
Patient Appointment Booking in Odoo with online payment
Advanced SystemCare Ultimate Crack + Portable (2025)
Embracing Complexity in Serverless! GOTO Serverless Bengaluru
assetexplorer- product-overview - presentation
Designing Intelligence for the Shop Floor.pdf
AI-Powered Threat Modeling: The Future of Cybersecurity by Arun Kumar Elengov...

Name in Vain: Improving design one word at a time

  • 2. Hi. I am Boris Litvinsky Frontend Developer @ WIX Bookings Lithuania Ukraine Vilnius Kiev Dnipro Wix Engineering Locations Israel Tel-Aviv Be’er Sheva
  • 6. It’s much more like studying 17th century French poetry - WTF did this guy mean? “ “ “ David Heinemeier Hansson
  • 7. You can name your kid anything you want. There are no laws. There should be couple of laws - Louis CK “ “
  • 9. Naming Matters ▪ Discussing Names = Discussing the Product ▪ May signify a problem in a design ▪ Shortens the learning curve ▪ “The Six Month Rule” http://blog.marcomonteiro.net/post/the-six-months-rule
  • 10. The reason that they think the old code is a mess is because of a fundamental law of programming: It’s harder to read code than to write it. “ “ “ David Heinemeier HanssonJoel Spolsky
  • 12. Vague, Meaningless Names ▪ Your “Managers”, Your “Services”, Your “Handler” ▪ Your “object”, Your “data” Don't express their role in the system Eventually become a bag of methods Usually cause SRP violation = Increase size & coupling Don't express their role in the system Eventually become a bag of methods
  • 13. Abbreviations are Ambitious ▪ char - is it a “character” or “characteristic” ? ▪ mod - is it “modify” or “modulo”? Compels you to read the code You can’t use them in a conversation Compels you to read the code
  • 14. Too Many Words ▪ dontTryToWriteWholeSentencesWithYourDamnFunctionName ▪ How is “company_person” better than “employee” ? http://wiki.c2.com/?MeaningfulName http://hilton.org.uk/blog/naming-smells Difficult to remember Difficult to spot differences Difficult to remember oneHorribleDescriptiveLongNameVersion vs oneHorribleDestructiveLongSameVersion You probably don’t know what it is You probably don’t know what it is
  • 15. × ✓car.startEngine() car.start() Excess Nouns in Function Names Nouns are implementation details, that the caller knows about ▪ Perfectly fine if the noun is one of the parameters, e.g., car.startPowerProvider(powerProvider) ▪ Getters are horrible
  • 16. Too Much Context × ✓ class PendingPaymentRecord() {} class PaymentRecord() {} Prevents reuse of objects/meth ods in other valid cases
  • 17. We Resolve to Basic Instincts
  • 18. Lack of Domain Knowledge Domain - A subject the software is being developed for.
  • 19. But... ▪ How can you build software without understanding the problem it’s solving? ▪ How can you apply new requirements to software that doesn't reflect the domain? ▪ How can you name something you don’t understand?
  • 21. Consumer Vocabulary Domain Model A simplified representation of domain knowledge. * Created by software expert & domain expert Defines a Ubiquitous Language - vocabulary used by everybody, everywhere
  • 22. Names should reference the Ubiquitous Language
  • 24. Clean code reads like well-written prose “ “ “ David Heinemeier HanssonRobert C. Martin
  • 25. Well Written Prose “Prose is a form of language that exhibits a grammatical structure and a natural flow of speech” - Wikipedia https://en.wikipedia.org/wiki/Prose https://www.citerus.se/specification-pattern-as-a-re factoring-tool //Example 1 if(car.speed() > 2 * SPEED_LIMIT) { speaker.generateAlert('Police reported ahead'); } //Example 2 const candidateCarSpecification = colorRed .and(inApprovedCity.or(convertible)); if (candidateCarSpecification.isSatisfiedBy(car)) { //... }
  • 26. Classes Nouns ● Should describe the role it fulfils in the system ● Should allow the class to be easily located and evaluated
  • 27. Methods ▪ Help us identify additional responsibilities, e.g., DoesThisAndThat() https://www.youtube.com/watch?v=4cVZvoFGJTU&t=239s RuleEvaluator +evaluate(string) -parseAdjunctTerm() -parseFactorTerm() -parseAdjunct() -hasMoreTokens() -getNextToken() RuleEvaluator +evaluate(string) -parseAdjunctTerm() -parseFactorTerm() -parseAdjunct() RuleTokenizer +hasMoreTokens() +getNextToken()
  • 28. Methods ▪ Help us identify additional responsibilities ▪ Those without side-effects should read as noun e.g player.balance() ▪ Those with side-effects should read as verbs e.g player.start() ▪ Can include prepositions (Of, To, For) to help describe relationships to parameters e.g payAmountOf(...) or moveTo(...) ▪ Describe everything it does - no surprises!
  • 29. Interfaces Adjectives ▪ There’s no “I” in Interface ▪ Describes a capability ▪ Deliverable, Shippable, Printable
  • 30. Booleans Auxiliary / Helping Verbs ▪ is, should, can, has ▪ if( piece.isOn(square) ) {...} if( player.hasBalanceOf(amount) ) {...} if( player.canPurchase(property) ) {...}
  • 31. 6 Things to Remember ★ Renaming is part of refactoring! ★ Use the consumer’s vocabulary ★ Make sure you can read what you write ★ Be open for feedback ★ Communicate names/renames to other people. Be consistent Don’t give up! Struggle for every word.