FAQ
Hi:
I noted there are a lot of tail white spaces in our codes,

it is better to remove them all, and we also should watch such ws
in furture.

a simple way to erase such ws in vim, use :%s /\s\+$//g

thanks

--
Laruence  Xinchen Hui
http://www.laruence.com/

Search Discussions

  • Rafael Kassner at Dec 24, 2011 at 11:09 am
    AFAIK, PHP files are transformed in bytecode before the execution, so
    white spaces will not interfere in nothing except more time to
    transfer the file over SFTP.

    It's pretty good to implement on our IDEs (and a lot of them is doing
    it), once trailing white spaces are annoying while we are developing.
    On Sat, Dec 24, 2011 at 4:21 AM, Laruence wrote:
    Hi:
    I noted there are a lot of tail white spaces in our codes,

    it is better to remove them all,  and we also should watch such ws
    in furture.

    a simple way to erase such ws in vim, use :%s /\s\+$//g

    thanks

    --
    Laruence  Xinchen Hui
    http://www.laruence.com/

    --
    PHP Internals - PHP Runtime Development Mailing List
    To unsubscribe, visit: http://www.php.net/unsub.php


    --
    Atenciosamente,
    Rafael Kassner
  • Pierre Joye at Dec 24, 2011 at 11:11 am
    hi!

    Laruence refers to the PHP C source code and removing trailing white
    spaces is a good thing as it is part of our CS.

    Go ahead Laruence :)
    On Sat, Dec 24, 2011 at 12:09 PM, Rafael Kassner wrote:
    AFAIK, PHP files are transformed in bytecode before the execution, so
    white spaces will not interfere in nothing except more time to
    transfer the file over SFTP.

    It's pretty good to implement on our IDEs (and a lot of them is doing
    it), once trailing white spaces are annoying while we are developing.
    On Sat, Dec 24, 2011 at 4:21 AM, Laruence wrote:
    Hi:
    I noted there are a lot of tail white spaces in our codes,

    it is better to remove them all,  and we also should watch such ws
    in furture.

    a simple way to erase such ws in vim, use :%s /\s\+$//g

    thanks

    --
    Laruence  Xinchen Hui
    http://www.laruence.com/

    --
    PHP Internals - PHP Runtime Development Mailing List
    To unsubscribe, visit: http://www.php.net/unsub.php


    --
    Atenciosamente,
    Rafael Kassner

    --
    PHP Internals - PHP Runtime Development Mailing List
    To unsubscribe, visit: http://www.php.net/unsub.php


    --
    Pierre

    @pierrejoye | http://blog.thepimp.net | http://www.libgd.org
  • Rafael Kassner at Dec 24, 2011 at 11:18 am
    Oh, shame on my, I was thinking about PHP code. Even so, this is
    coding standards for PHP C code. Have we this? This can be a good one.
    On Sat, Dec 24, 2011 at 9:11 AM, Pierre Joye wrote:
    hi!

    Laruence refers to the PHP C source code and removing trailing white
    spaces is a good thing as it is part of our CS.

    Go ahead Laruence :)
    On Sat, Dec 24, 2011 at 12:09 PM, Rafael Kassner wrote:
    AFAIK, PHP files are transformed in bytecode before the execution, so
    white spaces will not interfere in nothing except more time to
    transfer the file over SFTP.

    It's pretty good to implement on our IDEs (and a lot of them is doing
    it), once trailing white spaces are annoying while we are developing.
    On Sat, Dec 24, 2011 at 4:21 AM, Laruence wrote:
    Hi:
    I noted there are a lot of tail white spaces in our codes,

    it is better to remove them all,  and we also should watch such ws
    in furture.

    a simple way to erase such ws in vim, use :%s /\s\+$//g

    thanks

    --
    Laruence  Xinchen Hui
    http://www.laruence.com/

    --
    PHP Internals - PHP Runtime Development Mailing List
    To unsubscribe, visit: http://www.php.net/unsub.php


    --
    Atenciosamente,
    Rafael Kassner

    --
    PHP Internals - PHP Runtime Development Mailing List
    To unsubscribe, visit: http://www.php.net/unsub.php


    --
    Pierre

    @pierrejoye | http://blog.thepimp.net | http://www.libgd.org


    --
    Atenciosamente,
    Rafael Kassner
  • Derick Rethans at Dec 24, 2011 at 11:56 am

    On Sat, 24 Dec 2011, Pierre Joye wrote:

    Laruence refers to the PHP C source code and removing trailing white
    spaces is a good thing as it is part of our CS.

    Go ahead Laruence :)
    Please don't. Changing whitespace en-masse makes it a royal pain to do
    merges later. Please just fix them when you change the code on that line
    only.

    Derick

    --
    http://derickrethans.nl | http://xdebug.org
    Like Xdebug? Consider a donation: http://xdebug.org/donate.php
    twitter: @derickr and @xdebug
  • Johannes Schlüter at Dec 24, 2011 at 1:34 pm

    On Sat, 2011-12-24 at 11:56 +0000, Derick Rethans wrote:
    On Sat, 24 Dec 2011, Pierre Joye wrote:

    Laruence refers to the PHP C source code and removing trailing white
    spaces is a good thing as it is part of our CS.

    Go ahead Laruence :)
    Please don't. Changing whitespace en-masse makes it a royal pain to do
    merges later. Please just fix them when you change the code on that line
    only.
    It's not only bad for merges, also confusing with blame/annotate while
    identifying the reason for bug.

    johannes
    Derick

    --
    http://derickrethans.nl | http://xdebug.org
    Like Xdebug? Consider a donation: http://xdebug.org/donate.php
    twitter: @derickr and @xdebug
  • Laruence at Dec 24, 2011 at 1:46 pm

    2011/12/24 Johannes Schlüter <johannes@schlueters.de>:
    On Sat, 2011-12-24 at 11:56 +0000, Derick Rethans wrote:
    On Sat, 24 Dec 2011, Pierre Joye wrote:

    Laruence refers to the PHP C source code and removing trailing white
    spaces is a good thing as it is part of our CS.

    Go ahead Laruence :)
    Please don't. Changing whitespace en-masse makes it a royal pain to do
    merges later. Please just fix them when you change the code on that line
    only.
    It's not only bad for merges, also confusing with blame/annotate while
    identifying the reason for bug.
    hmm, yes, you are right :),

    actually, I am not saying that I am going to do such behavior, just
    remind us that we should watch such CS,

    since there have been lots of tail ws now... :)

    thanks
    johannes
    Derick

    --
    http://derickrethans.nl | http://xdebug.org
    Like Xdebug? Consider a donation: http://xdebug.org/donate.php
    twitter: @derickr and @xdebug


    --
    Laruence  Xinchen Hui
    http://www.laruence.com/
  • Pierre Joye at Dec 24, 2011 at 2:34 pm

    2011/12/24 Johannes Schlüter <johannes@schlueters.de>:

    It's not only bad for merges, also confusing with blame/annotate while
    identifying the reason for bug.
    Huh, since when do we commit or recommend to commit WS changes with
    actual changes?
  • Laruence at Dec 24, 2011 at 2:42 pm
    Hi:

    It is necessary that highlight the tail ws in view svn. that can help
    us avoid adding more tail ws ..

    :)

    thanks

    2011/12/24 Pierre Joye <pierre.php@gmail.com>:
    2011/12/24 Johannes Schlüter <johannes@schlueters.de>:
    It's not only bad for merges, also confusing with blame/annotate while
    identifying the reason for bug.
    Huh, since when do we commit or recommend to commit WS changes with
    actual changes?


    --
    Pierre

    @pierrejoye | http://blog.thepimp.net | http://www.libgd.org


    --
    Laruence  Xinchen Hui
    http://www.laruence.com/
  • Stas Malyshev at Dec 24, 2011 at 8:44 pm
    Hi!
    It's not only bad for merges, also confusing with blame/annotate while
    identifying the reason for bug.
    As soon as we move to git, IIRC git has ability to separate ws-changes
    from non-ws ones and do diffs/history while ignoring ws. I didn't figure
    out if you can do non-ws merge (I suspect you can since you can do
    non-ws diff manually and then apply it).
    So I'd suggest at least waiting till we get git running.
    --
    Stanislav Malyshev, Software Architect
    SugarCRM: http://www.sugarcrm.com/
    (408)454-6900 ext. 227
  • Pierre Joye at Dec 24, 2011 at 2:33 pm

    On Sat, Dec 24, 2011 at 12:56 PM, Derick Rethans wrote:
    On Sat, 24 Dec 2011, Pierre Joye wrote:

    Laruence refers to the PHP C source code and removing trailing white
    spaces is a good thing as it is part of our CS.

    Go ahead Laruence :)
    Please don't. Changing whitespace en-masse makes it a royal pain to do
    merges later. Please just fix them when you change the code on that line
    only.
    There is no deal or pain to fix them in all branches at once. There is
    no need either to do it all at once, but doing them while working on a
    file in a separate commit before the actual change is just fine and is
    a good practice.
  • Lester Caine at Dec 24, 2011 at 2:55 pm

    Pierre Joye wrote:
    Laruence refers to the PHP C source code and removing trailing white
    spaces is a good thing as it is part of our CS.

    Go ahead Laruence:)
    Please don't. Changing whitespace en-masse makes it a royal pain to do
    merges later. Please just fix them when you change the code on that line
    only.
    There is no deal or pain to fix them in all branches at once. There is
    no need either to do it all at once, but doing them while working on a
    file in a separate commit before the actual change is just fine and is
    a good practice.
    I'm with Derek ... having commits that are just WS corrections can be irritating
    when tracking changes ... but it would most definitely better to get them fixed
    before moving to git which would lump mass commits like that together in a
    change set and make rolling back changes a nightmare.

    Logically it makes a lot more sense simply to leave them alone until such time
    as a file is touched for other reasons ... and at that time then a separate
    commit of the WS prior to the bug fix IS good practice. Bundling a whole array
    of WS fixes across unrelated sections of code is not once you move to any DVCS
    system.

    --
    Lester Caine - G8HFL
    -----------------------------
    Contact - http://lsces.co.uk/wiki/?page=contact
    L.S.Caine Electronic Services - http://lsces.co.uk
    EnquirySolve - http://enquirysolve.com/
    Model Engineers Digital Workshop - http://medw.co.uk//
    Firebird - http://www.firebirdsql.org/index.php
  • Ángel González at Dec 24, 2011 at 10:34 pm

    On 24/12/11 15:55, Lester Caine wrote:
    I'm with Derek ... having commits that are just WS corrections can be
    irritating when tracking changes ... but it would most definitely
    better to get them fixed before moving to git which would lump mass
    commits like that together in a change set and make rolling back
    changes a nightmare.
    Perform that as the last svn commit?

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupphp-internals @
categoriesphp
postedDec 24, '11 at 6:22a
activeDec 24, '11 at 10:34p
posts13
users8
websitephp.net

People

Translate

site design / logo © 2022 Grokbase