Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to deal with numbers in camelcase naming policy?

Can anyone tell me how to rename variables like play_size_32,play_url_24_m4a in camelcase naming policy? I am deserializing json string, but I don't know how to deal with such variable names.

like image 608
Cauchy Schwarz Avatar asked May 28 '16 06:05

Cauchy Schwarz


People also ask

Can you use numbers in CamelCase?

Camel case is the practice of capitalizing the first letter of each word in a series and then removing spaces, numbers, underscores, hyphens, and other special characters. This leaves a concatenation of words that is combined into a single string with various letters capitalized throughout.

How do you name a CamelCase variable?

Camel case starts each new word in a complex variable name with an uppercase letter. You can capitalize the first word as well or leave it lowercase. When the first letter of the variable starts with an uppercase letter, it is known as upper camel case.

How does the CamelCase naming convention work?

CamelCase is a way to separate the words in a phrase by making the first letter of each word capitalized and not using spaces. It is commonly used in web URLs, programming and computer naming conventions. It is named after camels because the capital letters resemble the humps on a camel's back.

Should variables be in camel case?

Methods should be verbs in lowerCamelCase or a multi-word name that begins with a verb in lowercase; that is, with the first letter lowercase and the first letters of subsequent words in uppercase. Local variables, instance variables, and class variables are also written in lowerCamelCase .


1 Answers

playSize32, playUrl24M4a

I agree that camel case is not great when dealing with numbers, you should try to avoid variables names containing them

like image 120
gbalduzzi Avatar answered Sep 22 '22 15:09

gbalduzzi