Re: [PHP] Re: limiting

2012-10-10 Thread Andy McKenzie

>> Have you read a book on php and perhaps one on CSS to help
>> with your "hiding" problem?  (BTW - that last was a hint.)
>
> I've read plenty of PHP books I own at least 5 and ALL of them I've read
> hardly ever explain anything at all. They just throw some code in there and
> say "this is what it does" and gives a picture of the finished product. Total
> waste of my money! Also, how am I going to learn PHP if I've got to mix it all
> up with CSS. It's just going to make things harder and more confusing on me. I
> only threw lightbox in there because I knew I didn't have to do or learn
> anything special and to put a smile on my face if it worked. After all, if it
> can't be fun, why do it?


I rarely post anything to this list, because almost everything asked
is above my level of understanding.  But, speaking as a relative
beginner, I have a few comments here.

1) Books.  I, too, have read a lot of PHP books.  In the end, the ones
I've found most useful were by WROX press.  Their "Beginning PHP4" by
Choi, Kent, Lea, Prasad, and Ullman was one of the best "intro to
programming" type books I've found for the way I learn.  It's now
obsolete, but the core information is still good.  I haven't read
through the Beginning PHP 5.3 version as thoroughly, but it also seems
to be pretty good.  You might also want to check with local community
colleges to see if someone offers a basic course -- PHP, C, C++,
something like that.  The language may be different, but the concepts
remain the same.

2)  "They just throw some code in there and say "this is what it does"
and gives a picture of the finished product. Total waste of my money!
Also, how am I going to learn PHP if I've got to mix it all up with
CSS."

  This one's harder.  These days CSS is part of the web, and you're
