# Rust-style variable shadowing

**URL:** <https://discuss.kotlinlang.org/t/rust-style-variable-shadowing/16338>\
**Category:** Language Design\
**Created:** [February 14, 2020, 5:14pm UTC](https://discuss.kotlinlang.org/t/rust-style-variable-shadowing/16338 "2020-02-14T17:14:43Z")\
**Posts on this page:** 1\
**Showing post:** 46

<div class="post-metadata">

**Author:** ![jstuyts](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.kotlinlang.org/jstuyts/32/2141_2.png) [@jstuyts](https://discuss.kotlinlang.org/u/jstuyts)\
**Post date:** [March 30, 2020, 6:08am UTC](https://discuss.kotlinlang.org/t/rust-style-variable-shadowing/16338/46 "2020-03-30T06:08:04Z")

</div>

> [@lkowarschick](#):
>
> […] , it also makes it less _readable_.

And have I wished for lots of that unreadable code during my career. Instead I got names like `timeout` and I had to go read the code (which usually means diving several classes deep), to figure out that the original developer meant `optionalTimeoutInSeconds`.

That unreadable code can save users of your API lots of time. You can avoid it in your internal code if you like, but I would appreciate it if you add all this “redundant” information to your API.

---

_[View the full topic](https://discuss.kotlinlang.org/t/rust-style-variable-shadowing/16338)._
