php-general Digest 6 Feb 2012 17:59:48 -0000 Issue 7677

2012-02-06 Thread php-general-digest-help
php-general Digest 6 Feb 2012 17:59:48 - Issue 7677 Topics (messages 316465 through 316488): Re: Headers on smart phone browsers 316465 by: Mari Masuda 316470 by: Jim Giner 316472 by: Marc Guay Long Live GOTO 316466 by: Adam Richardson 316467 by: Tim

Re: [PHP] Long Live GOTO

2012-02-06 Thread Tim Streater
On 06 Feb 2012 at 07:47, Adam Richardson simples...@gmail.com wrote: While not purely focused on PHP, I toss this out to the group because I believe there are some novel, interesting points regarding the potential benefits of using the goto construct as implemented in PHP:

Re: [PHP] Long Live GOTO

2012-02-06 Thread Adam Richardson
On Mon, Feb 6, 2012 at 4:07 AM, Tim Streater t...@clothears.org.uk wrote: On 06 Feb 2012 at 07:47, Adam Richardson simples...@gmail.com wrote: While not purely focused on PHP, I toss this out to the group because I believe there are some novel, interesting points regarding the potential

Re: [PHP] Long Live GOTO

2012-02-06 Thread Adam Richardson
On Mon, Feb 6, 2012 at 4:25 AM, Adam Richardson simples...@gmail.comwrote: On Mon, Feb 6, 2012 at 4:07 AM, Tim Streater t...@clothears.org.uk wrote: On 06 Feb 2012 at 07:47, Adam Richardson simples...@gmail.com wrote: While not purely focused on PHP, I toss this out to the group because I

Re: [PHP] Headers on smart phone browsers

2012-02-06 Thread Jim Giner
Nice article!! You should read up on responsive web design. http://www.alistapart.com/articles/responsive-web-design/ should get you started. HTH!= -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Long Live GOTO

2012-02-06 Thread Robert Cummings
On 12-02-06 04:07 AM, Tim Streater wrote: On 06 Feb 2012 at 07:47, Adam Richardsonsimples...@gmail.com wrote: While not purely focused on PHP, I toss this out to the group because I believe there are some novel, interesting points regarding the potential benefits of using the goto construct

Re: [PHP] Headers on smart phone browsers

2012-02-06 Thread Marc Guay
1) Do smart phones use the same browsers as the desktop, or do they have their own stripped down versions of browsers? Different browsers, some of which are worse than IE (see Blackberry). 2) When a browser broadcasts its header telling the server what kind of browser is involved, do they

Re: Re: [PHP] Long Live GOTO

2012-02-06 Thread Tim Streater
On 06 Feb 2012 at 15:05, Robert Cummings rob...@interjinn.com wrote: I've had a strong opinion on goto for a very long time. I was one of the proponents who argued on internals for its inclusion several years ago. I stand by its utility and refer the reader to the fact that many open source

[PHP] Re: Long Live GOTO

2012-02-06 Thread Jim Giner
NO GO! As one who started back in the 70's with old style coding that utilized GoTo in Cobol, Fortran, etc. and had to deal with spaghetti code written by even earlier developers who never considered that someone else would have to maintain their code, I feel strongly that GoTo is not to be

Re: [PHP] Re: Long Live GOTO

2012-02-06 Thread Alain Williams
On Mon, Feb 06, 2012 at 11:12:53AM -0500, Jim Giner wrote: NO GO! As one who started back in the 70's with old style coding that utilized GoTo in Cobol, Fortran, etc. and had to deal with spaghetti code written by even earlier developers who never considered that someone else would have to

Re: [PHP] Re: Long Live GOTO

2012-02-06 Thread Larry Martell
On Mon, Feb 6, 2012 at 9:23 AM, Alain Williams a...@phcomp.co.uk wrote: On Mon, Feb 06, 2012 at 11:12:53AM -0500, Jim Giner wrote: NO GO! As one who started back in the 70's with old style coding that utilized GoTo in Cobol, Fortran, etc. and had to deal with spaghetti code written by even

