• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Dynamic Variable Name Request

Brian Berry

Well-Known Member
I'm developing gaming apps and it has come to my attention that Java and Kotlin don't offer dynamic variable names. I looked it up and it's just not supported by Java or Kotlin. dynamic variable names like
var["dynamic id"]="variable value";.......would cut my coding time and code footprint in half. Although it's not allowed I'd like to request it be added to Java and Kotlin. I looked around but I can't find the appropriate place to request this feature. I'm surprised it's not available because it was available in Flash ActionScript 7 years ago.

Where do I request features to be added?
 
I wouldn't hold out any hope for this feature being added to the language. It's a bad step because it goes against Java's strong type safety, and compile time syntax checking. Adding such a dynamic feature would introduce all kinds of run time errors and unpredictable behaviour. A very bad situation. Dynamic behaviour like this may be very convenient, but it doesn't lend itself to robust, maintainable, and reliable code.
 
Back
Top Bottom