stuck with it if you want to do anything complex.  So here's my
advice:  Find something simple to experiment with.  Don't start with a
complex project, start with something that doesn't actually do
anything useful.  When I start trying to understand a function I
haven't used before, I build a new page called something like
"foo_test", where foo is the name of the function.  These days it
might be ip2long_test, or something like that, but I still have some
in my test folder with names like "echo_test.php" where I was trying
to figure out how that function worked.  Start there.  Do something
simple.  Lightbox may be too complex.  Maybe build a fortune cookie
webpage, where every time you click a button it reloads with a new
fortune.  Learn to pull fortunes out of a file and out of a database.
Once you've got the hang of that, start using CSS to change how it
looks.  Once THAT's working right, figure out how to use JavaScript
(you're going to need it sooner or later!) and AJAX to make it reload
the fortune without reloading the whole page.

  Yeah, it's a boring project.  But it's a stepping stone to doing
what you really want to do.  The alternative is to do what I did:
start with a big project, and accept that you're going to rewrite it
dramatically later.  I started with a book inventory system.  First I
built a login and authentication system -- that builds a form, and
queries the database to see if the userid and password are correct.
Then I built a system to list what was in the book table for the
database.  Around the time I finished that, I realized I needed more
granularity in user logins, so I went back and rebuilt the login tool.
 Then I realized I didn't actually have a way to add stuff to the DB,
so I built that tool and so on.  It ended up taking me something
like a year, because I'd never looked at PHP before, and I've now
scrapped the entire project and rebuilt it.  Why?  Because I did just
about everything wrong.  It just plain wasn't practical to try to fix
it.  I'd never learned the basics, I just threw myself at a big
project to see what would happen.

  Good luck!

-Andy McKenzie

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



Re: [PHP] Re: limiting

2012-10-10 Thread Floyd Resler


On Oct 10, 2012, at 9:12 AM, Andy McKenzie  wrote:

> 
>>> Have you read a book on php and perhaps one on CSS to help
>>> with your "hiding" problem?  (BTW - that last was a hint.)
>> 
>> I've read plenty of PHP books I own at least 5 and ALL of them I've read
>> hardly ever explain anything at all. They just throw some code in there and
>> say "this is what it does" and gives a picture of the finished product. Total
>> waste of my money! Also, how am I going to learn PHP if I've got to mix it 
>> all
>> up with CSS. It's just going to make things harder and more confusing on me. 
>> I
>> only threw lightbox in there because I knew I didn't have to do or learn
>> anything special and to put a smile on my face if it worked. After all, if it
>> can't be fun, why do it?
> 
> 
> I rarely post anything to this list, because almost everything asked
> is above my level of understanding.  But, speaking as a relative
> beginner, I have a few comments here.
> 
> 1) Books.  I, too, have read a lot of PHP books.  In the end, the ones
> I've found most useful were by WROX press.  Their "Beginning PHP4" by
> Choi, Kent, Lea, Prasad, and Ullman was one of the best "intro to
> programming" type books I've found for the way I learn.  It's now
> obsolete, but the core information is still good.  I haven't read
> through the Beginning PHP 5.3 version as thoroughly, but it also seems
> to be pretty good.  You might also want to check with local community
> colleges to see if someone offers a basic course -- PHP, C, C++,
> something like that.  The language may be different, but the concepts
> remain the same.
> 
> 2)  "They just throw some code in there and say "this is what it does"
> and gives a picture of the finished product. Total waste of my money!
> Also, how am I going to learn PHP if I've got to mix it all up with
> CSS."
> 
>  This one's harder.  These days CSS is part of the web, and you're
> stuck with it if you want to do anything complex.  So here's my
> advice:  Find something simple to experiment with.  Don't start with a
> complex project, start with something that doesn't actually do
> anything useful.  When I start trying to understand a function I
> haven't used before, I build a new page called something like
> "foo_test", where foo is the name of the function.  These days it
> might be ip2long_test, or something like that, but I still have some
> in my test folder with names like "echo_test.php" where I was trying
> to figure out how that function worked.  Start there.  Do something
> simple.  Lightbox may be too complex.  Maybe build a fortune cookie
> webpage, where every time you click a button it reloads with a new
> fortune.  Learn to pull fortunes out of a file and out of a database.
> Once you've got the hang of that, start using CSS to change how it
> looks.  Once THAT's working right, figure out how to use JavaScript
> (you're going to need it sooner or later!) and AJAX to make it reload
> the fortune without reloading the whole page.
> 
>  Yeah, it's a boring project.  But it's a stepping stone to doing
> what you really want to do.  The alternative is to do what I did:
> start with a big project, and accept that you're going to rewrite it
> dramatically later.  I started with a book inventory system.  First I
> built a login and authentication system -- that builds a form, and
> queries the database to see if the userid and password are correct.
> Then I built a system to list what was in the book table for the
> database.  Around the time I finished that, I realized I needed more
> granularity in user logins, so I went back and rebuilt the login tool.
> Then I realized I didn't actually have a way to add stuff to the DB,
> so I built that tool and so on.  It ended up taking me something
> like a year, because I'd never looked at PHP before, and I've now
> scrapped the entire project and rebuilt it.  Why?  Because I did just
> about everything wrong.  It just plain wasn't practical to try to fix
> it.  I'd never learned the basics, I just threw myself at a big
> project to see what would happen.
> 
>  Good luck!
> 
> -Andy McKenzie

Excellent advise!  When learning any language, those small steps you suggest is 
how I've always learned the language.  A few years ago I ran across someone who 
didn't know a thing about programming but wanted to learn.  The first project 
he wanted to tackle was to write his own online role playing game.  You know, 
like World of Warcraft!  Uh, yeah.  I steered him away from that!

Take care,
Floyd


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



Re: [PHP] Re: limiting

2012-10-10 Thread Jim Giner

On 10/10/2012 10:07 AM, Floyd Resler wrote:



On Oct 10, 2012, at 9:12 AM, Andy McKenzie  wrote:




Have you read a book on php and perhaps one on CSS to help
with your "hiding" problem?  (BTW - that last was a hint.)


I've read plenty of PHP books I own at least 5 and ALL of them I've read
hardly ever explain anything at all. They just throw some code in there and
say "this is what it does" and gives a picture of the finished product. Total
waste of my money! Also, how am I going to learn PHP if I've got to mix it all
up with CSS. It's just going to make things harder and more confusing on me. I
only threw lightbox in there because I knew I didn't have to do or learn
anything special and to put a smile on my face if it worked. After all, if it
can't be fun, why do it?



I rarely post anything to this list, because almost everything asked
is above my level of understanding.  But, speaking as a relative
beginner, I have a few comments here.

1) Books.  I, too, have read a lot of PHP books.  In the end, the ones
I've found most useful were by WROX press.  Their "Beginning PHP4" by
Choi, Kent, Lea, Prasad, and Ullman was one of the best "intro to
programming" type books I've found for the way I learn.  It's now
obsolete, but the core information is still good.  I haven't read
through the Beginning PHP 5.3 version as thoroughly, but it also seems
to be pretty good.  You might also want to check with local community
colleges to see if someone offers a basic course -- PHP, C, C++,
something like that.  The language may be different, but the concepts
remain the same.

2)  "They just throw some code in there and say "this is what it does"
and gives a picture of the finished product. Total waste of my money!
Also, how am I going to learn PHP if I've got to mix it all up with
CSS."

  This one's harder.  These days CSS is part of the web, and you're
stuck with it if you want to do anything complex.  So here's my
advice:  Find something simple to experiment with.  Don't start with a
complex project, start with something that doesn't actually do
anything useful.  When I start trying to understand a function I
haven't used before, I build a new page called something like
"foo_test", where foo is the name of the function.  These days it
might be ip2long_test, or something like that, but I still have some
in my test folder with names like "echo_test.php" where I was trying
to figure out how that function worked.  Start there.  Do something
simple.  Lightbox may be too complex.  Maybe build a fortune cookie
webpage, where every time you click a button it reloads with a new
fortune.  Learn to pull fortunes out of a file and out of a database.
Once you've got the hang of that, start using CSS to change how it
looks.  Once THAT's working right, figure out how to use JavaScript
(you're going to need it sooner or later!) and AJAX to make it reload
the fortune without reloading the whole page.

  Yeah, it's a boring project.  But it's a stepping stone to doing
what you really want to do.  The alternative is to do what I did:
start with a big project, and accept that you're going to rewrite it
dramatically later.  I started with a book inventory system.  First I
built a login and authentication system -- that builds a form, and
queries the database to see if the userid and password are correct.
Then I built a system to list what was in the book table for the
database.  Around the time I finished that, I realized I needed more
granularity in user logins, so I went back and rebuilt the login tool.
Then I realized I didn't actually have a way to add stuff to the DB,
so I built that tool and so on.  It ended up taking me something
like a year, because I'd never looked at PHP before, and I've now
scrapped the entire project and rebuilt it.  Why?  Because I did just
about everything wrong.  It just plain wasn't practical to try to fix
it.  I'd never learned the basics, I just threw myself at a big
project to see what would happen.

  Good luck!

-Andy McKenzie


Excellent advise!  When learning any language, those small steps you suggest is 
how I've always learned the language.  A few years ago I ran across someone who 
didn't know a thing about programming but wanted to learn.  The first project 
he wanted to tackle was to write his own online role playing game.  You know, 
like World of Warcraft!  Uh, yeah.  I steered him away from that!

Take care,
Floyd

All great advice but alas, I fear that my long-winded response that 
began all these succeeding advice columns has steered our OP away from 
this list.  He thinks we're above his level (we are) and that he needs 
to start somewhere else, which means he'll probably repeat the mistakes 
that have been mentioned here.  Oh, well  you can only help those 
who ask for it, and only if they know what to do with it.	


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



Re: [PHP] Re: limiting

2012-10-10 Thread Matijn Woudt
On Wed, Oct 10, 2012 at 5:12 PM, Jim Giner  wrote:
> On 10/10/2012 10:07 AM, Floyd Resler wrote:
>>
>>
>>
>> On Oct 10, 2012, at 9:12 AM, Andy McKenzie  wrote:
>>
>>> 
>
> Have you read a book on php and perhaps one on CSS to help
> with your "hiding" problem?  (BTW - that last was a hint.)


 I've read plenty of PHP books I own at least 5 and ALL of them I've read
 hardly ever explain anything at all. They just throw some code in there
 and
 say "this is what it does" and gives a picture of the finished product.
 Total
 waste of my money! Also, how am I going to learn PHP if I've got to mix
 it all
 up with CSS. It's just going to make things harder and more confusing on
 me. I
 only threw lightbox in there because I knew I didn't have to do or learn
 anything special and to put a smile on my face if it worked. After all,
 if it
 can't be fun, why do it?
>>>
>>> 
>>>
>>> I rarely post anything to this list, because almost everything asked
>>> is above my level of understanding.  But, speaking as a relative
>>> beginner, I have a few comments here.
>>>
>>> 1) Books.  I, too, have read a lot of PHP books.  In the end, the ones
>>> I've found most useful were by WROX press.  Their "Beginning PHP4" by
>>> Choi, Kent, Lea, Prasad, and Ullman was one of the best "intro to
>>> programming" type books I've found for the way I learn.  It's now
>>> obsolete, but the core information is still good.  I haven't read
>>> through the Beginning PHP 5.3 version as thoroughly, but it also seems
>>> to be pretty good.  You might also want to check with local community
>>> colleges to see if someone offers a basic course -- PHP, C, C++,
>>> something like that.  The language may be different, but the concepts
>>> remain the same.
>>>
>>> 2)  "They just throw some code in there and say "this is what it does"
>>> and gives a picture of the finished product. Total waste of my money!
>>> Also, how am I going to learn PHP if I've got to mix it all up with
>>> CSS."
>>>
>>>   This one's harder.  These days CSS is part of the web, and you're
>>> stuck with it if you want to do anything complex.  So here's my
>>> advice:  Find something simple to experiment with.  Don't start with a
>>> complex project, start with something that doesn't actually do
>>> anything useful.  When I start trying to understand a function I
>>> haven't used before, I build a new page called something like
>>> "foo_test", where foo is the name of the function.  These days it
>>> might be ip2long_test, or something like that, but I still have some
>>> in my test folder with names like "echo_test.php" where I was trying
>>> to figure out how that function worked.  Start there.  Do something
>>> simple.  Lightbox may be too complex.  Maybe build a fortune cookie
>>> webpage, where every time you click a button it reloads with a new
>>> fortune.  Learn to pull fortunes out of a file and out of a database.
>>> Once you've got the hang of that, start using CSS to change how it
>>> looks.  Once THAT's working right, figure out how to use JavaScript
>>> (you're going to need it sooner or later!) and AJAX to make it reload
>>> the fortune without reloading the whole page.
>>>
>>>   Yeah, it's a boring project.  But it's a stepping stone to doing
>>> what you really want to do.  The alternative is to do what I did:
>>> start with a big project, and accept that you're going to rewrite it
>>> dramatically later.  I started with a book inventory system.  First I
>>> built a login and authentication system -- that builds a form, and
>>> queries the database to see if the userid and password are correct.
>>> Then I built a system to list what was in the book table for the
>>> database.  Around the time I finished that, I realized I needed more
>>> granularity in user logins, so I went back and rebuilt the login tool.
>>> Then I realized I didn't actually have a way to add stuff to the DB,
>>> so I built that tool and so on.  It ended up taking me something
>>> like a year, because I'd never looked at PHP before, and I've now
>>> scrapped the entire project and rebuilt it.  Why?  Because I did just
>>> about everything wrong.  It just plain wasn't practical to try to fix
>>> it.  I'd never learned the basics, I just threw myself at a big
>>> project to see what would happen.
>>>
>>>   Good luck!
>>>
>>> -Andy McKenzie
>>
>>
>> Excellent advise!  When learning any language, those small steps you
>> suggest is how I've always learned the language.  A few years ago I ran
>> across someone who didn't know a thing about programming but wanted to
>> learn.  The first project he wanted to tackle was to write his own online
>> role playing game.  You know, like World of Warcraft!  Uh, yeah.  I steered
>> him away from that!
>>
>> Take care,
>> Floyd
>>
> All great advice but alas, I fear that my long-winded response that began
> all these succeeding advice columns has steered our OP away from this list.
> H

Re: [PHP] Re: limiting

2012-10-10 Thread David McGlone
On Wednesday, October 10, 2012 05:48:10 PM Matijn Woudt wrote:
> On Wed, Oct 10, 2012 at 5:12 PM, Jim Giner  
wrote:
> > On 10/10/2012 10:07 AM, Floyd Resler wrote:
> >> On Oct 10, 2012, at 9:12 AM, Andy McKenzie  wrote:
> >>> 
> >>> 
> > Have you read a book on php and perhaps one on CSS to help
> > with your "hiding" problem?  (BTW - that last was a hint.)
>  
>  I've read plenty of PHP books I own at least 5 and ALL of them I've
>  read
>  hardly ever explain anything at all. They just throw some code in there
>  and
>  say "this is what it does" and gives a picture of the finished product.
>  Total
>  waste of my money! Also, how am I going to learn PHP if I've got to mix
>  it all
>  up with CSS. It's just going to make things harder and more confusing
>  on
>  me. I
>  only threw lightbox in there because I knew I didn't have to do or
>  learn
>  anything special and to put a smile on my face if it worked. After all,
>  if it
>  can't be fun, why do it?
> >>> 
> >>> 
> >>> 
> >>> I rarely post anything to this list, because almost everything asked
> >>> is above my level of understanding.  But, speaking as a relative
> >>> beginner, I have a few comments here.
> >>> 
> >>> 1) Books.  I, too, have read a lot of PHP books.  In the end, the ones
> >>> I've found most useful were by WROX press.  Their "Beginning PHP4" by
> >>> Choi, Kent, Lea, Prasad, and Ullman was one of the best "intro to
> >>> programming" type books I've found for the way I learn.  It's now
> >>> obsolete, but the core information is still good.  I haven't read
> >>> through the Beginning PHP 5.3 version as thoroughly, but it also seems
> >>> to be pretty good.  You might also want to check with local community
> >>> colleges to see if someone offers a basic course -- PHP, C, C++,
> >>> something like that.  The language may be different, but the concepts
> >>> remain the same.
> >>> 
> >>> 2)  "They just throw some code in there and say "this is what it does"
> >>> and gives a picture of the finished product. Total waste of my money!
> >>> Also, how am I going to learn PHP if I've got to mix it all up with
> >>> CSS."
> >>> 
> >>>   This one's harder.  These days CSS is part of the web, and you're
> >>> 
> >>> stuck with it if you want to do anything complex.  So here's my
> >>> advice:  Find something simple to experiment with.  Don't start with a
> >>> complex project, start with something that doesn't actually do
> >>> anything useful.  When I start trying to understand a function I
> >>> haven't used before, I build a new page called something like
> >>> "foo_test", where foo is the name of the function.  These days it
> >>> might be ip2long_test, or something like that, but I still have some
> >>> in my test folder with names like "echo_test.php" where I was trying
> >>> to figure out how that function worked.  Start there.  Do something
> >>> simple.  Lightbox may be too complex.  Maybe build a fortune cookie
> >>> webpage, where every time you click a button it reloads with a new
> >>> fortune.  Learn to pull fortunes out of a file and out of a database.
> >>> Once you've got the hang of that, start using CSS to change how it
> >>> looks.  Once THAT's working right, figure out how to use JavaScript
> >>> (you're going to need it sooner or later!) and AJAX to make it reload
> >>> the fortune without reloading the whole page.
> >>> 
> >>>   Yeah, it's a boring project.  But it's a stepping stone to doing
> >>> 
> >>> what you really want to do.  The alternative is to do what I did:
> >>> start with a big project, and accept that you're going to rewrite it
> >>> dramatically later.  I started with a book inventory system.  First I
> >>> built a login and authentication system -- that builds a form, and
> >>> queries the database to see if the userid and password are correct.
> >>> Then I built a system to list what was in the book table for the
> >>> database.  Around the time I finished that, I realized I needed more
> >>> granularity in user logins, so I went back and rebuilt the login tool.
> >>> Then I realized I didn't actually have a way to add stuff to the DB,
> >>> so I built that tool and so on.  It ended up taking me something
> >>> like a year, because I'd never looked at PHP before, and I've now
> >>> scrapped the entire project and rebuilt it.  Why?  Because I did just
> >>> about everything wrong.  It just plain wasn't practical to try to fix
> >>> it.  I'd never learned the basics, I just threw myself at a big
> >>> project to see what would happen.
> >>> 
> >>>   Good luck!
> >>> 
> >>> -Andy McKenzie
> >> 
> >> Excellent advise!  When learning any language, those small steps you
> >> suggest is how I've always learned the language.  A few years ago I ran
> >> across someone who didn't know a thing about programming but wanted to
> >> learn.  The first project he wanted to tackle was to write his own online
> >> role playing game.  Y

Re: [PHP] Re: limiting

2012-10-10 Thread Jim Giner

On 10/10/2012 1:19 PM, David McGlone wrote:


With that said, I just may leave the list. After all if this is all I'm going
to get out of it, it's not worth it!

  --
David M.


This list has given you some very good advice, much of it from others. 
It may not have solved your understanding of 'glob' (which is just 
another function - how could it alone mess up your project?) but it has 
felt your pain and offered you some ways to get up to speed.  Don't 
leave - take the advice with the sentiment it was given and learn.  This 
list is all about learning.  Just don't tackle the Tour de France until 
you get your training wheels off! :)


