ArtsAutosBooksBusinessEducationEntertainmentFamilyFashionFoodGamesGenderHealthHolidaysHomeHubPagesPersonal FinancePetsPoliticsReligionSportsTechnologyTravel

Should I learn php or javascript first

Updated on July 7, 2012
To Javascript or not to Javascript... That is the question!
To Javascript or not to Javascript... That is the question!

What should I learn first?

Well, you have gone and done it now. You have asked the biggest, most asked question amongst new self taught web developers worldwide. Should you learn Javascript or PHP first? The answer is not that difficult and what matters most is what you are trying to achieve. Before we go any further, you must understand that Javascript and PHP are two totally different languages and are used for two totally different things!

Most of the time, when I receive a question from a would-be web developer, it consists of, "What are the two languages used for and which should I learn first." Again, what are you trying to do? It really doesn't matter which you learn first. They both have a learning curve, especially for someone who has never seen a programming language (or scripting language), and they both are used on the web equally. If you want a full arsenal of developing tools at your disposal, learn both. Simple as that.

I realize that this answer will probably not satisfy you because you are reading this because you want an answer of which to learn first. So I am going to say learn Javascript first. Why is this the answer I chose? Read below for a more informative reason.

Sams Teach Yourself Javascript in 24 Hours
Sams Teach Yourself Javascript in 24 Hours
One of the best "Teach Yourself" Javascript books available and highly recommended for people wishing to break into Javascript.
 

Javascript before PHP if you really want to know...

So I said learn Javascript first. I said this for two reasons. The reasons are:

  1. To familiarize yourself with a language and the anatomy of programming
  2. It's easier than PHP!

You need to understand how programming languages work in order to use them and Javascript is easier to learn because the syntax is easier and you don't have to work with a database like PHP. Javascript is simply browser based. It doesn't need to be compiled like C#, C++, Visual Basic, etc etc... What you type into your .js file is what will happen on the screen when the browser loads or when the end-user clicks on something that calls the Javascript to do something.

Now I know that some people will comment "Javascript isn't a programming language, it's a scripting language." Now while that is true, it really depends on who you talk to whether or not it could be considered programming. You still deal with syntax. You can still make web applications. You still go through the same headaches. So in my book, I will call it a web programming language.

Javascript will get you familiar with programming. It's a given. Like I stated above, there is a learning curve, especially if you are totally new to the programming game. I suggest that you get a good book on Javascript. I have used many good books, but the best I have used has been the one listed above. It really teaches you a lot and if you go through it a couple times, you can master the basics of Javascript in no time.

So in conclusion of this section, learn Javascript because it will familiarize you with programming and because it's easier and quicker to learn.

Learning PHP, MySQL, and Javascript (Animal Guide)
Learning PHP, MySQL, and Javascript (Animal Guide)
Learn all 3 in one easy to follow book. Recommended if you wish to get the benefit of learning all 3 languages in one book.
 

Learn PHP for powerful interactive websites

PHP is all about being able to build powerful websites that are able to manage content and streamline processes. PHP is the meat and potatoes of the web languages. The catch to this is that you need to also use a database such as Apache or MySQL. This means that in order to use PHP, you must also be aware of how to use a database. See why I suggested Javascript first?

If you are very dedicated to learning how to build nice dynamic websites, you will want to learn this language. But take my advice and still learn Javascript if you haven't already.

Now I'm not saying you can't learn PHP first. Many people choose to learn PHP first because you can do so much more with it. It is way more powerful than Javascript. The flipside to this is that the syntax can be much more difficult to learn and comprehend if you are new to this, and it takes twice as long to learn because you are learning two different things. The PHP and the database. It can be done however, and Javascript is not mandatory to learn first. It just takes time, dedication, trial, and error. But I still recommend Javascript first.

Some examples of what PHP can be used for are found below:

  • Joomla is based off of PHP
  • Wordpress
  • Drupal ( Just about any CMS out there )
  • Authentication ( logins etc etc )
  • Uploading and downloading things from a server database
  • Etc...

I think you get the picture. You can use PHP to do some pretty cool stuff on the web.

In closing...

If you are wondering what to use to program Javascript or PHP in, you can use any text editor such as notepad. Any windows machine will have a version of notepad on it.

So I hope this at least brought you a little closer to discovering which web language you want to learn first out of Javascript and PHP. Like I stated a billion times before, if you want to really be able to do some magical things on websites, learn both. They both serve their purposes well and one has advantages over the other. They both have their pro's and con's and one may be better for a certain task than the other.

