- HubPages»
- Technology»
- Computers & Software»
- Computer Science & Programming
Should I learn php or javascript first
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.
Javascript before PHP if you really want to know...
So I said learn Javascript first. I said this for two reasons. The reasons are:
- To familiarize yourself with a language and the anatomy of programming
- 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.
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!
Useful Links!
- Signup For HubPages - Make money writing hubs!
Make money writing hubs for Hubpages. Get great payouts while writing about things you love and know. - W3Schools Online Web Tutorials
HTML XHTML CSS JavaScript XML XSL ASP SQL ADO VBScript Tutorials References Examples