Skip to content
This repository has been archived by the owner on Jul 24, 2023. It is now read-only.

use ' instead of " & use 0/1 instead of FALSE/TRUE #58

Closed
ghost opened this issue Sep 2, 2011 · 4 comments
Closed

use ' instead of " & use 0/1 instead of FALSE/TRUE #58

ghost opened this issue Sep 2, 2011 · 4 comments

Comments

@ghost
Copy link

ghost commented Sep 2, 2011

use ' instead of ", this is faster.
use 0/1 instead of FALSE/TRUE.

Change "null" case to Upper. NULL is constant. type

@DerManoMann
Copy link

Hmm, http://php.net/manual/en/language.types.null.php states:
"There is only one value of type null, and that is the case-insensitive keyword NULL." If it is case insensitive, it shouldn't make a difference I would think.

@garak
Copy link

garak commented Sep 5, 2011

  • the quotes issue is and old legend. Google about it and you'll find that there's no difference.
  • 0/1 instead of false/true is just wrong. 0 and 1 are integers, true and false are booleans
  • the case for constant is a convention: all constants should be uppercase, except for null, true, and false

@ghost
Copy link
Author

ghost commented Sep 5, 2011

||||"0/1 instead of false/true is just wrong. 0 and 1 are integers, true and false are booleans""""""
1- dont see that. First check it! get a benchmark with 0/1 - false/true

""""the case for constant is a convention: all constants should be uppercase, except for null, true, and false""""
2- lol. this is YOUR law??

@ghost ghost closed this as completed Sep 5, 2011
@garak
Copy link

garak commented Sep 5, 2011

Don't want to flame, but please consider:

  • benchmarks are not so useful. It's better to keep a clear, readable, consistent code. Most of cost of a code is related to humans (developers), not to machines (cpu, bandwith, etc.)
  • I didn't invent any conventions. Just google it around. Of course, you can use whatever you want in your project, but a public project should follow most accepted conventions as much as possible.

This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants