Lately I’ve been using # instead of // for doing single line comments inside my code. However, I see most of the people prefer //.
Is there a particular reason for preferring them instead of #? Performance? File weight? Anything?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
It doesn’t change a single thing, I’d say ; it’s just a matter of habits :
//comes from C, and exists in several languages used by lots of people.#comes from shell and Perl, and exists in not as many “important” languages as//— so less people use it.And why are those two both available in PHP ? Well, PHP has been built with people knowing both C, Shell, and Perl, and they have brought what they liked from those languages 😉