Starting to learn php

Discussion in 'Scripts, 3rd Party Apps, and Programming' started by myground, Feb 13, 2013.

  1. myground

    myground New Member

    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    0
    Hey guys; I want to know where I can start to learn php. Forums are awesome for asking questions but I'm not quite up to that stage yet.

    I've already got some programming experience(a year formal education) in C# and python. So where can I go to find some really good online resources?


    Thanks
     
  2. essellar

    essellar Community Advocate Community Support

    Messages:
    3,295
    Likes Received:
    227
    Trophy Points:
    63
    You could do a lot worse than the PHP 101 series over at the Zend Developer Zone. It's worth starting with the basics, since the data typing (what arrays are, etc.) will be somewhat different from what you're used to, and the idea of web templating may be foreign to you. Honestly, though, once you're somewhat up to speed, the PHP documentation (available as a Windows CHM help file as well as online) isn't all that bad.

    PHP can be used in a number of different styles with a number of different paradigms, so expect to find a bit of conflicting advice out there. (And expect to be called names by the cool kids. Apparently Haskell and Erlang are good, and Python and Ruby/Rails are allowed if you absolutely have to use them. I'm a Lisper myself, and one of these days I'll actually be able to use a Scheme somewhere. I think.)
     
  3. myground

    myground New Member

    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    0
    Thank you I've now been humming along on it for an hour or so.


    Sorry to sound stupid but could you explain this a little more? do Haskell and Erlang go over php to expand the it's libraries? Also what do you mean Python, Ruby/Rails are allowed if you absolutely need them? Are you referring to x10's hosting environment or just general web development?

    Thank you for your help and for pointing me in the right direction; I've never developed for the web before so this is a big help. Thank you :)
     
  4. essellar

    essellar Community Advocate Community Support

    Messages:
    3,295
    Likes Received:
    227
    Trophy Points:
    63
    No, no, nothing like that. It's the current version of the "language coolness wars".

    Haskell is a strongly-typed¹, pure functional language² that is the darling of the "provably correct" crowd. And it's great, provided that you never need to get anything into or out of the system—that would mean breaking out of pure functional style, creating "state" (the machine is different at one point in time than in is at another because you changed something), and making your program no longer "provably correct".

    Erlang is an incredibly robust language developed originally by Eriksson for its telecom system. You write a series of completely independent modules that pass messages back and forth between them, each keeping its own version of the data (nothing is ever changed; modified copies are created). If any process/module fails, it can be tried again and again until it works or is confirmed dead forever, without damaging anything. The only problems with Erlang, really (besides the fact that most programmers can't quite wrap their heads around it) is that it's snail-slow and memory-intensive. That robustness has to come from somewhere, and time and memory space are the trade-offs.

    Ruby and Python once were really cool because almost nobody used them. There has always been at least a little bit of truth to the notion that only interested, competent programmers will go out of their way to choose a new, unpopular or obscure language for their work because it is the right tool for the job. But like everything in life, once enough people find out what's cool and try it themselves, it becomes mundane and uncool. But they were cool last year, and there actually are libraries available that make them practical—and sometimes even the coolest of the cool kids has to bow to practicality.

    (Ruby/Rails will probably never fly on shared hosting here at x10. Python is occasionally available of Free Hosting, but don't rely on it unless you're on a paid Premium plan. You wouldn't be able to install any of the modules due to necessary system permissions, and too many of the modules have too high a potential for abuse on Free Hosting.)
    ___________________________________________
    ¹ Strongly typed means, essentially, that once a variable has been given a data type (a string, a number, a Boolean value, or what have you) it is guaranteed to have that type at all times. You can't put a string where a number used to live, and you can't even try to do number-y things to strings. PHP isn't like that—a variable will contain precisely what you last put into it (and there are many places that data can come from, so you don't necessarily know what the actual data type is at any given time). You can try to do number-y things to strings, and if the string can be automatically coerced into a number, it will often act as if it were a number.

    ² That's "functional" in the mathematical sense of the word "function"; it doesn't just mean that it works. In math, when you write y = 2x, you are describing a relationship between two numbers. Purely functional languages work the same way—you aren't describing the process of fetching a value from a location you have given the label "x", multiplying that value by two, then assigning the result to a location you have labelled "y"; rather you're describing an "always true" relationship between the two numbers. Of course, when the program actually runs, bits are moved back and forth between registers and memory locations, so the results are the same in the end, but the style of coding and the way you can analyze and reason about the code is completely different. You'd need to have some exposure to functional programming in order to visualize it. I'd suggest the first couple of lectures in Hal Abelson and Gerry Sussman's Structure and Interpretations of Computer Programs if you want to begin exploring. (The lectures come from a special, accelerated version of MIT's 6.001 course given to some Hewlett Packard engineering employees in 1986. They go very quickly and cover a lot of ground—the HP employees were already engineering professionals, so some common knowledge could be taken for granted—but the first few lectures are pretty easy to follow without much knowledge or experience. Well, except for all of the mind-blowing; that takes some getting used to.)
     
  5. necpro

    necpro New Member

    Messages:
    11
    Likes Received:
    0
    Trophy Points:
    0
    This tutorial is excellent. I learned from him at the start of programming. Even now often come to seek help. However, my advice is to help someone who has more experience in programming
     
  6. ezadx10b

    ezadx10b New Member

    Messages:
    29
    Likes Received:
    0
    Trophy Points:
    1

Share This Page