|
From: Javier S. <js...@si...> - 2001-09-02 00:54:15
|
I know the shell command grep, but can you explain to me, how do you work with it ? Are you using it just to find key words ? or to makes replacements ? I just want to undertstand how do you work ;-) About the "SQL queries problem" I was thinking to extract all SQL queries (or sql bits), into one file, it is just an idea to simplify database tunning or other code maintenance ... PHP is not SQL, so why we mixed both every time ;-) ... An important part of work made for a PHP application is SQL debugging, isn't it ? Perhaps it is a bad idea, because i have never see this done in any PHP application ... What do you think about ? As i said it is just an idea ;-) Ben Curtis wrote: >Well, grep does let you display lines after the match -- but how many should I specify when grepping? Two, four? Some queries are only one line -- some are four. I don't want non-query lines when grepping for queries, and I certainly don't want to cut off part of one. > >Looking at query.php, even the queries that are wrapped don't abide an 80 character limit -- most lines are still going past 80 columns. So, indenting here did little to improve editing in a terminal editor. Additionally, the indenting is not consistent and looks rather haphazard. If we are going to break-up and indent queries, I at least want them to look consistent and strictly abide the 80 column limit (as the rest of the code should). > >Since I want to get a release out, I'm not inclined now to go through all the code and beautify these queries, so I suggest at least for now that we go back to single lines for queries. Then after this release you can take another shot at convincing me that indented is better. :) > >On Sat, Sep 01, 2001 at 07:42:21PM +0200, Javier Sixto wrote: > >>I'm ok with you, i like to split queries too ;-) >> >>Patrick Mairif wrote: >> >>>On Sat, Sep 01, 2001 at 08:55:16AM -0700, Ben Curtis wrote: >>> >>>>With Patrick's last commit I was reminded that I need to get the coding >>>>standards document written. :) One thing I like is to keep queries all on >>>>one line (for ease in grepping). The downside is that it's not as easy to >>>>deal with in terminal text editors like vi and emacs. Thoughts? >>>> >>>you can tell grep to print some lines before and after match, so this >>>is no reason! And I think sql strings splitted over more lines >>>increases readability a lot! >>> > |