Blogpost about Clean Code in Elasticsearch


(Dominik) #1

Hi!

I've calculated some metrics regarding Clean Code for Elasticsearch 6.5 and wrote a blogpost about it.
Maybe the results are interesting for your next renovation :slight_smile:

Clean Code: The hard facts and figures

Greetings,

Dominik


(David Turner) #2

Thanks for the writeup, very interesting. If it weren't for our poor max-methods-per-class statistic it looks like Elasticsearch would have won every category :wink:

I am pleased to see that many of our largest classes are test classes. I'm not sure I agree with the analysis of Engine and InternalEngine:

Elastics Engine and InternalEngine had a similar destiny. These classes could easily be separated in a couple of subclasses, but as they are now they just cannot be clean.

You're right that they're big classes, but they have a fairly well-defined purpose and the boundary between them makes sense in the presence of the other Engine implementations. They also contain some of the most highly-concurrent and performance-critical code in the system, so I would be careful about using words like "easily" in their vicinity. From a user's perspective, "fast" beats "clean" every time.


(Dominik) #3

Thank you for your feedback! I should have been more careful with the wording there. While writing those kind of posts, it can quickly happen that you blame someone without having the necessary background knowledge.

That's true and you're doing a great job there :zap:


(system) closed #4

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.