Jump to content

Depreciated code?


Xurion

Recommended Posts

Hi all,

 

I'm having a debate over some standards that my employer wants to put in place for PHP coding. He has said we should use:

 

if((condition) and (condition)){

 

rather than:

 

if((condition) && (condition)){

 

His reason for this is because we use && in JavaScript. I've not seen anyone using the 'and' in if statements in forever. Is it depreciated? or is using it totally ok? Are there any differences comparing 'and' to &&?

 

Thanks in adv.

Link to comment
https://forums.phpfreaks.com/topic/110592-depreciated-code/
Share on other sites

Hi all,

 

I'm having a debate over some standards that my employer wants to put in place for PHP coding. He has said we should use:

 

if((condition) and (condition)){

 

rather than:

 

if((condition) && (condition)){

 

His reason for this is because we use && in JavaScript. I've not seen anyone using the 'and' in if statements in forever. Is it depreciated? or is using it totally ok? Are there any differences comparing 'and' to &&?

 

Thanks in adv.

 

What does it matter that you use '&&' in JavaScript?  Virtually all C-style code uses '&&' as logical AND.  I fail to see any gain this proposed switch would give.  Indeed, I think it would look awkaward, and perhaps even confusing.

Link to comment
https://forums.phpfreaks.com/topic/110592-depreciated-code/#findComment-567390
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.