AB naming

At our team we have a lot of names for pair of interacting objects.

To be more clear let's take users. In messenger it's sender and receiver, in diary it's viewer and viewed, in profile it's visitor and visited and so on.

This goes worse when one have to name variable or argument for current user. It can be current, active, simply user or something else.

Posted on
Tagged in naming

When old is better than new

When you have a large codebase with dozens of packages and thousands of classes, sooner or later comes that moment, when you have to create a newer version of something: subproject, package, class, function, etc. But you can't just remove the previous version, you must support both for some period of time. And that time is not the best time of your life, trust me.

But misfortune never comes alone. Here unexpectedly comes one of the two hardest things in computer sciencenaming things. And in my experience, most of developers choose the dark side — suffix new (or 2 or similar) for new thing.

I'll try to explain, why using old for old thing is many times better.