Re: Re: PHP vs JAVA

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Aug 22, 2013 at 12:29 AM, Sebastian Krebs <krebs.seb@xxxxxxxxx>wrote:

> Actually I think ".." is quite error-prone, because it is hard to
> distinguish from "." or "_" on the _first_ glance, which makes the get
> quickly through the code. [1]
>

I surround all operators except member access ("." and "->") with spaces,
so that wouldn't be a problem for me. I thought there was an older language
that used "..", but all I can find now is Lua which was developed in the
early nineties.

So "." is maybe not the best choice, but also remember when it was
> introduced: That was decades ago. That time it was (probably ;)) the best
> choice and nowadays I don't think it is too bad at all, beside that _other_
> languages use it for other purposes now ;)
>

C introduced "." as the field access operator for structs in the early
seventies, C++ kept it for object access, and Java adopted it in the early
nineties. C's use of pointers required a way to access members through a
pointer, and I suppose K&R thought "->" looked like following a pointer (I
agree).

Since PHP was modeled on Perl and wouldn't implement objects or structs for
another decade, it adopted "." for string concatenation. It works fine, and
I don't have too much trouble bouncing back-and-forth. I honestly would
have preferred "." to be overloaded when the left hand side was an object.
In the rare cases that you want to convert an object to a string to be
concatenated with the RHS, you can always cast it to string, use strval(),
or call __toString() manually. But I'm not staging any protests over the
use of "->". :)


> Eclipse' code-completion and debugger never worked for me well (and most
> of the time: at all). It became slower and less responsive with every
> release. That was the reason I decided to leave it and I don't regret it :)
>

I agree about the slowness, and until this latest release I've always left
autocompletion manual (ctrl + space). They did something with Kepler to
speed it up drastically, so much so I have it turned on with every
keypress. However, it's a little too aggressive in providing choices.
Typing "null" which is a Java keyword as in PHP, it will insert
"nullValue()" which is a method from Hamcrest. :( After a couple weeks of
this, I think I'll be switching it back to manual activation. I can type
quickly enough that I only need it when I'm not sure of a method name.

NetBeans, while not as good with refactoring and plugin support, is still
zippier than Eclipse. And my short time with the JetBrains products found
them to be fast as well. Eclipse's PHP support via PDT is not nearly as
good as NetBeans, and no doubt PHPStorm beats them both.

Peace,
David

[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux