Why does the java compiler not shorten the name by default? (performance and confusion)

I can't understand why the java compiler doesn't shorten the names of variables, parameters and method names by replacing them with some unique IDs

For example, a given course

public class VeryVeryVeryVeryVeryLongClass {

    private int veryVeryVeryVeryVeryLongInt = 3;

    public void veryVeryVeryVeryVeryLongMethod(int veryVeryVeryVeryVeryLongParamName) {
        this.veryVeryVeryVeryVeryLongInt = veryVeryVeryVeryVeryLongParamName;
    }
}

The compiled file contains all these very long names:

A simple unique ID won't speed up parsing. Will it provide the first confusion?

Solution

You assume that confusion is always needed, but it is not:

>Reflection breaks, JavaBeans and many frameworks rely on it > stack traces become completely unreadable > if you try to encode against a compiled jar, you end up with code like string name = p.a1() instead of string name = p.getname()

Confusion is usually the last step when you deliver a completed application, even so, it will not be used often unless the target platform has severe memory constraints

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>