hosted by liquidweb


Go Back   Web Hosting Talk : Web Hosting Main Forums : Programming Discussion : If I know a little bit of Java, does that make PHP
Reply

Forum Jump

If I know a little bit of Java, does that make PHP

Reply Post New Thread In Programming Discussion Subscription
 
Send news tip View All Posts Thread Tools Search this Thread Display Modes
  #1  
Old 08-05-2004, 11:26 PM
Kit Kit is offline
Web Hosting Guru
 
Join Date: Jul 2002
Posts: 314

If I know a little bit of Java, does that make PHP


easier to learn? Can I learn at least the basics of PHP in 3 weeks with some Java knowledge?



Sponsored Links
  #2  
Old 08-05-2004, 11:31 PM
brendandonhu brendandonhu is offline
Web Hosting Master
 
Join Date: Nov 2003
Posts: 682
I have heard that PHP is somewhat similar to Java. If you already have some knowledge of programmaing concepts, I think you could pick up basic PHP in 3 weeks. Granted, you won't have much experience with debugging it and such, you could learn the basic functions (strings, loops, etc).

  #3  
Old 08-05-2004, 11:37 PM
Kit Kit is offline
Web Hosting Guru
 
Join Date: Jul 2002
Posts: 314
Are strings, loops, etc. in PHP similar to Java? In comparison, isn't PHP easier to learn than Java or no?

Sponsored Links
  #4  
Old 08-05-2004, 11:43 PM
illogix illogix is offline
Web Hosting Master
 
Join Date: May 2001
Location: Montreal, Quebec
Posts: 589
The PHP syntax is very similar to Java and C. However, Java is 100$ object oriented while PHP can do OO and strutural. But overall, PHP is a very easy language to learn.

  #5  
Old 08-06-2004, 12:33 AM
bhanson bhanson is offline
WHT Addict
 
Join Date: Sep 2003
Posts: 131
Java is a programming language and PHP is a scripting language. Java has a much higher learning curve than PHP. Anyone with any previous knowledge of logic, etc., could probably pickup PHP in a few days, it really isn't very tough.

PHP *does* have some OO functions built into it, but it's nowhere near complete and just kind of a bad patch. (Thinking of <=v4 here, havenít read anything about 5 just yet.)

[edit]
If you're thinking of the offline capabilities of it, once again I'll go with the limited functions deal. (Shouldn't take you too long to learn if you can program Java.)

  #6  
Old 08-06-2004, 02:02 AM
brendandonhu brendandonhu is offline
Web Hosting Master
 
Join Date: Nov 2003
Posts: 682
PHP5 added a lot for object oriented coding. I don't know how strings and loops work in Java, so I couldn't answer that question. Head over to http://php.net and check out the manual.

  #7  
Old 08-06-2004, 07:01 AM
Kar-aK Kar-aK is offline
Newbie
 
Join Date: Jul 2004
Posts: 22
Well if you're looking for a quicklist:

- Loop Constructs are identical (including foreach)
- Selection is identical (if / else / switch etc)
- String Handling is similar:

Code:
  //Java Init
    String mystring = "foo";
  // Java Append
     mystring = mystring + "bar";
  // PHP Init
      $mystring = "foo";
   // PHP Append
      $mystring = $mystring . "bar";
The main differences come with the Object Oriented side of things. You're constantly reminded of the fact you're programming in a OO language with Java. In PHP you have to be really careful how you structure your code, but it is very possible to get a OO feel to it (in particularly with PHP5).

Another thing to bear in mind is that PHP is "loosly" typed. For example:

Code:
  $myinteger = 1 + 3;
   echo ($myinteger); // will output 4;

  $mystring = "1" . "3";
  echo ($mystring); // will output 13
So you don't need to use a datatype when initialising a variable in PHP.

Hope that helps.

- Kar

  #8  
Old 08-06-2004, 05:13 PM
webhappy webhappy is offline
Junior Guru Wannabe
 
Join Date: Jul 2002
Posts: 53
Hi Kit,

I have a Java->PHP translator project. Perhaps you might want to try this out. It's at www.NewOOP.com

If you have any questions, please feel free to contact me.

BTW, if you're solid with any programming, you can probably start writing decent PHP code in 3 hours (just get a good IDE, so you can see what the built-in functions do; I recommend Zend's IDE).

Reply

Related posts from TheWhir.com
Title Type Date Posted
Jelastic Integrates Java and PHP Cloud Platform with NetBeans IDE Web Hosting News 2013-05-06 13:34:29
Jelastic Partners with innofield to Launch Beta Service in Switzerland Web Hosting News 2014-05-01 08:22:27
Jelastic Releases Plugin for Java Development Environment IntelliJ IDEA Web Hosting News 2012-12-05 11:15:46
Jelastic Launches Java Cloud Hosting Beta in Finland through Planeetta Internet Partnership Web Hosting News 2012-11-26 12:03:39
Jelastic Java Cloud App Deployment Gets Easier with Eclipse Partnership Web Hosting News 2012-12-17 13:50:32


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes
Postbit Selector

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump
Login:
Log in with your username and password
Username:
Password:



Forgot Password?
Advertisement:
Web Hosting News:



 

X

Welcome to WebHostingTalk.com

Create your username to jump into the discussion!

WebHostingTalk.com is the largest, most influentual web hosting community on the Internet. Join us by filling in the form below.


(4 digit year)

Already a member?