BTW - in any of your other computer languages didn't they utilize a 
'return' statement?  PHP's is no different.


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



Re: [PHP] Re: limiting

2012-10-10 Thread Govinda
> [snip]
> With that said, I just may leave the list. After all if this is all I'm going 
> to get out of it, it's not worth it!
> [snip]
> 

Hi David,

it sounds like cliche, but you get out of it what you put in it.

I recommend: 
(If you *want* to write code, then:)

- don't get flustered; don't take any of this too seriously, esp. the emotional 
part (except the fun of creating); don't let the experts bother/intimidate you 
- just take from them what you can use, and ignore the rest.

- focus on what you are trying to do, ignore everything else.  Even experts who 
know what they are doing can easily get lost and waste time if they do not just 
focus on the one thing they originally set out to do, and just drop everything 
else.  Focus!

- break every problem down into smaller problems; everything is easy and simple 
once you isolate an unknown/unlearned thing/issue down to just that one thing.  
Build up your code in baby steps.  If you ask big questions that are actually 
conglomerates of many unknowns (black holes in your understanding), then 
experts don't know where to begin to help you, so they post those (these ;-)  
long-winded advice columns.  But do ask the/any forum/list, "Why does this one 
little thing behave like this ", and you get instant expert useful answers 
every time.  You have to be the one to later glue together all the little 
things.  But you will be able to - if you have started with understanding how 
to do the little things that make up the larger thing you are creating.  Make 
sure you understand every little thing and nuance in your code.  