Re: [PHP] Long Live GOTO

2012-02-06 Thread Adam Richardson
On Mon, Feb 6, 2012 at 10:05 AM, Robert Cummings rob...@interjinn.comwrote: On 12-02-06 04:07 AM, Tim Streater wrote: On 06 Feb 2012 at 07:47, Adam Richardsonsimpleshot@gmail.**comsimples...@gmail.com wrote: While not purely focused on PHP, I toss this out to the group because I

Re: [PHP] Re: Long Live GOTO

2012-02-06 Thread Alain Williams
On Mon, Feb 06, 2012 at 09:28:10AM -0700, Larry Martell wrote: On Mon, Feb 6, 2012 at 9:23 AM, Alain Williams a...@phcomp.co.uk wrote: If I survey my code I find that I use one GOTO in about 4,000 lines of code - that I do not find excessive. There are, however, people who consider

Re: [PHP] Re: Long Live GOTO

2012-02-06 Thread Adam Richardson
On Mon, Feb 6, 2012 at 11:28 AM, Larry Martell la...@software-horizons.comwrote: On Mon, Feb 6, 2012 at 9:23 AM, Alain Williams a...@phcomp.co.uk wrote: On Mon, Feb 06, 2012 at 11:12:53AM -0500, Jim Giner wrote: NO GO! As one who started back in the 70's with old style coding that utilized

Re: Re: [PHP] Long Live GOTO

2012-02-06 Thread Tim Streater
On 06 Feb 2012 at 09:48, Adam Richardson simples...@gmail.com wrote: On Mon, Feb 6, 2012 at 4:25 AM, Adam Richardson simples...@gmail.comwrote: On Mon, Feb 6, 2012 at 4:07 AM, Tim Streater t...@clothears.org.uk wrote: I disagree that the nested function is a straw-man. I (just as the other

Re: [PHP] Long Live GOTO

2012-02-06 Thread Robert Cummings
On 12-02-06 11:58 AM, Tim Streater wrote: On 06 Feb 2012 at 09:48, Adam Richardsonsimples...@gmail.com wrote: On Mon, Feb 6, 2012 at 4:25 AM, Adam Richardsonsimples...@gmail.comwrote: On Mon, Feb 6, 2012 at 4:07 AM, Tim Streatert...@clothears.org.uk wrote: I disagree that the nested

Re: [PHP] Re: Long Live GOTO

2012-02-06 Thread Robert Cummings
On 12-02-06 11:35 AM, Alain Williams wrote: On Mon, Feb 06, 2012 at 09:28:10AM -0700, Larry Martell wrote: On Mon, Feb 6, 2012 at 9:23 AM, Alain Williamsa...@phcomp.co.uk wrote: If I survey my code I find that I use one GOTO in about 4,000 lines of code - that I do not find excessive.

Re: [PHP] Re: Long Live GOTO

2012-02-06 Thread Larry Martell
On Mon, Feb 6, 2012 at 9:50 AM, Adam Richardson simples...@gmail.com wrote: On Mon, Feb 6, 2012 at 11:28 AM, Larry Martell la...@software-horizons.comwrote: On Mon, Feb 6, 2012 at 9:23 AM, Alain Williams a...@phcomp.co.uk wrote: On Mon, Feb 06, 2012 at 11:12:53AM -0500, Jim Giner wrote: NO

Re: [PHP] Re: Long Live GOTO

2012-02-06 Thread Adam Richardson
On Mon, Feb 6, 2012 at 12:09 PM, Larry Martell la...@software-horizons.comwrote: The source is my own personal experience working for an avionics company and working with the FAA to get our code certified under the DO-178B standard. I never saw anything that said 'no GOTOs' but that's what I

Re: Re: [PHP] Long Live GOTO

2012-02-06 Thread Adam Richardson
On Mon, Feb 6, 2012 at 11:58 AM, Tim Streater t...@clothears.org.uk wrote: On 06 Feb 2012 at 09:48, Adam Richardson simples...@gmail.com wrote: On Mon, Feb 6, 2012 at 4:25 AM, Adam Richardson simples...@gmail.com wrote: On Mon, Feb 6, 2012 at 4:07 AM, Tim Streater t...@clothears.org.uk

Re: [PHP] Long Live GOTO

2012-02-06 Thread Jim Giner
Adam Richardson simples...@gmail.com wrote in message news:cac6cjqz5wku8c9ruqgc4rqg5cq35a-lfs1rryos3wtfys6r...@mail.gmail.com... On Mon, Feb 6, 2012 at 10:05 AM, Robert Cummings rob...@interjinn.comwrote: On 12-02-06 04:07 AM, Tim Streater wrote: On 06 Feb 2012 at 07:47, Adam

Re: [PHP] Long Live GOTO

2012-02-06 Thread Jim Giner
Robert Cummings rob...@interjinn.com wrote in message news:4f30086a.6080...@interjinn.com... 1) deal with the trivial and error cases first Some say you should never return early from a function... I too think that early returns can improve the readability of a function-- especially if

