Old 07-07-2008, 11:40   #1 (permalink)
lans2gt
http://www.tsoknat.com
 
lans2gt's Avatar
 
Join Date: May 2007
Location: Philippines
Posts: 21
Send a message via Yahoo to lans2gt Send a message via Skype™ to lans2gt
Javascript or PHP

If you are a newbie programmer and want to take up programming by yourself through a lot of internet tutorials.. what is much easier to study.. Javascript or PHP?


-------------------------
Freelance Web Designer's Blog
  Reply With Quote
Old 07-07-2008, 11:53   #2 (permalink)
Hunch
Grumpy old man
 
Hunch's Avatar
 
Join Date: Oct 2007
Location: North Japan
Posts: 2,407
I'd say PHP, but they both do different things.

What do you want to achieve?
  Reply With Quote
Old 07-07-2008, 12:39   #3 (permalink)
RaelRode
Designers are strange :)
 
RaelRode's Avatar
 
Join Date: Jan 2007
Location: Shrewsbury, UK
Posts: 1,772
Send a message via ICQ to RaelRode Send a message via AIM to RaelRode Send a message via MSN to RaelRode Send a message via Yahoo to RaelRode Send a message via Skype™ to RaelRode
After xHTML and CSS, I went to PHP. Then to Java, then Actionscript...blah blah blah, it depends what floats your boat.
__________________
[ Programmers Voice - Blog about the internet, code and development ]
  Reply With Quote
Old 07-07-2008, 12:52   #4 (permalink)
MikeMackay
Shun the non-believer
 
MikeMackay's Avatar
 
Join Date: Feb 2005
Location: Essex, UK
Posts: 1,788
Send a message via MSN to MikeMackay Send a message via Skype™ to MikeMackay
Quote:
Originally Posted by Hunch
What do you want to achieve?
Absolutely, both can do very different things; one does magic server-side, the other does magic client-side.

Decide what approach and obstacles you want/need to overcome and then learn that one first. You can always move on to the next one afterwards. The syntax between the two isn't all that dissimilar so once you've got the first one under your belt the second one should come easier.
__________________
  Reply With Quote
Old 07-07-2008, 14:01   #5 (permalink)
blackf0rk
Enspiar Productions
 
blackf0rk's Avatar
 
Join Date: Oct 2006
Location: MKE, WI
Posts: 43
It must be understood that Java and JavaScript are two different things.

If you're not familiar to programming, JavaScript is by far much easier to start learning [than PHP is]. Why? You don't have to install an environment for JavaScript...you already have one in your browser. Just type in your script, press refresh, and you're good to go! Now, debugging the JavaScript can be more difficult than debugging PHP because JavaScript doesn't give you line numbers and feedback to your errors. But if you're developing (and you should be) in Fire Fox, you'll notice that the error console (Ctrl+Shift+J) gives you excellent feedback for your JavaScript code; line numbers of the failed code and all!

[Addition: Visual Studio 2008 now gives JavaScript debugging support as well.]

The alternative is to upload your test files every time you make a change to your PHP enabled server; this is time consuming and inefficient. And, you may not have a PHP enabled server to begin with. So then you would have to install the environment on your computer. And if you're not familiar with PHP, you're probably not familiar on how to set it up on your computer to serve it. Not that you can't learn though!

In general PHP is very simple to learn if you've got a good baseline for how to program, and as many have stated thus far, it is very much like JavaScript (syntax wise). JavaScript for me gave me such a great baseline to my programming skill set, so my suggestion is to start with JavaScript!

Last edited by blackf0rk : 07-07-2008 at 16:13.
  Reply With Quote
Old 07-07-2008, 14:31   #6 (permalink)
wheedwacker
competitionmaster 2.0
 
wheedwacker's Avatar
 
Join Date: Oct 2006
Location: USA
Posts: 1,508
Neither are that hard just to get started in. It's all the superadvanced stuff that gets tricky.

I learned PHP first, and then some JavaScript.
__________________
.
  Reply With Quote
Old 07-07-2008, 14:45   #7 (permalink)
hobolooter
Registered User
 
hobolooter's Avatar
 
Join Date: Feb 2004
Location: USA
Posts: 83
Send a message via AIM to hobolooter
Quote:
Originally Posted by blackf0rk
It must be understood that Java and JavaScript are two different things. If you're not familiar to programming, JavaScript is by far much easier to start learning. Why? You don't have to install an environment for JavaScript...you already have one in your browser.

Windows is the only operating system I've used that does not come with the development/runtime environment preinstalled.
  Reply With Quote
Old 07-07-2008, 15:16   #8 (permalink)
blackf0rk
Enspiar Productions
 
blackf0rk's Avatar
 
Join Date: Oct 2006
Location: MKE, WI
Posts: 43
Quote:
Originally Posted by hobolooter
Windows is the only operating system I've used that does not come with the development/runtime environment preinstalled.

Really? My Macbook Pro doesn't have php installed on it.
  Reply With Quote
Old 07-07-2008, 15:51   #9 (permalink)
hobolooter
Registered User
 
hobolooter's Avatar
 
Join Date: Feb 2004
Location: USA
Posts: 83
Send a message via AIM to hobolooter
Quote:
Originally Posted by blackf0rk
Really? My Macbook Pro doesn't have php installed on it.

Do you mean Java or PHP? I'm talking about Java, which I am positive your Macbook Pro has preinstalled, unless you manually removed it.
  Reply With Quote
Old 07-07-2008, 15:56   #10 (permalink)
blackf0rk
Enspiar Productions
 