- resist the urge to just "get it to work" and then drop it.  One has to 
actually know HOW/WHY it works, and not just get lucky.  This is all logic, not 
luck.  Luck is not enough to rely on in coding.


There are many many people on this list who are feeling supportive of you...  
hoping you do not get discouraged, but do try again, and again.  :-)

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



Fwd: Re: [PHP] Re: limiting

2012-10-10 Thread David McGlone

--  Forwarded Message  --

Subject: Re: [PHP] Re: limiting
Date: Wednesday, October 10, 2012, 02:03:57 PM
From: David McGlone 
To: jim.gi...@albanyhandball.com


On Wednesday, October 10, 2012 01:31:58 PM Jim Giner wrote:
> On 10/10/2012 1:19 PM, David McGlone wrote:
> > With that said, I just may leave the list. After all if this is all I'm
> > going to get out of it, it's not worth it!
> > 
> >   --
> > 
> > David M.
> 
> This list has given you some very good advice, much of it from others.
> It may not have solved your understanding of 'glob' (which is just
> another function - how could it alone mess up your project?) 

At first is was going to be a project, because I thought that would help keep 
focus, but once I was introduced to glob it went from being a project, to a 
function to just plain code. I turned all my attention to glob and that little 
bit of code that I completely forgot I was trying keep focus by keeping it a 
project.