Re: [PHP] Re: Long Live GOTO

2012-02-06 Thread Larry Martell
On Mon, Feb 6, 2012 at 10:13 AM, Adam Richardson simples...@gmail.com wrote: On Mon, Feb 6, 2012 at 12:09 PM, Larry Martell la...@software-horizons.comwrote: The source is my own personal experience working for an avionics company and working with the FAA to get our code certified under the

Re: [PHP] Re: Long Live GOTO

2012-02-06 Thread Daniel Brown
On Mon, Feb 6, 2012 at 12:59, Larry Martell la...@software-horizons.com wrote: I just pulled out my notes from that job - it took me 59 hours to do the conversion and remove the gotos and recursion, and another 67 hours for testing, verification, integration, documentation, and certification.

Re: [PHP] Re: Long Live GOTO

2012-02-06 Thread Larry Martell
On Mon, Feb 6, 2012 at 11:07 AM, Daniel Brown danbr...@php.net wrote: On Mon, Feb 6, 2012 at 12:59, Larry Martell la...@software-horizons.com wrote: I just pulled out my notes from that job - it took me 59 hours to do the conversion and remove the gotos and recursion, and another 67 hours

[PHP] How can I debug wsf/php in eclipse?

2012-02-06 Thread Ali Asghar Toraby Parizy
Hi. I'm developing a wsf/php web service. I'm using doc/lit messaging format and every thing is OK. But I don't know how i can debug my web services using eclipse. Although I can directly run my web service in debug mode, Unfortunately when I debug my client it never jump into web service code and

Re: [PHP] Headers on smart phone browsers

2012-02-06 Thread Donovan Brooke
Paul M Foster wrote: This is sort of obliquely related to PHP. I don't have a smart phone, but I need to know a couple of things: 1) Do smart phones use the same browsers as the desktop, or do they have their own stripped down versions of browsers? 2) When a browser broadcasts its header

Re: [PHP] Re: Long Live GOTO

2012-02-06 Thread Marco Behnke
Am 06.02.12 17:23, schrieb Alain Williams: However: a few GOTOs can make things clearer. Think of a function that can fail in several different places (eg data validation, ...). But it is reading a file which needs to be closed before the function returns. I have seen code where some $IsError

Re: [PHP] Headers on smart phone browsers

2012-02-06 Thread Adam Richardson
On Mon, Feb 6, 2012 at 12:58 AM, Paul M Foster pa...@quillandmouse.comwrote: This is sort of obliquely related to PHP. I don't have a smart phone, but I need to know a couple of things: 1) Do smart phones use the same browsers as the desktop, or do they have their own stripped down versions

Re: [PHP] Re: Long Live GOTO

2012-02-06 Thread Simon J Welsh
On 7/02/2012, at 9:44 AM, Marco Behnke wrote: Am 06.02.12 17:23, schrieb Alain Williams: However: a few GOTOs can make things clearer. Think of a function that can fail in several different places (eg data validation, ...). But it is reading a file which needs to be closed before the

Re: [PHP] Re: Long Live GOTO

2012-02-06 Thread Adam Richardson
On Mon, Feb 6, 2012 at 3:44 PM, Marco Behnke ma...@behnke.biz wrote: Am 06.02.12 17:23, schrieb Alain Williams: However: a few GOTOs can make things clearer. Think of a function that can fail in several different places (eg data validation, ...). But it is reading a file which needs to be

Re: [PHP] Headers on smart phone browsers

2012-02-06 Thread Ashley Sheridan
On Mon, 2012-02-06 at 14:28 -0600, Donovan Brooke wrote: Paul M Foster wrote: This is sort of obliquely related to PHP. I don't have a smart phone, but I need to know a couple of things: 1) Do smart phones use the same browsers as the desktop, or do they have their own stripped down

Re: [PHP] Headers on smart phone browsers

2012-02-06 Thread Stuart Dallas
On 6 Feb 2012, at 05:58, Paul M Foster wrote: This is sort of obliquely related to PHP. I don't have a smart phone, but I need to know a couple of things: There are simulators available for most smartphones. 1) Do smart phones use the same browsers as the desktop, or do they have their

Re: [PHP] Headers on smart phone browsers

2012-02-06 Thread Adam Richardson
On Mon, Feb 6, 2012 at 3:50 PM, Adam Richardson simples...@gmail.comwrote: On Mon, Feb 6, 2012 at 12:58 AM, Paul M Foster pa...@quillandmouse.comwrote: This is sort of obliquely related to PHP. I don't have a smart phone, but I need to know a couple of things: 1) Do smart phones use the

Re: [PHP] Re: Long Live GOTO

2012-02-06 Thread Stuart Dallas
On 6 Feb 2012, at 20:44, Marco Behnke wrote: Am 06.02.12 17:23, schrieb Alain Williams: However: a few GOTOs can make things clearer. Think of a function that can fail in several different places (eg data validation, ...). But it is reading a file which needs to be closed before the function

Re: [PHP] Headers on smart phone browsers

2012-02-06 Thread Marc Guay
the way your site renders should be purely based upon the size of the display. Although I mostly agree with this statement, it ignores the most interesting aspects of mobile technology, such as being able to ask the user for their GPS location and deliver content accordingly. I worked on some

Re: [PHP] Headers on smart phone browsers

2012-02-06 Thread Mari Masuda
On Feb 6, 2012, at 1:01 PM, Stuart Dallas wrote: [snip] Generally speaking you're better off with a design that automatically adapts to the viewport on which it's being displayed. [snip] For a concrete example of responsive design in action, point your browser to

Re: [PHP] Headers on smart phone browsers

2012-02-06 Thread Stuart Dallas
On 6 Feb 2012, at 21:12, Marc Guay wrote: the way your site renders should be purely based upon the size of the display. Although I mostly agree with this statement, it ignores the most interesting aspects of mobile technology, such as being able to ask the user for their GPS location and

[PHP] Re: Long Live GOTO

2012-02-06 Thread Tim Streater
On 06 Feb 2012 at 20:51, Simon J Welsh si...@welsh.co.nz wrote: On 7/02/2012, at 9:44 AM, Marco Behnke wrote: Am 06.02.12 17:23, schrieb Alain Williams: However: a few GOTOs can make things clearer. Think of a function that can fail in several different places (eg data validation, ...). But

Re: [PHP] Headers on smart phone browsers

