# Blogpost about Clean Code in Elasticsearch

**URL:** <https://discuss.elastic.co/t/blogpost-about-clean-code-in-elasticsearch/164300>\
**Category:** Elasticsearch\
**Created:** [January 15, 2019, 11:23am UTC](https://discuss.elastic.co/t/blogpost-about-clean-code-in-elasticsearch/164300 "2019-01-15T11:23:37Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![djuelg](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/djuelg/32/39792_2.png) [@djuelg](https://discuss.elastic.co/u/djuelg)\
**Post date:** [January 15, 2019, 11:23am UTC](https://discuss.elastic.co/t/blogpost-about-clean-code-in-elasticsearch/164300/1 "2019-01-15T11:23:37Z")

</div>

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 🙂

[Clean Code: The hard facts and figures](https://craftcodecrew.com/clean-code-the-hard-facts-and-figures/)

Greetings,

Dominik

---

<div class="post-metadata">

**Author:** ![DavidTurner](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/davidturner/32/22453_2.png) [@DavidTurner](https://discuss.elastic.co/u/DavidTurner)\
**Post date:** [January 15, 2019, 11:59am UTC](https://discuss.elastic.co/t/blogpost-about-clean-code-in-elasticsearch/164300/2 "2019-01-15T11:59:50Z")

</div>

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 😉

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.

---

<div class="post-metadata">

**Author:** ![djuelg](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/djuelg/32/39792_2.png) [@djuelg](https://discuss.elastic.co/u/djuelg)\
**Post date:** [January 15, 2019, 12:29pm UTC](https://discuss.elastic.co/t/blogpost-about-clean-code-in-elasticsearch/164300/3 "2019-01-15T12:29:48Z")

</div>

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.

> [@DavidTurner](#):
>
> From a user's perspective, "fast" beats "clean" every time.

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

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [February 12, 2019, 12:30pm UTC](https://discuss.elastic.co/t/blogpost-about-clean-code-in-elasticsearch/164300/4 "2019-02-12T12:30:00Z")

</div>

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