Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community!
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.Start your free trial
Scott Moore4,050 Points
So I just started watching lessons of PHP. Reading some other forums there's lots of arguments of which one you should use. JS if I am reading correctly is more client side. PHP more server side.
I'm just wondering from some of you all who have experience. Why would you use both? Am I mistaken in understanding they both accomplish the same thing with the exception of one is client and one is server?
As a new person learning, And not quite sure where these two will fit into my mix. What would you recommend learning first? There's also Ruby. So what would you recommend the new person to learn first?
Chris Shaw26,662 Points
I think using the word
more is distracting and won't help in explaining the languages, so here we go.
PHP PHP is purely a back end language meaning it only interacts with the user when a script is executed on the server, you would use PHP if you need to interact with a local database server, authenticating users for forms, making calls to third party APIs such as Twitter, Facebook and lots more. Like Ruby you only need to learn PHP once you feel you need something that browsers can't do such as connecting to a MySQL database.
A more detailed explanation about PHP
Erik Krieg43,038 Points
If you try the tutorials here for both, you should begin to see how they are used differently. I wondered the same thing initially, but as i delved into each the server and client environments became clear :)