DEV Community

Discussion on: Do You Struggle Naming Your Classes Well?

Collapse
 
rachelsoderberg profile image
Rachel Soderberg

I also like Robert C. Martin's constant suggesting to refactor for good names in "Clean Code" which has a similar feel to Fowler's. At one point (I wish I could find the exact quote again!) he recommends writing out a full, longer 'rule breaking' chunk of code in a method such as Fowler's sandwich, then going back over it and pulling out all the pieces that perform different jobs - if those pieces were written right, they should tell you their own names. Then you can rename or choose to remove sandwich altogether if it was only a placeholder.

Collapse
 
jamesmh profile image
James Hickey

👌