# Classes final by default

**URL:** <https://discuss.kotlinlang.org/t/classes-final-by-default/166>\
**Category:** Language Design\
**Created:** [July 28, 2015, 6:27pm UTC](https://discuss.kotlinlang.org/t/classes-final-by-default/166 "2015-07-28T18:27:45Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![mikehearn](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.kotlinlang.org/mikehearn/32/1424_2.png) [@mikehearn](https://discuss.kotlinlang.org/u/mikehearn)\
**Post date:** [July 29, 2015, 10:23am UTC](https://discuss.kotlinlang.org/t/classes-final-by-default/166/2 "2015-07-29T10:23:38Z")

</div>

I don't think the semantics of the language should depend on compiler switches. But this problem has bitten me too, with the added quirk that the framework I used didn't even give a startup error .... it just failed to create database transactions, causing writes to be silently discarded! I lost several days debugging that one.

A better solution might be an IDE warning where if it detects you’re using some kind of class enhancer framework or a class that contains some kind of injection annotation, it can highlight the class definition in yellow if it’s not open.

Or yeah, just invert the default for everyone. I suspect it’ll cause more pain than it’s worth.

---

_[View the full topic](https://discuss.kotlinlang.org/t/classes-final-by-default/166)._