> but it has
> felt your pain and offered you some ways to get up to speed.  Don't
> leave - take the advice with the sentiment it was given and learn.  This
> list is all about learning.  Just don't tackle the Tour de France until
> you get your training wheels off! :)

Your advise was not what bothered me, it was way off base to say the least. 
What bothered me was the judgement that was cast upon me because I didn't 
understand return very well and when that came up, it added to my confusion 
and frusturation of trying to use glob which wasn't even my plan in the first 
place.
> 
> BTW - in any of your other computer languages didn't they utilize a
> 'return' statement?  PHP's is no different.

back in  like '85, I learned Pascal that's the only language I learned and I 
don't recall if it used return.

 -- 
David M.



-

-- 
David M.



[PHP] Re: limiting

2012-10-10 Thread Tim Streater
On 10 Oct 2012 at 19:17, David McGlone  wrote:

>>
>> BTW - in any of your other computer languages didn't they utilize a
>> 'return' statement?  PHP's is no different.
>
> back in  like '85, I learned Pascal that's the only language I learned and I
> don't recall if it used return.

Mmmm. There's the problem. Pascal doesn't *have* a return statement. In Pascal, 
implicitly, you return when execution reaches the end of a function. In fact 
the same is true of PHP and JavaScript, but in those languages you can return 
early just by saying return.

IMO, this is a major limitation of Pascal. I use returns wherever I feel like 
it - if I detect there's nothing more for the function to do, I return. Purists 
object to this; they say you should enter a function at one place and leave at 
one place. Well, that's a point of view. But more often that not it just leads 
to convoluted code in order to achieve that. The one time I *had* to use Pascal 
as that was the only option, I simply put a 999: label at the end of the 
function and did goto 999 wherever I wanted to do a return. Simples!

--
Cheers  --  Tim

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

Re: [PHP] Re: limiting

2012-10-10 Thread David McGlone
On Wednesday, October 10, 2012 07:36:00 PM Tim Streater wrote:
> On 10 Oct 2012 at 19:17, David McGlone  wrote:
> 
> 
> >>
> >>
> >> BTW - in any of your other computer languages didn't they utilize a
> >> 'return' statement?  PHP's is no different.
> >
> >
> >
> > back in  like '85, I learned Pascal that's the only language I learned and
> > I
 don't recall if it used return.
> 
> 
> Mmmm. There's the problem. Pascal doesn't *have* a return statement. In
> Pascal, implicitly, you return when execution reaches the end of a
> function. In fact the same is true of PHP and JavaScript, but in those
> languages you can return early just by saying return.
 
> IMO, this is a major limitation of Pascal. I use returns wherever I feel
> like it - if I detect there's nothing more for the function to do, I
> return. Purists object to this; they say you should enter a function at one
> place and leave at one place. Well, that's a point of view. But more often
> that not it just leads to convoluted code in order to achieve that. The one
> time I *had* to use Pascal as that was the only option, I simply put a 999:
> label at the end of the function and did goto 999 wherever I wanted to do a
> return. Simples!

goto was the thing that got on my nerves. Even to this day I hate that word 
with a passion.
 

-- 
David M.



Re: [PHP] Re: limiting

2012-10-10 Thread Ashley Sheridan
On Wed, 2012-10-10 at 14:53 -0400, David McGlone wrote:

