PHP评论#vs// [英] PHP Comments # vs //
本文介绍了PHP评论#vs//的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
最近我一直在使用#
而不是//
在我的代码中执行单行注释.但是,我看到人们必须喜欢//
.
Lately I've been using #
instead of //
for doing single line comments inside my Code. However, I see must of the people prefer //
.
是否有特定的原因更喜欢它们而不是#
?表现?文件重量?有什么吗?
Is there a particular reason for preferring them instead of #
? Performance? File weight? Anything?
推荐答案
我不会说改变任何事情;这只是一个习惯问题:
It doesn't change a single thing, I'd say ; it's just a matter of habits :
-
//
来自C ,并且存在许多人使用的几种语言. -
#
来自shell 和Perl,并且不存在与//
一样多的重要"语言,因此使用它的人越来越少.
//
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.
为什么这两个都可以在PHP中使用?好吧,PHP是由人们都熟悉C,Shell和Perl的人构建的,他们已经从这些语言中带来了他们喜欢的东西;-)
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 ;-)
这篇关于PHP评论#vs//的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文