Is it mandatory to give a function or variable name as a captial or small letter together? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Is it mandatory to give a function or variable name as a captial or small letter together?

"function leTTer() or function letter()" "var bOx = 1 or var box = 2 " which is better way and why?

14th Feb 2017, 6:07 PM
Emad Uddin
Emad Uddin - avatar
2 Answers
+ 6
it's all about readability. capital letter at the beginning for constants. camel lettering for function names like getValue(). underscores for variables like max_height. that's how I do it. it's easy to read and you see immediately what is what.
14th Feb 2017, 6:26 PM
Mario L.
Mario L. - avatar
+ 3
I got my answer. Thank you very much for your good explanation.
14th Feb 2017, 6:38 PM
Emad Uddin
Emad Uddin - avatar