RE: [PHP] Tip For The Day

2004-01-28 Thread Jay Blanchard
[snip]
Its all good, it's like inline braces versus dropped braces and every
other coding style debate :) There's no winner.
 
 pfft. Inline braces wins hands down ;p

It's on now.  Somebody set up the ring for the cage match.  Last brace 
standing at the end wins. ;)
[/snip]

I think that you meant to its already been broughten!, didn't you? Did
you know that you will find that bracing style has been debated since
the days of FORTRAN?

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Tip For The Day

2004-01-28 Thread Cesar Cordovez
Jay Blanchard wrote:
I think that you meant to its already been broughten!, didn't you? Did
you know that you will find that bracing style has been debated since
the days of FORTRAN?


Oh! Fortran 77!  I remember those times! =)  And I still think inline 
braces wins hands down!!!

Cesar

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


RE: [PHP] Tip For The Day

2004-01-28 Thread Ford, Mike [LSS]
On 28 January 2004 15:52, Cesar Cordovez wrote:

 Jay Blanchard wrote:
  I think that you meant to its already been broughten!, didn't
  you? Did you know that you will find that bracing style has been
  debated since the days of FORTRAN?
 
 
 Oh! Fortran 77!  I remember those times! =)

Fortran-77??  You were lucky!!  When *I* were a lad, it were FORTRAN-II with
its arithmetic-if, which like as not would jump up and bite you in
t'backside every time you dared to use it, and we thowt oursens damn' lucky
to have it an all...!!

  And I still think inline
 braces wins hands down!!! 

Personally, I HATE BRACES (I think I've mentioned this before).  Give me
PHP's alternative :-and-end-token syntax every time.
insert standard rant here

Cheers!

Mike

-
Mike Ford,  Electronic Information Services Adviser,
Learning Support Services, Learning  Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Beckett Park, LEEDS,  LS6 3QS,  United Kingdom
Email: [EMAIL PROTECTED]
Tel: +44 113 283 2600 extn 4730  Fax:  +44 113 283 3211 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Tip For The Day

2004-01-27 Thread Jay Blanchard
When constructing arrays where you are meddling with fixed width
substrings in a larger file make sure that the array item does not
contain a tab or you will certainly get unexpected results;

$arrBadInfo (
'AMARILLOHOUSE   ',
'KJONES  HOUSE   ', --- 16 characters wide, or is it?
'DCOLLINSCUSTSVC ',
'LAWTON  JCOLEMAN',
};

Both above appear to be 16 characters wide in the editor of your choice
(I am using Zend at the moment). However, if there is a tab between
KJONES and HOUSE, the HOUSE is moved to the right the appropriate number
of characters (or inappropriate as it were) and produce undesired
results. I have been working on this issue since 5 am this morning when
I finally decided to print_r() the array (consisting of 192 elements).
Lo and behold (and slapping my forehead thusly) we saw that there were
tabs in the result. Replacing the tabs with the proper number of spaces
fixed the result.

Actually this tip applies to all strings in which you expect there to be
a fixed width. Beware the tab, especially if you are bring in the data
from a source (cuttin' n' pastin') outside of your editor.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Tip For The Day

2004-01-27 Thread Robert Cummings
On Tue, 2004-01-27 at 09:19, Jay Blanchard wrote:
 When constructing arrays where you are meddling with fixed width
 substrings in a larger file make sure that the array item does not
 contain a tab or you will certainly get unexpected results;
 
 $arrBadInfo (
   'AMARILLOHOUSE   ',
   'KJONES  HOUSE   ', --- 16 characters wide, or is it?
   'DCOLLINSCUSTSVC ',
   'LAWTON  JCOLEMAN',
   };
 
 Both above appear to be 16 characters wide in the editor of your choice
 (I am using Zend at the moment). However, if there is a tab between
 KJONES and HOUSE, the HOUSE is moved to the right the appropriate number
 of characters (or inappropriate as it were) and produce undesired
 results. I have been working on this issue since 5 am this morning when
 I finally decided to print_r() the array (consisting of 192 elements).
 Lo and behold (and slapping my forehead thusly) we saw that there were
 tabs in the result. Replacing the tabs with the proper number of spaces
 fixed the result.
 
 Actually this tip applies to all strings in which you expect there to be
 a fixed width. Beware the tab, especially if you are bring in the data
 from a source (cuttin' n' pastin') outside of your editor.

Event better... turn your editor's tab character to 4 spaces, then your
code never contains those despicable tab characters and you won't
accidentally insert tabs into strings :)

Cheers,
Rob
-- 
..
| InterJinn Application Framework - http://www.interjinn.com |
::
| An application and templating framework for PHP. Boasting  |
| a powerful, scalable system for accessing system services  |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for   |
| creating re-usable components quickly and easily.  |
`'

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Tip For The Day

2004-01-27 Thread Alex Pilson
At 1:40 PM -0500 1/27/04, Robert Cummings wrote:
On Tue, 2004-01-27 at 09:19, Jay Blanchard wrote:
 When constructing arrays where you are meddling with fixed width
 substrings in a larger file make sure that the array item does not
 contain a tab or you will certainly get unexpected results;
 $arrBadInfo (
'AMARILLOHOUSE   ',
'KJONES  HOUSE   ', --- 16 characters wide, or is it?
'DCOLLINSCUSTSVC ',
'LAWTON  JCOLEMAN',
};
 Both above appear to be 16 characters wide in the editor of your choice
 (I am using Zend at the moment). However, if there is a tab between
 KJONES and HOUSE, the HOUSE is moved to the right the appropriate number
 of characters (or inappropriate as it were) and produce undesired
 results. I have been working on this issue since 5 am this morning when
 I finally decided to print_r() the array (consisting of 192 elements).
 Lo and behold (and slapping my forehead thusly) we saw that there were
 tabs in the result. Replacing the tabs with the proper number of spaces
 fixed the result.
 Actually this tip applies to all strings in which you expect there to be
 a fixed width. Beware the tab, especially if you are bring in the data
 from a source (cuttin' n' pastin') outside of your editor.
Event better... turn your editor's tab character to 4 spaces, then your
code never contains those despicable tab characters and you won't
accidentally insert tabs into strings :)
Couldn't you trim the items before placing into an array?
--
---
Alex Pilson
FlagShip Interactive, Inc.
[EMAIL PROTECTED]
---
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Tip For The Day

2004-01-27 Thread Chris Shiflett
--- Robert Cummings [EMAIL PROTECTED] wrote:
 Event better... turn your editor's tab character to 4 spaces, then
 your code never contains those despicable tab characters and you won't
 accidentally insert tabs into strings :)

And your file sizes increase by 25%, and you enforce your tab preference
on every other developer (rather than letting them choose their own), and
you'd better hope that everyone's editor can perform operations on
vertical selections of text, otherwise changes in identation becomes a
huge hassle.

I think tabs are great. :-)

Chris

=
Chris Shiflett - http://shiflett.org/

PHP Security Handbook
 Coming mid-2004
HTTP Developer's Handbook
 http://httphandbook.org/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Tip For The Day

2004-01-27 Thread Chris Shiflett
--- Alex Pilson [EMAIL PROTECTED] wrote:
 Couldn't you trim the items before placing into an array?

That would not have helped him, because trim() doesn't remove any
whitespace in between characters.

Chris

=
Chris Shiflett - http://shiflett.org/

PHP Security Handbook
 Coming mid-2004
HTTP Developer's Handbook
 http://httphandbook.org/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Tip For The Day

2004-01-27 Thread Robert Cummings
On Tue, 2004-01-27 at 13:49, Chris Shiflett wrote:
 --- Robert Cummings [EMAIL PROTECTED] wrote:
  Event better... turn your editor's tab character to 4 spaces, then
  your code never contains those despicable tab characters and you won't
  accidentally insert tabs into strings :)
 
 And your file sizes increase by 25%, and you enforce your tab preference

Hard-drives are cheap, and I don't see anyone writing scripts at the Gig
level yet.

 on every other developer (rather than letting them choose their own), and

Yes but now every developer knows there's 4 spaces there, and not 3
spaces and a tab, or 2 tabs and a space, all of which can look like crap
if you change your preferred tab width anyways.

 you'd better hope that everyone's editor can perform operations on
 vertical selections of text, otherwise changes in identation becomes a
 huge hassle.

My editor does vertical selection fine.

 I think tabs are great. :-)

Its all good, it's like inline braces versus dropped braces and every
other coding style debate :) There's no winner.

Cheers,
Rob.
-- 
..
| InterJinn Application Framework - http://www.interjinn.com |
::
| An application and templating framework for PHP. Boasting  |
| a powerful, scalable system for accessing system services  |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for   |
| creating re-usable components quickly and easily.  |
`'

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Tip For The Day

2004-01-27 Thread Jeremy
[snip]
Its all good, it's like inline braces versus dropped braces and every
other coding style debate :) There's no winner.
[/snip]

pfft. Inline braces wins hands down ;p

-J

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Tip For The Day

2004-01-27 Thread John Nichel
Chris Shiflett wrote:
snip
And your file sizes increase by 25%, and you enforce your tab preference
on every other developer (rather than letting them choose their own), and
you'd better hope that everyone's editor can perform operations on
vertical selections of text, otherwise changes in identation becomes a
huge hassle.
I think tabs are great. :-)
I guess it boils down to personal preference.  Up until a year ago, 
every bit of programming that I have ever done, I was free to use tabs. 
 The place I'm at now, wants us to use spaces (and set your editor's 
tab to use spaces), and I just can't get used to it.  However, there are 
guys working with me who have always used spaces, and think tabs are 
just wrong.

--
By-Tor.com
It's all about the Rush
http://www.by-tor.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Tip For The Day

2004-01-27 Thread John Nichel
Jeremy wrote:
[snip]

Its all good, it's like inline braces versus dropped braces and every
other coding style debate :) There's no winner.
[/snip]

pfft. Inline braces wins hands down ;p

-J

It's on now.  Somebody set up the ring for the cage match.  Last brace 
standing at the end wins. ;)

--
By-Tor.com
It's all about the Rush
http://www.by-tor.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php