# Nameof to get names of program elements

**URL:** <https://discuss.kotlinlang.org/t/nameof-to-get-names-of-program-elements/1518>\
**Category:** Language Design\
**Created:** [March 8, 2016, 3:27pm UTC](https://discuss.kotlinlang.org/t/nameof-to-get-names-of-program-elements/1518 "2016-03-08T15:27:04Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![marchy](https://avatars.discourse-cdn.com/v4/letter/m/f17d59/32.png) [@marchy](https://discuss.kotlinlang.org/u/marchy)\
**Post date:** [February 10, 2017, 8:12pm UTC](https://discuss.kotlinlang.org/t/nameof-to-get-names-of-program-elements/1518/4 "2017-02-10T20:12:23Z")

</div>

Absolutely agree with @ilya.gorbunov. Ruby has long had the :thing syntax which is used wildley different than “thing”.

Semantism is a core pinnacle of strongly-typed languages which Kotlin strongly firmly in. To suggest a string literal solution and leave it up to “IDE refactoring” is literally against the whole belief system which Kotlin is built upon, let alone being a huge known [Magic Strings](https://en.wikipedia.org/wiki/Magic_string) anti-pattern. This is why we have enums and the strongly-typed ‘when’ (Kotlin) / ‘switch’ (Swift) statements, to get AWAY from string-based, non-typed workarounds.

I wouldn’t expect this answer from an intermediate developer, let alone the you guys.

---

_[View the full topic](https://discuss.kotlinlang.org/t/nameof-to-get-names-of-program-elements/1518)._
