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
Joel Rivera
29,401 PointsJavascript of PHP Which comes first?
I was wondering what should I learn first? Javascript or PHP? I already know HTML and CSS.
3 Answers
Ian Goode
515 PointsJavascript is for front-end stuff; interaction with the browser. PHP is for back-end stuff; interaction with the server. That's probably oversimplifying it but it's the general idea.
You can do a lot of real-time stuff like animation and automatically refreshing/displaying/hiding content with javascript, look into jQuery for that.
PHP is more for taking data, processing it and spitting something back out. Or sending data to a database to be saved, for example login details.
I'd start with javascript and jQuery, it'll complement HTML and CSS nicely and allow you to create much more interactive websites.
Luke Buśk
21,598 PointsDepends what is Your goal? I myself am a starter and also just learned HTML and CSS and have a similar problem. I think if You plan to create Your own website's and want them to be somewhat responsive then go with Javascript, if You want to dive into ready CMS like wordpress then PHP knowledge will be more useful.
J.T. Gralka
20,126 PointsHey Joel,
Yeah, like ?ukasz said, it depends on what you're looking to get into. I think it would be a good idea to learn some JavaScript if you've already learned HTML and CSS. I think you'll find that you'll be able to add some interesting interactivity to your webpages with some simple JavaScript. PHP is simple enough as well, and you should definitely look into it at some point. But, I understand that it can be overwhelming to try to take un three or four languages at the same time. I recommend looking into Andrew's Build an Interactive Website course to learn some of the fundamentals of the jQuery framework (which is a widely used JavaScript library).
In general though, I recommend checking out Jim Hoskins' Introduction to Programming course. It teaches you some fundamentals about JavaScript and it also teaches you how to think like a programmer, an important skill for anybody who wants to dabble successfully in any Web programming language.
Best of luck, and always remember that there are plenty of people here on the forums who are willing to help answer any questions you have about JavaScript and PHP. Most, importantly be courageous! Don't be afraid to challenge yourself!
Cheers,
J.T.
Minor Edit:
I forgot to include one of the links to the courses I was telling you about, so I went back and added it. Let me know if you have any questions.