Why is capitalization of class names in Java (and others) just a suggestion, not a rule?

I wonder why Java, with its many security features and limitations, allows developers to start a class name with a lowercase letter, although it would be a very stupid idea to do this.

Or did I not pay attention to the case when this may be useful? Or is it just a case where you are not boxing a programmer?

+3
source share
5 answers

This is because it was believed that the programming language should not force agreements in previous years. But now the scene is changing a bit, and there is a favorable atmosphere for the "Conventions over configuration" approach, as in Ruby on rails.

So, in the future we can see more languages ​​/ frameworks based on conventions that will arise due to programming patterns and best practices in those days.

+2
source

Many things are stupid ideas - and most of them are not executed by the compiler.

At the end, the class, method, and variable name are named by convention, and this is true in most languages.

+2
source

, , - - , , .

0

, JLS . , . , , .

, , IIRC, , /, . , .

, . , Java . , C ++ ( , ), , , , .

0

Perl "use strict", ( ) . -strict javac, ? .jar .class, , - , (.java)... , -relaxed , , , - .

0

Source: https://habr.com/ru/post/1713443/


All Articles