Should Functions Be Camel Case?

Should Functions Be Camel Case?

According to PSR-1, class names should be in PascalCase, class constants should be in MACRO_CASE, and function and method names should be in camelCase.

Do you camelCase functions?

camelCase is a naming convention in which the first letter of each word in a compound word is capitalized, except for the first word. Software developers often use camelCase when writing source code. camelCase is useful in programming since element names cannot contain spaces.

Should function names be capitalized?

All methods and functions should begin with a capital letter. The first letter of each word should also be capitalized. Special characters such as dashes and underscores are prohibited.

David Miller
Author

David Miller

David Miller brings 15 years of experience in global economics, personal finance strategy, and market dynamics. He specializes in turning complex economic trends into actionable insights for everyday readers.