2012-02-06 Thread Paul M Foster
On Mon, Feb 06, 2012 at 02:28:42PM -0600, Donovan Brooke wrote: Paul M Foster wrote: This is sort of obliquely related to PHP. I don't have a smart phone, but I need to know a couple of things: 1) Do smart phones use the same browsers as the desktop, or do they have their own stripped

Re: [PHP] Headers on smart phone browsers

2012-02-06 Thread Paul M Foster
On Mon, Feb 06, 2012 at 09:02:34PM +, Ashley Sheridan wrote: [snip] Keeping a PHP angle to this, have you looked at using an up-to-date browscap.ini file with PHP? Basically, you can use that to read in the raw user agent string from the browser, and it then finds a matching entry in

Re: [PHP] Headers on smart phone browsers

2012-02-06 Thread Donovan Brooke
Ashley Sheridan wrote: [snip] Keeping a PHP angle to this, have you looked at using an up-to-date browscap.ini file with PHP? Basically, you can use that to read in the raw user agent string from the browser, and it then finds a matching entry in the ini file and gives you back some values about

Re: [PHP] Headers on smart phone browsers

2012-02-06 Thread Donovan Brooke
Stuart Dallas wrote: On 6 Feb 2012, at 21:12, Marc Guay wrote: the way your site renders should be purely based upon the size of the display. Although I mostly agree with this statement, it ignores the most interesting aspects of mobile technology, such as being able to ask the user for

Re: [PHP] Headers on smart phone browsers

2012-02-06 Thread Paul M Foster
On Mon, Feb 06, 2012 at 04:04:28PM -0500, Adam Richardson wrote: On Mon, Feb 6, 2012 at 3:50 PM, Adam Richardson [1]simples...@gmail.com wrote: On Mon, Feb 6, 2012 at 12:58 AM, Paul M Foster [2]pa...@quillandmouse.com wrote: This is sort of obliquely related to

Re: [PHP] Headers on smart phone browsers

2012-02-06 Thread Paul M Foster
On Mon, Feb 06, 2012 at 09:01:45PM +, Stuart Dallas wrote: On 6 Feb 2012, at 05:58, Paul M Foster wrote: This is sort of obliquely related to PHP. I don't have a smart phone, but I need to know a couple of things: There are simulators available for most smartphones. 1) Do

Re: [PHP] Re: Long Live GOTO

2012-02-06 Thread Matijn Woudt
On Mon, Feb 6, 2012 at 11:34 PM, Tim Streater t...@clothears.org.uk wrote: On 06 Feb 2012 at 20:51, Simon J Welsh si...@welsh.co.nz wrote: On 7/02/2012, at 9:44 AM, Marco Behnke wrote: Am 06.02.12 17:23, schrieb Alain Williams: However: a few GOTOs can make things clearer. Think of a

Re: [PHP] Re: Long Live GOTO

2012-02-06 Thread Marco Behnke
Am 06.02.12 21:55, schrieb Adam Richardson: On Mon, Feb 6, 2012 at 3:44 PM, Marco Behnke ma...@behnke.biz wrote: Am 06.02.12 17:23, schrieb Alain Williams: many places to see if things should be done. That is just as bad as lots of GOTO -- often when having to write something like that I

Re: [PHP] Headers on smart phone browsers

2012-02-06 Thread Donovan Brooke
Paul M Foster wrote: [snip] How about this: those of you with iPhones, Androids and the like, point your phones at a page which reports $_SERVER['HTTP_USER_AGENT'] (like a page which runs the phpinfo() function), and post what you get back from that exercise and what device made the query. I'd

Re: [PHP] Headers on smart phone browsers

2012-02-06 Thread Donovan Brooke
Mari Masuda wrote: [snip] For a concrete example of responsive design in action, point your browser to http://www.sasquatchfestival.com/ and then slowly make the window wider/skinnier to see how the design adapts to different viewport sizes. Very nice... makes for an easy display to a wide