If you liked this hub and found it informative, rate it as such. If you wish to discuss things further, post in the comments below. Thank you for reading and have a wonderful web experience!

working

This website uses cookies

As a user in the EEA, your approval is needed on a few things. To provide a better website experience, hubpages.com uses cookies (and other similar technologies) and may collect, process, and share personal data. Please choose which areas of our service you consent to our doing so.

For more information on managing or withdrawing consents and how we handle data, visit our Privacy Policy at: https://corp.maven.io/privacy-policy

Show Details
Necessary
HubPages Device IDThis is used to identify particular browsers or devices when the access the service, and is used for security reasons.
LoginThis is necessary to sign in to the HubPages Service.
Google RecaptchaThis is used to prevent bots and spam. (Privacy Policy)
AkismetThis is used to detect comment spam. (Privacy Policy)
HubPages Google AnalyticsThis is used to provide data on traffic to our website, all personally identifyable data is anonymized. (Privacy Policy)
HubPages Traffic PixelThis is used to collect data on traffic to articles and other pages on our site. Unless you are signed in to a HubPages account, all personally identifiable information is anonymized.
Amazon Web ServicesThis is a cloud services platform that we used to host our service. (Privacy Policy)
CloudflareThis is a cloud CDN service that we use to efficiently deliver files required for our service to operate such as javascript, cascading style sheets, images, and videos. (Privacy Policy)
Google Hosted LibrariesJavascript software libraries such as jQuery are loaded at endpoints on the googleapis.com or gstatic.com domains, for performance and efficiency reasons. (Privacy Policy)
Features
Google Custom SearchThis is feature allows you to search the site. (Privacy Policy)
Google MapsSome articles have Google Maps embedded in them. (Privacy Policy)
Google ChartsThis is used to display charts and graphs on articles and the author center. (Privacy Policy)
Google AdSense Host APIThis service allows you to sign up for or associate a Google AdSense account with HubPages, so that you can earn money from ads on your articles. No data is shared unless you engage with this feature. (Privacy Policy)
Google YouTubeSome articles have YouTube videos embedded in them. (Privacy Policy)
VimeoSome articles have Vimeo videos embedded in them. (Privacy Policy)
PaypalThis is used for a registered author who enrolls in the HubPages Earnings program and requests to be paid via PayPal. No data is shared with Paypal unless you engage with this feature. (Privacy Policy)
Facebook LoginYou can use this to streamline signing up for, or signing in to your Hubpages account. No data is shared with Facebook unless you engage with this feature. (Privacy Policy)
MavenThis supports the Maven widget and search functionality. (Privacy Policy)
Marketing
Google AdSenseThis is an ad network. (Privacy Policy)
Google DoubleClickGoogle provides ad serving technology and runs an ad network. (Privacy Policy)
Index ExchangeThis is an ad network. (Privacy Policy)
SovrnThis is an ad network. (Privacy Policy)
Facebook AdsThis is an ad network. (Privacy Policy)
Amazon Unified Ad MarketplaceThis is an ad network. (Privacy Policy)
AppNexusThis is an ad network. (Privacy Policy)
OpenxThis is an ad network. (Privacy Policy)
Rubicon ProjectThis is an ad network. (Privacy Policy)
TripleLiftThis is an ad network. (Privacy Policy)
Say MediaWe partner with Say Media to deliver ad campaigns on our sites. (Privacy Policy)
Remarketing PixelsWe may use remarketing pixels from advertising networks such as Google AdWords, Bing Ads, and Facebook in order to advertise the HubPages Service to people that have visited our sites.
Conversion Tracking PixelsWe may use conversion tracking pixels from advertising networks such as Google AdWords, Bing Ads, and Facebook in order to identify when an advertisement has successfully resulted in the desired action, such as signing up for the HubPages Service or publishing an article on the HubPages Service.
Statistics
Author Google AnalyticsThis is used to provide traffic data and reports to the authors of articles on the HubPages Service. (Privacy Policy)
ComscoreComScore is a media measurement and analytics company providing marketing data and analytics to enterprises, media and advertising agencies, and publishers. Non-consent will result in ComScore only processing obfuscated personal data. (Privacy Policy)
Amazon Tracking PixelSome articles display amazon products as part of the Amazon Affiliate program, this pixel provides traffic statistics for those products (Privacy Policy)
ClickscoThis is a data management platform studying reader behavior (Privacy Policy)