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 (4th Edition)
Sams Teach Yourself JavaScript in 24 Hours (4th Edition)
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!


    0 of 8192 characters used
    Post Comment
    • mrpudgy profile imageAUTHOR

      Cliff Beaver 

      5 years ago from Murfreesboro, TN USA

      Glad you enjoyed it.

    • profile image


      5 years ago

      Really enjoyed this hub. Thank you so much.

    • profile image


      6 years ago

      you have a type in your article. you refereed to apache as a database when in reality it's web-server.

    • mrpudgy profile imageAUTHOR

      Cliff Beaver 

      8 years ago from Murfreesboro, TN USA

      Sounds like a good plan. All the best!

    • kschimmel profile image

      Kimberly Schimmel 

      8 years ago from North Carolina, USA

      Thanks, I knew the distinction. I figured a little Javascript to jazz up my webpages, and an in-depth study of Java to make myself more marketable.

    • mrpudgy profile imageAUTHOR

      Cliff Beaver 

      8 years ago from Murfreesboro, TN USA

      Just keep in mind that Java and Javascript have almost nothing in common. Javascript having the word Java throws some people off thinking they are similar in nature. Java is a whole other beast all together, so just keep that in mind, if you were thinking they were similar.

      Good luck all the same!

    • kschimmel profile image

      Kimberly Schimmel 

      8 years ago from North Carolina, USA

      As a FORTRAN programmer who took 20 years off to raise a house full of kids, I am getting back in the groove. In library school I learned some PHP and MySQL in a database course. Since I was a good structured programmer, I'm planning to learn Java and Javascript. My engineering professor hubby says they are always needing someone to do Java programming at his school.

    • Alexander Mark profile image

      Alexander Silvius 

      8 years ago from Portland, Oregon

      Enjoyed the hub. I am thinking at this point that in terms of programming (not specifically web design) I would like to learn the language that teaches from the ground up to the most complicated.

      I attempted javascript several times on w3schools (excellent teaching site by the way) and it completely eluded me. But when I started a class about Programming Logic and Design, it made total sense. Unfortunately I dropped that in favor of a class I thought I needed more, and I am now looking for a way to teach myself programming via the internet instead of college classes.

      Any suggestions which language to start with? I'm a complete newb so I can only throw out the idea of C# - is that a good heavy language that will give me a firm base to understand other languages from?

      I still have the book from that class and it is a wonderful resource, as it teaches how to map out decisions and loops and so on. Basic stuff I know, but it suits my learning style - step by step. Javascript makes logic leaps I can't grasp.

    • profile image


      8 years ago

      I've already startd learning JS ( before i read this hub )

      I think I have more use for it rite now.

      100% on the quiz :) ( first try )

    • mrpudgy profile imageAUTHOR

      Cliff Beaver 

      9 years ago from Murfreesboro, TN USA


      Yes, it can use the server and send and receive information. Javascript is considered to be a browser based language however. Languages that use a database however, are PHP.

      In the quiz, I stated that Javascript can send information to a server. Good to see comments. I like discussions.

    • profile image


      9 years ago

      Javascript is used as a server side language, typically using node.js or similar.

    • mrpudgy profile imageAUTHOR

      Cliff Beaver 

      9 years ago from Murfreesboro, TN USA


      It's awesome that you learned PHP first. It's a much more powerful language, not saying that JS doesn't have it's uses. But the whole fact that much of the internet is starting to rely heavily on databases, PHP is the web developers friend. Using JS and PHP hand in hand will find it's way to insanely awesome websites. =)

    • mskills profile image


      9 years ago from North Carolina, USA

      Oddly enough, I've warmed to PHP much quicker than Javascript. Maybe it is because of my lack of programming knowledge (Pascal[!] and a little C++), or perhaps it's the C-lite structure of Javascript that intimidates me.

      Shame, really, since the whole AJAX thing is the ONE thing that keeps me from just throwing in the towel on learning Javascript.

      I like the quiz, got an 80% on my first attempt (missed a Javascript-specific question, of course).


    This website uses cookies

    As a user in the EEA, your approval is needed on a few things. To provide a better website experience, 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:

    Show Details
    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 or domains, for performance and efficiency reasons. (Privacy Policy)
    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)
    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.
    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)