[ https://issues.apache.org/jira/browse/LUCENE-10136?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17426318#comment-17426318 ]
ASF subversion and git services commented on LUCENE-10136: ---------------------------------------------------------- Commit a613021ca4823c5eb8c9cf6947095bc5098ac500 in lucene's branch refs/heads/main from Dawid Weiss [ https://gitbox.apache.org/repos/asf?p=lucene.git;h=a613021 ] LUCENE-10136: allow 'var' declarations in source code (be reasonable though). (#368) > Lift the restriction on using 'var' variables > --------------------------------------------- > > Key: LUCENE-10136 > URL: https://issues.apache.org/jira/browse/LUCENE-10136 > Project: Lucene - Core > Issue Type: Wish > Affects Versions: main (9.0) > Reporter: Dawid Weiss > Priority: Trivial > Time Spent: 20m > Remaining Estimate: 0h > > Can we lift the restriction on using 'var' on the main branch? I know it's a > double-edged sword and sometimes it leads to unreadable code, especially when > you invoke a method, for example: > {code} > var foo = myMethodThatDoesSomething(); > {code} > but in many, many, *many* cases the var keyword shortens the code and the > type is obvious from the context. This happens in loops, try-with-resources > and local variables. > {code} > for (var it = array.iterator(); it.hasNext();) { ... } > try (var foo = new MyFoo()) { ... } > {code} > I'd say - let's allow vars (and other language features) and use common > sense. If something is not clear in the context, type the variable. If > something is obvious, use shortcuts. -- This message was sent by Atlassian Jira (v8.3.4#803005) --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org For additional commands, e-mail: issues-h...@lucene.apache.org