> On Wednesday, October 10, 2012 07:36:00 PM Tim Streater wrote:
> > On 10 Oct 2012 at 19:17, David McGlone  wrote:
> > 
> > 
> > >>
> > >>
> > >> BTW - in any of your other computer languages didn't they utilize a
> > >> 'return' statement?  PHP's is no different.
> > >
> > >
> > >
> > > back in  like '85, I learned Pascal that's the only language I learned and
> > > I
>  don't recall if it used return.
> > 
> > 
> > Mmmm. There's the problem. Pascal doesn't *have* a return statement. In
> > Pascal, implicitly, you return when execution reaches the end of a
> > function. In fact the same is true of PHP and JavaScript, but in those
> > languages you can return early just by saying return.
>  
> > IMO, this is a major limitation of Pascal. I use returns wherever I feel
> > like it - if I detect there's nothing more for the function to do, I
> > return. Purists object to this; they say you should enter a function at one
> > place and leave at one place. Well, that's a point of view. But more often
> > that not it just leads to convoluted code in order to achieve that. The one
> > time I *had* to use Pascal as that was the only option, I simply put a 999:
> > label at the end of the function and did goto 999 wherever I wanted to do a
> > return. Simples!
> 
> goto was the thing that got on my nerves. Even to this day I hate that word 
> with a passion.
>  
> 


I think most people do, all but BASIC purists!

-- 
Thanks,
Ash
http://www.ashleysheridan.co.uk




Re: Re: [PHP] Re: limiting

2012-10-10 Thread Matijn Woudt
On Wed, Oct 10, 2012 at 8:17 PM, David McGlone  wrote:
>>
>> BTW - in any of your other computer languages didn't they utilize a
>> 'return' statement?  PHP's is no different.
>
> back in  like '85, I learned Pascal that's the only language I learned and I
> don't recall if it used return.
>
>  --

Pascal does have return, it only has a different name, exit. The
concept is the same.

- Matijn

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



Re: [PHP] Re: limiting

2012-10-10 Thread Matijn Woudt
On Wed, Oct 10, 2012 at 10:26 PM, Ashley Sheridan
 wrote:
> On Wed, 2012-10-10 at 14:53 -0400, David McGlone wrote:
>
>> On Wednesday, October 10, 2012 07:36:00 PM Tim Streater wrote:
>> > On 10 Oct 2012 at 19:17, David McGlone  wrote:
>> >
>> >
>> > >>
>> > >>
>> > >> BTW - in any of your other computer languages didn't they utilize a
>> > >> 'return' statement?  PHP's is no different.
>> > >
>> > >
>> > >
>> > > back in  like '85, I learned Pascal that's the only language I learned 
>> > > and
>> > > I
>>  don't recall if it used return.
>> >
>> >
>> > Mmmm. There's the problem. Pascal doesn't *have* a return statement. In
>> > Pascal, implicitly, you return when execution reaches the end of a
>> > function. In fact the same is true of PHP and JavaScript, but in those
>> > languages you can return early just by saying return.
>>
>> > IMO, this is a major limitation of Pascal. I use returns wherever I feel
>> > like it - if I detect there's nothing more for the function to do, I
>> > return. Purists object to this; they say you should enter a function at one
>> > place and leave at one place. Well, that's a point of view. But more often
>> > that not it just leads to convoluted code in order to achieve that. The one
>> > time I *had* to use Pascal as that was the only option, I simply put a 999:
>> > label at the end of the function and did goto 999 wherever I wanted to do a
>> > return. Simples!
>>
>> goto was the thing that got on my nerves. Even to this day I hate that word
>> with a passion.
>>
>>
>
>
> I think most people do, all but BASIC purists!
>

Not really, goto can safe you a mess. In some situations it's much
easier and cleaner to use something like goto cleanup; at each error
case, instead of duplicating the cleanup code all over again (Closing
sockets, or in languages like C, freeing memory).

- Matijn

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



[PHP] Re: limiting

2012-10-10 Thread Tim Streater
On 10 Oct 2012 at 19:53, David McGlone  wrote:

> On Wednesday, October 10, 2012 07:36:00 PM Tim Streater wrote:
>> On 10 Oct 2012 at 19:17, David McGlone  wrote:

 BTW - in any of your other computer languages didn't they utilize a
 'return' statement?  PHP's is no different.

>>> back in  like '85, I learned Pascal that's the only language I learned and
>>> I don't recall if it used return.

>> Mmmm. There's the problem. Pascal doesn't *have* a return statement. The one
>> time I *had* to use Pascal as that was the only option, I simply put a 999:
>> label at the end of the function and did goto 999 wherever I wanted to do a
>> return. Simples!
>
> goto was the thing that got on my nerves. Even to this day I hate that word
> with a passion.

Hu! Apart from what I described above, I haven't needed to use GOTO since I 
stopped writing FORTRAN in 1978.

--
Cheers  --  Tim

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

[PHP] Re: limiting

2012-10-10 Thread Jim Giner

On 10/10/2012 2:36 PM, Tim Streater wrote:

On 10 Oct 2012 at 19:17, David McGlone  wrote:



BTW - in any of your other computer languages didn't they utilize a
'return' statement?  PHP's is no different.


back in  like '85, I learned Pascal that's the only language I learned and I
don't recall if it used return.


