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! While you're at it, check out some resources Treehouse students have shared here.

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

General Discussion

Konrad Pilch
Konrad Pilch
2,435 Points

Facebook Like Applikation JS, PHP + additions

Hey there Marcus Parsons .

So reflecting on what you wrote

*"AJAX is a part of JavaScript. In fact, the acronym for AJAX has JavaScript in it: Asynchronous JavaScript And XML (AJAX) haha You make AJAX requests by using JavaScript.

JavaScript goes to handle most of the heavy lifting, because then, the server isn't doing all of the work for thousands of people; their computer is doing most of the work because JavaScript is a client side language (mostly lol see a special case such as NodeJS which is server side JavaScript).

That is correct about PHP, though, Konrad. Some of the uses that you can and absolutely should be doing are: post-validating data received from the user (use JS for initial validation of data), make requests to and from any databases you use, keeping track of pertinent login information to continually verify that the user making any request is the authorized user of that account (man in the middle attacks), etc.

Basically, what it boils down to is that PHP should play the back up for JavaScript. It should fill in all of the gaps that JS inevitably has to leave behind.

If you're interested in talking more about this, you should make a new thread dedicated to this question and tag me in it. I don't want to keep blowing up Richmond's feed! Sorry, Richmond Lauman! haha"*

My question is:

Im confused right now : p I read on the internet that if you want to move fast and put web app facebook like or market like webiste, i will need PHP . That will handle all the data etc.. but you say here abotu JS and PHP as a support for it . So i dont quite get it how this works.

For a Facebook like web , i will need the knowledge of :

+User log in/out
+Friends etc..
+News Feed
+Search Filter ( whether its cars :color, size etc.. or people)

And that all seem that the website its done coz thats basicaly all it needs.

A login , news feed and search filter . So you said PHP as for security reasons and keeping track from the server side? and JS used for : A first class of data handling that they downolad on their PC, insted of PHP request which make it faster for the PHP when million users will use it or any big amout right?

So how does or how should a new developer start? meaning like me , i went straight onto PHP, but WP is in PHP to . I can make layout and put it in WP with PHP right? and then soem plugins etc... ? or anyways PHP and WP toghether at first?

Like i dont quite get it . I know that all the libraries are form the orginal programming language but its just somebody elese that wrote it and for others there is faster code like funcitonns $superSpeed { 10*10} and i just write $superSpeed and the equation come from the libarary right?

I hope its not too messy .I should learn about organizing my writing : p im getting better at spelling and grammar a bit , with time but the content uhh xd

1 Answer

When you use PHP code, the code is executed on the server. So, if 100,000 users run some of your code that's in PHP, your server has to handle the processing of all 100,000 of those requests. But, if most of the heavy lifting is done by JavaScript before it is sent off to the server, you will drastically eliminate the load that the server has to process. That is why you want the server to have the lightest load possible.

Honestly, I've heard more than a few times that the first language you should learn is JavaScript (after the basics of HTML and CSS of course). It is an extremely powerful language and plays a big role in practically every single website out in the wild of the internet.

I can't answer every single question, but I can say that you will learn more as time goes on. Mix up your lessons between PHP and JavaScript and play around with making simple stuff. Trial and Error leads to Results and Success!

Konrad Pilch
Konrad Pilch
2,435 Points

Thats great advice! Its clean :) Thank you very much .

I get it now i believe.

So as now im learning PHP, i should still do it , but add some JS now right?

So basically do some JS courses on treehouse as well and then try to mix them together of like making a page where only 5 feeds load and if theres and 6 feed it creates a new tab on the same page? xd this kind of stuff?

To be honest, i will take time to learn etc.. but im really exited to code up website with news feed, login etc.. and i have , or i need to build on ethat requires onli search filter, login and posts . So im just like urrrr why cant a be 3 months older now, i would know what i want :D but actually the fun part comes in learning it sefl too. Especially when testing xd weird but it does make me feel good. Oh i know why , failiture. Failiture as a friend , i know im moving toward my goals so the more i fail the closer im going to be the coal and the harder i try heh . Bdw i wrote this all that came up in my mind . Half not all.

But uhh my English , its messy : p at least my spelling has improved by reading books : p 230 pages. Ok 30-60 min every day from 8-15 pages .

I know that other people read a book in a week : p

Theres soo much to learn ! And the day is soo short ! :( im going to feel completed when ill make the website i want xd on my first goal of course.

I dont know , but i think i went of the path too : p i quite like writting too.

Thank you for the advice and making it clear

So ill take some JS and PHP courses and try to do something with them on one page : p