DEV Community

The Proximity Rule

Jason McCreary on October 12, 2017

I noticed a recurring style in my code lately. Actually, my pair noticed and asked me about it. I call it the Proximity Rule. I thought about calli...
Collapse
 
chrisvasqm profile image
Christian Vasquez

I find this to be super helpful when trying to extract methods from a complicated piece of code. Helps you organize and even notice if there are variables that can be inline without losing readability.

Collapse
 
gonedark profile image
Jason McCreary

Very good point. Grouping can help you see more easily see code prime for extraction.

Collapse
 
olivercole profile image
Oliver Cole

Reminds me of Arrange Act Assert.