Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

For a couple of months now I have been wanting to learn Javascript and PHP but the lack of time didn't give me that opportunity. I'm in a position that have enough time to learn only one language and practice it or both in a row without doing any practice for about 1-2 months except the code in the books.

I have a bit of Java programming background and have built 3 applications in Java , so I'm not totaly new when it comes to programming, but I can't say I'm at an intermediate level. I also have some experience with jQuery, which by the way I recently realised it was a mistake to learn jQuery before Javascript and XHTML/CSS.

These are the recources that I am planning to read for both of them:

Javascript:

  1. Getting Good with JavaScript
  2. Professional JavaScript for Web Developers 3rd Edition
  3. JavaScript 24-Hour Trainer
  4. Javascript Patterns
  5. JavaScript: The Good Parts

PHP:

  1. PHP Solutions Dynamic Web Design Made Easy 2nd.Edition
  2. PHP and MySQL Web Development 4th Edition
  3. Oreilly PHP Cookbook 2nd Edition

These were the resources that were recommended to me by a friend to fully grasp these two technologies exactly in that order and these are the ones I plan to read in the time that I have in the summer. If there is anything you would like to add please feel free to tell me. I am committed to learning them both to their full potential.

So what I want to ask if it is appropriate to try and learn PHP immediately after learning Javascript or should I stick just to one of them until I learn it better and move to the other after?

share|improve this question
    
Books are ok as far as they go, but you have to have pain making you learn your lessons -- you have to program and pick up all the disciplines surrounding it. Look at it like this, in a couple hours someone can learn how to read music to the extent where they know how to map the scribbles onto piano keys and time and force. But that won't make you a musician, and more importantly it won't make you a good composer. Focus on one language and becoming a PROGRAMMER. 'Knowing' other languages doesn't buy you much. –  Mark Jan 29 '12 at 16:28
1  
@Mark I'll have to disagree with that. Web development usually requires thorough knowledge of a deep stack. Focusing on a single technology won't get you very far. OP already has programming experience, so I really don't understand where your comment is coming from... –  Yannis Rizos Jan 29 '12 at 16:36
    
@YannisRizos Yes, I realized the deep stack thing after I posted my comment. I will still stand behind it on the basis of learning to architect is more important at this stage than getting your feet wet all over the place. I know web dev is always going to be "and now I need a little php, or flash, etc" to get your project done. This patchworking is not all that conducive to real skills development is my point I guess. –  Mark Jan 29 '12 at 16:50
    
@Mark Well, it seems that we actually agree :) –  Yannis Rizos Jan 29 '12 at 17:44
add comment

closed as not constructive by Yannis Rizos, MainMa, Mark Trapp Jan 29 '12 at 20:57

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.If this question can be reworded to fit the rules in the help center, please edit the question.

5 Answers

up vote 1 down vote accepted

It doesn't really matter. Since you are certain that you cannot learn both technologies at the same time, you can start with either. PHP and Javascript are related in the sense that they are popular web development languages, but PHP is a back-end language and Javascript a front-end one.

I'd advise you to start with Javascript, since you have already been exposed to it via jQuery. Your friend's recommendations are solid, but of course the hard work is up to you. JavaScript: The Good Parts is an excellent book, and if you are going to read only one, I'd say this should be it.

As for PHP, I'm a huge fan of the manual and in most cases I feel it's adequate when first exploring the language. Of course, a book will obviously be more structured towards learning. From the books you mention, I've only read O'Reilly's "PHP Cookbook", and you should consider it after you get a fair time exploring the basics of the language. It's great, but not introductory.

share|improve this answer
    
It's not about the hard work I am very dedicated to learn both it's the free time I have 3 months until I start my last year of coledge and I never have time for what I truly like to learn but I did manage this yar to get a firm grasp of xhtml/css/jQuery –  user1146440 Jan 29 '12 at 16:28
    
@user1146440 Ok then, go for it! Since you've already been exposed to front-end technologies, you should start with Javascript. –  Yannis Rizos Jan 29 '12 at 16:34
add comment

PHP is a good starting point to learn how to inline code in the HTML page. Inline coding will be a change from java and your efforts in learning at this point should focus on getting comfortable coding inside the HTML page.

Some people bang on PHP for messing markup code, but it does make concise readability, if you focus on getting organized and keeping your code commented. I don't work in PHP currently, but have done enough PHP scripting to enjoy the process of seeing all of the functionality in one file.

Along with PHP, coding mySql inside the functions of PHP will also keep all of the code in one file. I am not saying that you shouldn't use external PHP files and include them; of course you should.

When you get your skillset up to the level where moving things out of the original file makes life easier for you, then building external files and using includes make sense, but not until you've grokked basics of how PHP functions bring data and features close to hand.

Since PHP is a backend language, adding some Javascript to your learning process will come naturally in order to provide advanced client-side functionality. Composing behaviors, learning new languages/techniques, working with the tools of building software and gives you the rewards of deploying software that works.

Have fun learning and not so much focusing on books and recipes.

share|improve this answer
add comment

Javascript is a very common language, and is a skill that you can use irrespective of the server-side language being used be it ruby, php, asp, .net etc. It is also not front-end only; e.g. you could write applications with your whole stack being javascript ( node.js, mongodb + frontend js). Node knowledge in particular is also increasingly popular/in demand and for this reason alone if you are at a decision point I would suggest to focus on learning javascript (and by javascript - I don't mean jquery).

If you know (or as soon as you do) anything at all about javascript - read "the good parts" before cntinuing, do not delay reading this book to read others.

Whichever permutation you choose - learn by doing. Things you learn by reading only are forgotten just as fast.

share|improve this answer
add comment

PHP is an excellent backend language. It can be learnt quickly and allows you to develop dynamic pages within no time. Its has an easy to learn syntax as compared to Javascript, so i suggest start from PHP and learn it as a base language.Then try writing some simple javascript code and learn it side by side with PHP, just to include some additional features in your webpages.

share|improve this answer
add comment

As someone who does JavaScript for a living, I'd definitely say that you should invest as much time as possible into learning it. Ignore PHP for now, backend technology is completely replacable, and god knows there are way better alternatives than using PHP.

JavaScript on the other hand is the only language on frontend side, and with Node.js it has also gained a lot of ground on the Server recently.

From the books you've listed I'd recommend to read 2. First of all the incredible good as well as incredible opinionated JavaScript: The Good Parts from our all beloved / hated Crockford. Its a great way to dive in a to be warned about the quirky parts, it should prevent you as a beginner from making a lot of stupid mistakes in the first place. But as said, Douglas is a pretty opinionated man. Therefore, I'd recommend to read JavaScript Patterns afterwards, it will give you a broader view on different styles of writing JS code and it's definitely a great resource.

For more resources on JavaScript, check out the Tag Wiki at SO.

Crockford also gave some great talks on the languages history in recent years, they're worth the watch.

As far as shameless plugs go, I created something called JavaScript Garden last year which goes into detail on many of the quirks and WTFs of the language.

share|improve this answer
add comment

Not the answer you're looking for? Browse other questions tagged or ask your own question.