Welcome Guest!
Please login
If you do not have an account yet on The Web Squeeze forums, please Register! It’s FREE and there are many benefits:
- Receive Fast Advice
- Learn Programming Languages
- Get Professional Website Reviews
- Quick Troubleshooting Assistance
|
|
Js Vs Php
This is a discussion on Js Vs Php, within the Web Development in General section. This forum and the thread "Js Vs Php" are both part of the Programming Your Website category.
![]() ![]() |
Jun 5 2008, 01:55 PM
Post
#1
|
|
![]() Squeeze Machine ![]() Posts: 560 Joined: 14-February 08 From: Stockport |
I no that JS and PHP are completely different languages, one is server side, one client side, and that they are used to acomplish completely different things.
But, which one is most used and, in your opinions, should i learn first? I no that you can get pre made JS libraries such as jquerey, but in the same light you can also download ready made php scripts. Any opinions lol ? Craig -------------------- |
|
|
Jun 5 2008, 02:10 PM
Post
#2
|
|
![]() Co-Founder ![]() Posts: 3,103 Joined: 13-February 08 From: my little igloo up north |
I would say PHP only because if you want to create your own blog or CMS or use a pre-made CMS like WP, it's all based on PHP.
I've been doing sites for 10 years now and I haven't had the need for JS ... not bad huh. I bought a book about AJAX but haven't had time to read it yet. Just my 0.02 cents -------------------- a web design portfolio | web non-sense - REDESIGNED!
I'm also on: del.icio.us | flickr | virb | facebook | twitter The Web Squeeze is also on: twitter | virb | facebook | stumbleupon |
|
|
Jun 5 2008, 02:16 PM
Post
#3
|
|
![]() Squeeze Machine ![]() Posts: 560 Joined: 14-February 08 From: Stockport |
Cheers Karinne, that's what I've thought, I've tried getting into PHP a few times but just not stuck at it. Had not even thought about JS until I was looking at learning XML, apprently it's recommended to know JS before so it got me thinking lol.
Anyway enough about my day, anymore thoughts? -------------------- |
|
|
Jun 5 2008, 03:23 PM
Post
#4
|
|
![]() Rapid Squeezer ![]() ![]() ![]() ![]() Posts: 182 Joined: 19-February 08 From: Netherlands |
It totally depends on your personal needs and where you want to go. If you're more into template creation and want to be able to create better client side scripting, and rather leave the programming to others, , I'd suggest learn JS. If you're into developing I would ofcourse suggest PHP. It covers more basic needs to develop sites than JS does. After you learn PHP, you can expand your knowledge with JS.
Whichever you choose, if you learn to do one of them well you will learn the other one much easier. I know I learned C++ in school, then lateron I learned Java, and after that PHP wasn't that much different. Before that I did ASP, which has a bit different syntax, but the idea behind programming is generally the same. It's some kind of logic that you need to understand and then explore more to be able to do more difficult things. Learn the most difficult one, and you learn the basics of all i think -------------------- fresh-style.nl - small webdesign & development projects |
|
|
Jun 6 2008, 01:58 AM
Post
#5
|
|
|
Master of the Universe ![]() Posts: 1,298 Joined: 15-February 08 From: London, England |
At the end of the day if you want to anything that is vaguely dynamic you are going to need to learn PHP or some other similar language. There really is no way around it. Most major CMS use PHP and without knowing it you will find your promptly lost when it comes to simple tasks such as creating templates.
For this reason I would definitely say that PHP is far more important than JavaScript. Even if you only learn it to the point where you know what is going on but cannot write it you will be greatly benefiting your skill set. As for JavaScript. It should be used for the icing on the cake. Those little touches which really improve your website. If you know php then you should also try out Ajax. -------------------- |
|
|
Jun 6 2008, 02:00 AM
Post
#6
|
|
|
Squeeze Machine ![]() Posts: 677 Joined: 15-February 08 From: UK |
I would say PHP, if only because PHP includes are so useful. PHP has saved me a huge amount of time by allowing me to cut down on manual coding of a page. It's like frames on steroids, but with none of the downsides.
There's a considerable amount of overlap between the two. Javascript is useful mainly to add interactive elements, such as user preferences for a web page. These can also be done in PHP, but personally I like to avoid using query strings to store preferences in the URL. One big advantage of PHP scripting is that, because it's done on the server, you don't have to worry about clients who have javascript disabled. PHP scripting works for everyone, whereas javascript scripting will fail for some users (perhaps about 5%, but reliable stats are hard to come by). PHP is also much faster than javascript, in my experience. When you use javascript, the client must download and execute the script; when you use PHP, the script is executed on the server. I actually learned JS before PHP, but I would recommend doing it the other way around. |
|
|
Jun 6 2008, 02:28 AM
Post
#7
|
|
![]() Squeeze Machine ![]() Posts: 560 Joined: 14-February 08 From: Stockport |
I would say PHP, if only because PHP includes are so useful. PHP has saved me a huge amount of time by allowing me to cut down on manual coding of a page. It's like frames on steroids, but with none of the downsides. There's a considerable amount of overlap between the two. Javascript is useful mainly to add interactive elements, such as user preferences for a web page. These can also be done in PHP, but personally I like to avoid using query strings to store preferences in the URL. One big advantage of PHP scripting is that, because it's done on the server, you don't have to worry about clients who have javascript disabled. PHP scripting works for everyone, whereas javascript scripting will fail for some users (perhaps about 5%, but reliable stats are hard to come by). PHP is also much faster than javascript, in my experience. When you use javascript, the client must download and execute the script; when you use PHP, the script is executed on the server. I actually learned JS before PHP, but I would recommend doing it the other way around. At the end of the day if you want to anything that is vaguely dynamic you are going to need to learn PHP or some other similar language. There really is no way around it. Most major CMS use PHP and without knowing it you will find your promptly lost when it comes to simple tasks such as creating templates. For this reason I would definitely say that PHP is far more important than JavaScript. Even if you only learn it to the point where you know what is going on but cannot write it you will be greatly benefiting your skill set. As for JavaScript. It should be used for the icing on the cake. Those little touches which really improve your website. If you know php then you should also try out Ajax. Cheers for all the replys Looks like it's time to get the Lynda videos out lol -------------------- |
|
|
Aug 18 2008, 03:26 PM
Post
#8
|
|
![]() Squeezing ![]() ![]() ![]() Posts: 76 Joined: 14-February 08 From: Las Vegas, NV |
Not to be the devil's advocate here and reiterate what you had already said, but JS and PHP are two totally different types of languages and can't really be compared like that. Because JS is client-side and PHP is server-side makes them extremely different. As far as which is used more? Without trying to sound contradictory, most likely JS simply because it's the by far most common client-side language out there and can be used in conjunction with PHP, ASP, .NET, Ruby, etc, etc... Comparing PHP and JS imho is like comparing apples to oranges. There used for very different things. As far as which to learn? Well, although I'm a PHP nut, I'd say it's a good thing to JS under your belt simply because you can use it with whatever server side language you decide to use down the road.
-------------------- http://www.infoonmike.com
"Always program as if the person who will be maintaining your program is a violent psychopath that knows where you live." Martin Golding |
|
|
Aug 18 2008, 03:57 PM
Post
#9
|
|
|
Master of the Universe ![]() Posts: 1,298 Joined: 15-February 08 From: London, England |
Oo reigniting a debate.
I still stand with what I said previously. To create versatile websites you need to know a language like php. JavaScript is great and nowadays is the cornerstone of usability. Especially when it comes to forms. Futhermore JS can be used for animation, drag & drop etc etc. Its where you want to go. If you want to be a web designer then learn JavaScript. It can add great value to your websites. If you want to be a web developer then learn php. If you are undecided then go for php, for a 'web person' it will allow you to do lots of things with content management systems, create dynamic websites and generally have some fun. Don't get me wrong, you can have fun with JavaScript too but when you are working with static html its just not as fun. And finally, jobs. Many jobs want javascript but far more want php. When it comes to freelancing, in my experience, I have found far more projects requiring php than just html/javascript. -------------------- |
|
|
Aug 24 2008, 10:13 PM
Post
#10
|
|
![]() Squeezing ![]() ![]() ![]() Posts: 76 Joined: 14-February 08 From: Las Vegas, NV |
-------------------- http://www.infoonmike.com
"Always program as if the person who will be maintaining your program is a violent psychopath that knows where you live." Martin Golding |
|
|
Aug 24 2008, 11:02 PM
Post
#11
|
|
![]() Squeeze Machine ![]() Posts: 764 Joined: 13-February 08 From: Catching the squeezed drips downunder. |
If you've got your hat screwed on correctly and have noticed the general trend of the web these days, you would be wise to pursue both options simultaneously.
Ajax is the "in thing" and there's nothing to suggest a replacement sweeping over the mainstream any time soon. Of course you don't have to couple Ajax requests with PHP ( the choice of server side language is yours and yours alone) but PHP is a pretty good place to start. When I started to look at web design (only about 6 years ago), DHTML was the buzz word -- the DOM and ECMAscript recommendations were niche talk (and WTF is an XHTTPRequest Object?) and I felt safe to look at PHP before I bothered with JavaScript. To do this now could possibly be a career crippling, or at a least career limiting, move. My current occupation is a web programmer but I am spending equal amounts of time writing JavaScript as I am writing PHP and Python. It would be an advantage to choose a server-side language and then work with them together, try not to treat them as separate entities and look at learning their synergy -- you'll learn how to make interactive pages as well as dynamic pages and with AJAX, learn to make interactively dynamic pages. Win win to me. -------------------- |
|
|
If you found The Web Squeeze to be helpful, please donate so we can keep this site FREE, FRESH, and fortified with Web Design & Development info!
![]() ![]() |
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:






Jun 5 2008, 01:55 PM