Mmmm. There's the problem. Pascal doesn't *have* a return statement. In Pascal, 
implicitly, you return when execution reaches the end of a function. In fact 
the same is true of PHP and JavaScript, but in those languages you can return 
early just by saying return.

IMO, this is a major limitation of Pascal. I use returns wherever I feel like 
it - if I detect there's nothing more for the function to do, I return. Purists 
object to this; they say you should enter a function at one place and leave at 
one place. Well, that's a point of view. But more often that not it just leads 
to convoluted code in order to achieve that. The one time I *had* to use Pascal 
as that was the only option, I simply put a 999: label at the end of the 
function and did goto 999 wherever I wanted to do a return. Simples!

--
Cheers  --  Tim


Now you went and gave our OP something else to think about!  :(:(

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



Re: [PHP] Re: limiting

2012-10-10 Thread Jim Giner

On 10/10/2012 4:27 PM, Matijn Woudt wrote:

On Wed, Oct 10, 2012 at 10:26 PM, Ashley Sheridan
 wrote:

On Wed, 2012-10-10 at 14:53 -0400, David McGlone wrote:


On Wednesday, October 10, 2012 07:36:00 PM Tim Streater wrote:

On 10 Oct 2012 at 19:17, David McGlone  wrote:





BTW - in any of your other computer languages didn't they utilize a
'return' statement?  PHP's is no different.




back in  like '85, I learned Pascal that's the only language I learned and
I

  don't recall if it used return.



Mmmm. There's the problem. Pascal doesn't *have* a return statement. In
Pascal, implicitly, you return when execution reaches the end of a
function. In fact the same is true of PHP and JavaScript, but in those
languages you can return early just by saying return.



IMO, this is a major limitation of Pascal. I use returns wherever I feel
like it - if I detect there's nothing more for the function to do, I
return. Purists object to this; they say you should enter a function at one
place and leave at one place. Well, that's a point of view. But more often
that not it just leads to convoluted code in order to achieve that. The one
time I *had* to use Pascal as that was the only option, I simply put a 999:
label at the end of the function and did goto 999 wherever I wanted to do a
return. Simples!


goto was the thing that got on my nerves. Even to this day I hate that word
with a passion.





I think most people do, all but BASIC purists!



Not really, goto can safe you a mess. In some situations it's much
easier and cleaner to use something like goto cleanup; at each error
case, instead of duplicating the cleanup code all over again (Closing
sockets, or in languages like C, freeing memory).

- Matijn


haven't used a goto or go in 30 years.

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



Re: [PHP] Re: limiting

2012-10-10 Thread tamouse mailing lists
On Wed, Oct 10, 2012 at 7:37 PM, Jim Giner  wrote:
> On 10/10/2012 4:27 PM, Matijn Woudt wrote:
>>
>> On Wed, Oct 10, 2012 at 10:26 PM, Ashley Sheridan
>>  wrote:
>>>
>>> On Wed, 2012-10-10 at 14:53 -0400, David McGlone wrote:
>>>
 On Wednesday, October 10, 2012 07:36:00 PM Tim Streater wrote:
>
> On 10 Oct 2012 at 19:17, David McGlone  wrote:
>
>
>>>
>>>
>>> BTW - in any of your other computer languages didn't they utilize a
>>> 'return' statement?  PHP's is no different.
>>
>>
>>
>>
>> back in  like '85, I learned Pascal that's the only language I learned
>> and
>> I

   don't recall if it used return.
>
>
>
> Mmmm. There's the problem. Pascal doesn't *have* a return statement. In
> Pascal, implicitly, you return when execution reaches the end of a
> function. In fact the same is true of PHP and JavaScript, but in those
> languages you can return early just by saying return.


> IMO, this is a major limitation of Pascal. I use returns wherever I
> feel
> like it - if I detect there's nothing more for the function to do, I
> return. Purists object to this; they say you should enter a function at
> one
> place and leave at one place. Well, that's a point of view. But more
> often
> that not it just leads to convoluted code in order to achieve that. The
> one
> time I *had* to use Pascal as that was the only option, I simply put a
> 999:
> label at the end of the function and did goto 999 wherever I wanted to
> do a
> return. Simples!


 goto was the thing that got on my nerves. Even to this day I hate that
 word
 with a passion.


>>>
>>>
>>> I think most people do, all but BASIC purists!
>>>
>>
>> Not really, goto can safe you a mess. In some situations it's much
>> easier and cleaner to use something like goto cleanup; at each error
>> case, instead of duplicating the cleanup code all over again (Closing
>> sockets, or in languages like C, freeing memory).
>>
>> - Matijn
>>
> haven't used a goto or go in 30 years.
>
>

It's the whence command that will get you every time (aka "comesfrom").

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