blackf0rk's Avatar
 
Join Date: Oct 2006
Location: MKE, WI
Posts: 43
Quote:
Originally Posted by hobolooter
Do you mean Java or PHP? I'm talking about Java, which I am positive your Macbook Pro has preinstalled, unless you manually removed it.

I'm talking about JavaScript (not Java) and PHP. The original post was about JavaScript and PHP. Someone else referenced (I believe) JavaScript by stating "Java" and so I wanted to differentiate the two so no one would be confused.
  Reply With Quote
Old 07-07-2008, 16:05   #11 (permalink)
hobolooter
Registered User
 
hobolooter's Avatar
 
Join Date: Feb 2004
Location: USA
Posts: 83
Send a message via AIM to hobolooter
Quote:
Originally Posted by blackf0rk
I'm talking about JavaScript (not Java) and PHP. The original post was about JavaScript and PHP. Someone else referenced (I believe) JavaScript by stating "Java" and so I wanted to differentiate the two so no one would be confused.

Actually you were quoted saying that Javascript was easier to learn than Java because you didn't have to install anything, which if you read my reply contradicts that, because Windows is the only OS that I am aware of that does not come with the Java development/runtime preinstalled.

Learning Java before Javascript would definitely foster better coding practices, not to say one should be learned before the other.
  Reply With Quote
Old 07-07-2008, 16:09   #12 (permalink)
blackf0rk
Enspiar Productions
 
blackf0rk's Avatar
 
Join Date: Oct 2006
Location: MKE, WI
Posts: 43
Quote:
Originally Posted by hobolooter
Actually you were quoted saying that Javascript was easier to learn than Java.

Actually not. I never said that JavaScript was easier to learn than Java, what I said was...

Quote:
Originally Posted by blackf0rk
It must be understood that Java and JavaScript are two different things. If you're not familiar to programming, JavaScript is by far much easier to start learning.

I can see how this first sentence could be confusing to the next. I just assumed we were all talking about JavaScript and PHP. I have edited the original comment as it should be read.
  Reply With Quote
Old 07-07-2008, 19:44   #13 (permalink)
Shiro
Whitey
 
Shiro's Avatar
 
Join Date: Aug 2007
Location: Yokohama, Japan
Posts: 7,323
I actually learned javascript and php pretty much at the same time. I spent some time on one then some time on the other, back and forth.

Although that could explain why I suck at both
__________________
This space for rent.

After Hours Japan
  Reply With Quote
Old 08-07-2008, 05:51   #14 (permalink)
Hunch
Grumpy old man
 
Hunch's Avatar
 
Join Date: Oct 2007
Location: North Japan
Posts: 2,407
Quote:
Originally Posted by haku
Although that could explain why I suck at both

Or you could be thick.
  Reply With Quote
Old 08-07-2008, 07:05   #15 (permalink)
RaelRode
Designers are strange :)
 
RaelRode's Avatar
 
Join Date: Jan 2007
Location: Shrewsbury, UK
Posts: 1,772
Send a message via ICQ to RaelRode Send a message via AIM to RaelRode Send a message via MSN to RaelRode Send a message via Yahoo to RaelRode Send a message via Skype™ to RaelRode
OS X has Apache bundled with it.

Apple > System Preferences > Sharing > Tick Web Sharing

Although I don't use that I use MAMP.
__________________
[ Programmers Voice - Blog about the internet, code and development ]
  Reply With Quote
Old 08-07-2008, 08:50   #16 (permalink)
Hunch
Grumpy old man
 
Hunch's Avatar
 
Join Date: Oct 2007
Location: North Japan
Posts: 2,407
Most of the bundled OS X stuff is pretty ancient.

It's not worth bothering with when MAMP is free. (Although if you're a serious developer I thoroughly recommend spending a few quid on MAMP Pro - it's not that expensive and the control panel is a big time saver).
  Reply With Quote
Old 08-07-2008, 10:12   #17 (permalink)
mx
Global Visionary™
 
mx's Avatar
 
Join Date: Jun 2005
Location: in the boosh
Posts: 1,715
I would go with PHP.

If you code a web form, you MUST validate the data with PHP, where as Javascript validation is merely good practise.

Learn PHP first as it opens more doors with regards to dynamic content. Not that you can get away without Javascript mind
__________________

Last edited by mx : 08-07-2008 at 11:21.
  Reply With Quote
Old 08-07-2008, 10:39   #18 (permalink)
Hunch
Grumpy old man
 
Hunch's Avatar
 
Join Date: Oct 2007
Location: North Japan
Posts: 2,407
Quote:
Originally Posted by mx
If you code a web form, you MUST validate the data with PHP, where as Javascript validation is merely good practise.

Eh?
  Reply With Quote
Old 08-07-2008, 10:48   #19 (permalink)
mx
Global Visionary™
 
mx's Avatar
 
Join Date: Jun 2005
Location: in the boosh
Posts: 1,715
Quote:
Originally Posted by Hunch
Eh?

To avoid SQL injection etc.
__________________
  Reply With Quote
Old 08-07-2008, 11:19   #20 (permalink)
d*d
Moderator
 
d*d's Avatar
 
Join Date: Oct 2004
Location: Bristol
Posts: 5,046
sounds nasty
  Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search


Contact Us - Web Design Forums - Archive
Web Hosting by Heart Internet, vBulletin © 2000-2009 Jelsoft Enterprises Limited.
Search Engine Optimization by vBSEO 3.0.0 RC8
Web Hosting by Heart Internet