![]() |
Is learning JavaScript worth it?
I recently got a fairly good book on learning JavaScript, but with seeing what I could do with PHP and Perl... I'm starting to wonder whether it's worth learning. My dad did buy this book for $40 though so I'll probably read it anyways, but do you guys think JavaScript is a good thing to learn?
|
Well, JS and PHP/Perl aren't meant for the same thing (and can't do the same things). If you want a dynamic frontend (e.g. the user can operate widgets on your html pages, stuff moves, roll-over events) there's JS, if you want a dynamic backend (databases, proper use of GET and POST variables) there's the server-side programming languages.
Most of the visual effects of JS can be handled with CSS nowadays, but JS recently had a small renaissance with AJAX (dynamically loaded content on events). AJAX application examples: Google's Gmail and Google Maps. |
Well PHP is a lot more powerful and can do more things.
But it is worth learning JavaScript anyway, it will help you understand the concepts of PHP and it can prove useful. You may as well read the book and not waste it. When you want to learn PHP, ther eis no need to buy a book IMHO, because php.net has great documentation. |
Thanks for the help, I'll learn JavaScript. I don't build websites professionally or anything (although I may get paid for some soon) I've been making them for the swim club I'm in and for my uncle's home theater business, and I think my uncle has found me more jobs to do that i'll get paid for! So basically I just want to learn as much as I can so I can make great websites. After I'm done learning how to make good websites with DHTML, PHP and probably Perl, I can move on to things like C/C++, because I have Visual Studio 2002 on my computer.
|
Nice, it seems that you have everything planned out :D
C++ would be a great step after you have learnt some web technologies. |
Yeah, I'm not sure what books I should get to learn about this though, i've been reading the For Dummies books, I think they're pretty good, but if there's any other series you can recommend, that would be great! I'm reading JavaScript for Dummies (4th Edition) right now... I'm a little bit confused with JavaScript so far, but I'm hoping that it's because I've never used it before...
|
Let me reiterate what Simon Gray said, because I think ColdDeath missed a vital point. PHP, as typically used, is server-side code. It runs on the server, possibly builds a page dynamically, and transmits that page to the client to be rendered. The page, as it lives on the browser, is no longer in contact with the server. There is no interaction beyond what you can achieve by making a new request to the server and getting another page. I don't think you'd want to accomplish mouse interactions in that fashion.
JS (and other scripting languages) runs on the client. Interaction with client-side events is immediate. There is no demand on the server, and no demand on the internet's infrastructure, unless that event requests a new page (or the old page, again). A lot of people now disable scripting on the client. These people won't be looking at something using the Google Map API, for instance, because the API is implemented in Javascript and loaded as part of the page load. Another good reason, for example, is client side validation of forms. You always need to validate on the server, also, because forms can be farbled with. Nevertheless, if you validate on the client, you likely won't have to have additional request/response transactons between the client and server just to straighten the dumbass out. Sometimes these repeated transactions don't seem important in the light of the speeds many people have, connection-wise. Who cares if you go back to the server forty times, if the pages load rapidly? Well, for one thing, not EVERYONE has cable or DSL or similar. Some still have slow modems. For another thing, someone is still paying for the bandwidth you are requiring with the additional transactions. Most web-designers don't pull out the pocketbook -- their client does. If your client ever catches on to the fact you're blowing bucks needlessly, your client will be shopping for a new web-designer. |
There goes DaWei again, just inflating his post count :p
|
javascript is like a "lite" programming language and can help you ease into the harder stuff. it's syntax is very OO Java style.
btw, javascript for dummies is the worst goddamn book i've ever attempted to read. put it on the back of your toilet in case you ever run out of toilet paper. i don't say that because i'm some kind of literary elitist and despise anything that says "for dummies" on it, but in that particular case it should have been called "javascript by a dummy". like 6 pages into the book it shows this example program with all these foreign constructs that's like three pages long, and your first impression is "whoah, this is TOO hard". it's NOT. the book never explains anything very well. i was really upset when i bought it because that was when i first got into this stuff and i thought maybe it was just too damn hard. i GREAT javascript tutorial for someone with no programming background can be found at www.htmlgoodies.com and it's free, so what the hell. :p |
Nice avator, bl00dninja.
|
| All times are GMT -5. The time now is 5:35 AM. |
Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC