Why are there Ps after variables? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Why are there Ps after variables?

Does it make a difference if I omit them? For example: if (isMale (genderp) == true) { if (isAvailable (statusp) == true) return 850 + (driversGroup (experiencep))+ (ageGroup (agep)) + 10 + 40; else return 850 + (driversGroup (experiencep))+ (ageGroup (agep)) + 10; } else if (isAvailable (statusp) == true) return 850 + (driversGroup (experiencep))+ (ageGroup (agep)) + 40; else return 850 + (driversGroup (experiencep))+ (ageGroup (agep));

19th Sep 2017, 8:39 PM
gorgamin
gorgamin - avatar
2 Answers
+ 10
depends. if you do not change the declaration of the various variable names then yes, it matters if you omit the p from these variables. I am unsure why the original coder has included the p in these variable names. The code snippet you have provided does not contain enough information to judge why this has occurred. Perhaps there are other variables in the same scope which are named the same (minus the p) ☺
19th Sep 2017, 9:03 PM
jay
jay - avatar
+ 1
Thanks. I removed all the Ps in the entire code and it still works.
25th Sep 2017, 6:13 AM
gorgamin
gorgamin - avatar