Re: Re: PHP vs JAVA
| From: | David Harkness | Date: | Thu, 22 Aug 2013 03:28:06 +0000 |
| Subject: | Re: Re: PHP vs JAVA | ||
| References: | 1 2 3 4 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-321944@lists.php.net to get a copy of this message | ||
On Wed, Aug 21, 2013 at 7:56 PM, Curtis Maurand <curtis@maurand.com> wrote:
> Sebastian Krebs wrote:
> Actually the problem is, that the dot "." is already in use. With
> $foo.bar() you cannot tell, if you want to call the method "bar()" on the
> > object "$foo", or if you want to concatenate the value of "$foo" to
> > the
> > result of the function "bar()". There is no other way around this than a
> > different operator for method calls.
>
> I didn't think
> of that. It seems to me there could be an easier operator than ->
> which sometimes will make me stop and look at what keys I'm trying to
> hit. Just a thought. I forgot about the concatenation operator
> which is "+" in Java/C#
>
The PHP language developers were pretty stuck. Because of automatic
string-to-numeric-conversion, they couldn't use + for string concatenation.
Sadly, they chose "." rather than ".." which I believe one or two other
languages use. If they had, "." would have been available once objects
rolled around in PHP 4/5. I suspect they chose -> since that's used in C
and C++ to dereference a pointer.
> > Ever tried the jetbrains products? :D (No, they don't pay me)
>
> I have not, but it looks interesting.
> I'll have to try it.
Those are very good products which have had a strong following for a
decade. The free IDE NetBeans also has quite good support for both Java and
PHP, and the latest beta version provides a "web" project that provides
front- and back-end debugging of PHP + JavaScript. You can be stepping
through JS code and hit an AJAX call and then seamlessly step through the
PHP code that handles it.
I use NetBeans for PHP/HTML/JS (though I am evaluating JetBrains' PHPStorm
now) and Eclipse for Java. You can't beat Eclipse's refactoring support in
a free tool, though I think NetBeans is close to catching up. I would bet
IntelliJ IDEA for Java by JetBrains is on par at least.
Peace,
David