SitePoint Sponsor

User Tag List

Page 1 of 3 123 LastLast
Results 1 to 25 of 67
  1. #1
    SitePoint Addict skunkbad's Avatar
    Join Date
    Apr 2008
    Location
    Temecula, CA
    Posts
    272
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Do you really read the php manual?

    So, sometimes when I'm bored I read the php manual, and try not to just skim the pages. Tonight was one such instance, and I found something that I think it quite cool, but upon browsing the internet for other opinions, found that some don't exactly feel the same way.

    What I found was the goto operator page, located at http://us2.php.net/manual/en/control...tures.goto.php . Upon reading about this operator, new to php 5.3, I instantly thought of ways that this operator was going to clean up certain parts of my code.

    I was actually surprised that the majority of other people think that this goto operator is bad, and will create spaghetti code.

    This isn't just about the goto operator. As titled, this thread is about reading the manual. I spend a lot of time participating in php related forums, and I can tell that a huge percentage of people have never read a page of the manual. They don't have a clue, and in many cases are just trying to get people to write code for them. I'll be the first to admit that I am no php guru, but at least I try to learn. I do get a lot of help here, and in other forums, and I do appreciate it very much, but for those who haven't read the manual, please know, it is THE MANUAL, and it's not hard to read.

    What have you found in the manual lately?

  2. #2
    SitePoint Zealot
    Join Date
    Dec 2008
    Posts
    120
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I ussually read user comments at the end of the php functions manual. There are a good examples there

  3. #3
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,597
    Mentioned
    24 Post(s)
    Tagged
    1 Thread(s)
    I usually go to the manual when I need to remind myself how a particular function I haven't used for a while works.

    Haven't used 'goto' since the last timeI was writing in Cobol (where we used to use it to go to an exit paragraph at the end of the section due to not having a break statement)..
    Stephen J Chapman

    javascriptexample.net, Book Reviews, follow me on Twitter
    HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
    <input name="html5" type="text" required pattern="^$">

  4. #4
    SitePoint Zealot adam.jimenez's Avatar
    Join Date
    May 2009
    Location
    Ware, UK
    Posts
    136
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    the manual is an invaluable resource to me and is one of things that makes php great.

    i can see how goto can be useful. there have been times when i've had to wrap many lines of code in parenthesis when a goto command would be a lot neater.

    I wonder if it works across includes. i.e. will it work if the destination is in an include or if the file is included in another file.

    Also will this functionality forever remain in future versions of php if not many people know about it or use it?

  5. #5
    Follow: @AlexDawsonUK silver trophybronze trophy AlexDawson's Avatar
    Join Date
    Feb 2009
    Location
    England, UK
    Posts
    8,111
    Mentioned
    0 Post(s)
    Tagged
    1 Thread(s)
    I have read most of the specifications out there at some point, It makes me wonder if I should get a hobby...

  6. #6
    SitePoint Zealot zalucius's Avatar
    Join Date
    Jul 2007
    Location
    Denmark
    Posts
    162
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You can download the PHP manual in .chm format, which think is easier to use for quick lookups.
    http://us2.php.net/download-docs.php
    zalucius

  7. #7
    SitePoint Enthusiast
    Join Date
    May 2009
    Posts
    65
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi all,

    Here in my company all of us call php manual as GEETA( Holy Book for Indians).You see you will get all the things at one place and you dont have to go any where if you are a good friend of php manual.

    I have .chm as well and it helps a lot ,I also like the examples as most of the time my problems have solutions in those examples.

    noddy

  8. #8
    SitePoint Wizard silver trophybronze trophy Cups's Avatar
    Join Date
    Oct 2006
    Location
    France, deep rural.
    Posts
    6,869
    Mentioned
    17 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by skunkbad
    and I can tell that a huge percentage of people have never read a page of the manual. They don't have a clue, and in many cases are just trying to get people to write code for them
    If its clear they would benefit from reading the manual first, and you know the particular function they should be checking then did you know you can use this bb code formatting?

    [ fphp ]strtolower[ /fphp ] (without the spaces) gives strtolower.

    If they then come back and clearly did not even bother rtfm then you know to block/ignore/scold them.

    I do think the manual is overwhelming for new scripters, and I certainly noticed an upward curve in my use of it a) as I learned more but even more so when I b) found sitepoint.

    The .chm is always open in another window on my system (win32 thank god for Virtuawin), and I bemoan the fact that no longer contains user comments - so I have to go online to get some real world checks on what I want to do.

  9. #9
    SitePoint Zealot
    Join Date
    Jun 2008
    Location
    Gloucestershire, UK
    Posts
    197
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The W3C School has a complete function list, which is sometimes a bit easier to get your head around.

    http://www.w3schools.com/php/default.asp

    Cheers,

    Jon

  10. #10
    SitePoint Wizard silver trophybronze trophy Stormrider's Avatar
    Join Date
    Sep 2006
    Location
    Nottingham, UK
    Posts
    3,133
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    I read the manual occasionally, yes, can learn some interesting things!

    'goto' is generally considered bad in most/all languages, it makes your code a bit unpredictable almost - jumping off somewhere else half way through a loop etc. It can be a bit of a nightmare to debug, and there is pretty much always a better way of doing it.

  11. #11
    @php.net Salathe's Avatar
    Join Date
    Dec 2004
    Location
    Edinburgh
    Posts
    1,396
    Mentioned
    54 Post(s)
    Tagged
    0 Thread(s)
    I may be a tad biased (being on the PHP documentation team) but the manual is an invaluable resource to me. Pretty much everye day there will be at least one time where I type php.net/something into Firefox, often to point peoples' questions to the relevant manual page. One thing that I must encourage people to do is give feedback. User notes bring a lot of extra value to the manual pages and if you notice a problem with a manual entry, please report it as a documentation bug (bugs.php.net, remember to search the bugs list first).

    With regards to goto, it's just another tool in the developer's arsenal. Some will use it appropriately, some will avoid using it at all and yet others will use it at every opportunity even when it is not the right tool for the job.
    Salathe
    Software Developer and PHP Manual Author.

  12. #12
    Grumpy Minimalist
    Join Date
    Jul 2006
    Location
    Ontario, Canada
    Posts
    424
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Salathe View Post
    there will be at least one time where I type php.net/something into Firefox
    Likewise.

    However, I'd like to point out that, if you add the PHP Manual search extension to Firefox, you can set the keyword in the search engine list. That way, you can simply type php functionnamehere into the AwesomeBar and away it goes!

  13. #13
    SitePoint Enthusiast Boxer's Avatar
    Join Date
    Jan 2008
    Location
    Denver, Colorado
    Posts
    86
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The Manual has always been the single source for me. I mean, I never bought a book about PHP just because I don't need additional advice.

    However, sometimes people put up good examples elsewhere, explain some topic, so sometimes I search for a problem in Google.

  14. #14
    @php.net Salathe's Avatar
    Join Date
    Dec 2004
    Location
    Edinburgh
    Posts
    1,396
    Mentioned
    54 Post(s)
    Tagged
    0 Thread(s)
    Off Topic:

    I also have a search box addon which means it's simply Command-K (Ctrl-K I guess for windows), search term, enter to be sent to a PHP Manual page. However, it's just habit to type Command-L (Ctrl-L) php.net/blah !
    Salathe
    Software Developer and PHP Manual Author.

  15. #15
    SitePoint Wizard siteguru's Avatar
    Join Date
    Oct 2002
    Location
    Scotland
    Posts
    3,608
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Cups View Post
    If its clear they would benefit from reading the manual first, and you know the particular function they should be checking then did you know you can use this bb code formatting?

    [ fphp ]strtolower[ /fphp ] (without the spaces) gives strtolower.
    No. I didn't know about that. Cool!
    Ian Anderson
    www.siteguru.co.uk

  16. #16
    Grumpy Minimalist
    Join Date
    Jul 2006
    Location
    Ontario, Canada
    Posts
    424
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Off Topic:

    Using Ctrl+K works great, if the only thing that you search for is PHP functions!

    I also have the MySQL and Sitepoint reference installed as search engines, and I frequently use the search box for Google searches. That means I can't just leave PHP selected (and I couldn't find any keyboard shortcuts to change it either).

    This means that I can type:
    • php functionname to find a PHP function
    • sql termname to find an SQL term
    • web termname to find a JS/HTML/CSS term
    • wiki whatever to find a Wikipedia entry

    ...all after a single Ctrl+L!

  17. #17
    SitePoint Enthusiast Technographs's Avatar
    Join Date
    Jan 2009
    Posts
    47
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Well, Manual is always a very good resource for me. I always look for the funtions specifications in the manual by using the search over there in the manual.

  18. #18
    SitePoint Zealot
    Join Date
    May 2008
    Posts
    182
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by felgall View Post
    I usually go to the manual when I need to remind myself how a particular function I haven't used for a while works.

    Haven't used 'goto' since the last timeI was writing in Cobol (where we used to use it to go to an exit paragraph at the end of the section due to not having a break statement)..
    Ditto, both times. The last time I used a goto was when I was using basic. The original basic, not vb...
    Stair Lifts & Residential Dumbwaiters, source of health news

  19. #19
    SitePoint Member
    Join Date
    Jul 2006
    Posts
    5
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yes, I read it regularly

  20. #20
    SitePoint Wizard bronze trophy
    Join Date
    Jul 2008
    Posts
    5,757
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I've spent countless hours reading it. Lately I've been looking at the new stuff in spl coming in 5.3 I also started reading the c source code a bit to see how certain things work when the manuals documentation is lacking.

    But I think the main reason why some people avoid the manual is because they have a hard time understanding it. While it's pretty beginner friendly as far as documentation for a programming language goes, a lot of it still requires you understand the documentation conventions, as well as other terms and aspects of the language. And for a lot of people, this means they get little out of it. But, I think these people will stay at a beginner level for a long time until they learn to use it.

  21. #21
    SitePoint Wizard silver trophybronze trophy Stormrider's Avatar
    Join Date
    Sep 2006
    Location
    Nottingham, UK
    Posts
    3,133
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Tarh View Post
    Off Topic:

    Using Ctrl+K works great, if the only thing that you search for is PHP functions!

    I also have the MySQL and Sitepoint reference installed as search engines, and I frequently use the search box for Google searches. That means I can't just leave PHP selected (and I couldn't find any keyboard shortcuts to change it either).

    This means that I can type:
    • php functionname to find a PHP function
    • sql termname to find an SQL term
    • web termname to find a JS/HTML/CSS term
    • wiki whatever to find a Wikipedia entry

    ...all after a single Ctrl+L!
    Yup, same with me.

  22. #22
    SitePoint Wizard silver trophybronze trophy Stormrider's Avatar
    Join Date
    Sep 2006
    Location
    Nottingham, UK
    Posts
    3,133
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Tarh View Post
    Likewise.

    However, I'd like to point out that, if you add the PHP Manual search extension to Firefox, you can set the keyword in the search engine list. That way, you can simply type php functionnamehere into the AwesomeBar and away it goes!
    You don't need an extension for this, you just set it up as a keyword search in firefox

  23. #23
    Grumpy Minimalist
    Join Date
    Jul 2006
    Location
    Ontario, Canada
    Posts
    424
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Stormrider View Post
    you just set it up as a keyword search in firefox
    How do you do that without installing PHP as a search provider?

  24. #24
    SitePoint Wizard silver trophybronze trophy Stormrider's Avatar
    Join Date
    Sep 2006
    Location
    Nottingham, UK
    Posts
    3,133
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Right click on the search box on php.net, set up keyword, type 'php', click OK

  25. #25
    Grumpy Minimalist
    Join Date
    Jul 2006
    Location
    Ontario, Canada
    Posts
    424
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Wow, did not know that!

    Although, I still prefer the search extension method so I don't require the extra bookmark.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •