Hi,

I don’t like `var` anywhere. Even if IntelliJ could automatically insert the 
concrete type it would still be a problem in the GH compare view. GH compare 
view is a real problem, because any time something is sufficiently obfuscated I 
have to bounce back and forth with an IDE, check out the code etc or just 
proceed with a weaker mental model of what is going on.

I have finite mental energy to expend every day and I don’t want to spend it 
hunting down and then recalling what each instance of var means repeatedly. It 
uses almost no energy to read past extra type information (formatting means I 
don’t even need to parse it) or do a little extra typing/autocomplete

Ariel

On Tue, Oct 29, 2024, at 1:13 PM, Štefan Miklošovič wrote:
> Hello,
> 
> this should give you an idea
> 
>  grep --include '*.java' -r 'var ' src/ test/ 
> 
> I think this is a new concept here which was introduced recently with support 
> of Java 11 / Java 17 after we dropped 8.
> 
> What is your opinion? Are we free to use it wherever we want? I am quite 
> conservative in this area and I will most probably still use types as we know 
> them but maybe in tests we might relax it a little bit? Or production code 
> with "var" is totally fine too without any concerns? I think this should be 
> covered by the code style.
> 
> Regards

Reply via email to