Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Request for change in coding standards #2

Open
vaibhav-kaushal opened this issue Sep 24, 2013 · 3 comments
Open

Request for change in coding standards #2

vaibhav-kaushal opened this issue Sep 24, 2013 · 3 comments
Labels

Comments

@vaibhav-kaushal
Copy link
Member

Hello all,

Though the coding standards are pretty much defined already, I believe there can be some improvements. There are basically two which I have thought about:

  1. Tabs and Indentation: We are using tabs to make spaces. That creates 8 spaces on lines inside the block. A few levels down the switches, loops and conditions and the code goes out of the window (I do keep the file-list open on the side). Changing that to '4' spaces would make the code way more readable.
  2. Remove Closing PHP tags: The closing tags ?> are basically unnecessary for PHP files which do not contain any HTML. Though this does not change much, a single character pressed by a developer at the end by mistake can cause havoc (happenned with me quite some time ago). Removing them would improve things just a little bit.

Regards

@scottux
Copy link
Member

scottux commented Sep 24, 2013

The reasoning for tabs is that you can change pretty much any editor to display them as 1,2,4, or 8 spaces. They are a single character as opposed to four, which makes keyboard navigation a little easier and file sizes slightly smaller. That being said - I personally don't care as long as every line is properly indented by either one tab or 4 spaces and no one mixes the two. This debate goes back to the beginning of time.

I am not opposed to ditching the last ?> in class files. With output buffering on, there shouldn't be a whitespace issue but since it is a widely accepted practice, doesn't break anything, and saves characters, I don't see any problems with it.

@vaibhav-kaushal
Copy link
Member Author

It has caused problems for me and a couple of other fellows hence i said
about ?> thing. About tabs - i created an additional style in phpstorm and
i will use that for now and that should save time for me without causing
problems to others.

On Tuesday, September 24, 2013, Scott wrote:

The reasoning for tabs is that you can change pretty much any editor to
display them as 1,2,4, or 8 spaces. They are a single character as opposed
to four, which makes keyboard navigation a little easier and file sizes
slightly smaller. That being said - I personally don't care as long as
every line is properly indented by either one tab or 4 spaces and no one
mixes the two. This debate goes back to the beginning of time.

I am not opposed to ditching the last ?> in class files. With output
buffering on, there shouldn't be a whitespace issue but since it is a
widely accepted practice, doesn't break anything, and saves characters, I
don't see any problems with it.


Reply to this email directly or view it on GitHubhttps://github.com//issues/2#issuecomment-24996465
.

@vaibhav-kaushal
Copy link
Member Author

It has caused problems for me and a couple of other fellows hence i said
about ?> thing. About tabs - i created an additional style in phpstorm and
i will use that for now and that shud save time for me without causing
problems.

On Tuesday, September 24, 2013, Scott wrote:

The reasoning for tabs is that you can change pretty much any editor to
display them as 1,2,4, or 8 spaces. They are a single character as opposed
to four, which makes keyboard navigation a little easier and file sizes
slightly smaller. That being said - I personally don't care as long as
every line is properly indented by either one tab or 4 spaces and no one
mixes the two. This debate goes back to the beginning of time.

I am not opposed to ditching the last ?> in class files. With output
buffering on, there shouldn't be a whitespace issue but since it is a
widely accepted practice, doesn't break anything, and saves characters, I
don't see any problems with it.


Reply to this email directly or view it on GitHubhttps://github.com//issues/2#issuecomment-24996465
.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants