Re: [PHP] Re: PHP vs JAVA
On Thu, Aug 22, 2013 at 12:29 AM, Sebastian Krebs 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
Re: [PHP] Re: PHP vs JAVA
2013/8/22 David Harkness > On Wed, Aug 21, 2013 at 7:56 PM, Curtis Maurand 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. > 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] 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 ;) [1] Yes, I know, that "_" is not an operator, but mixed with strings and variables names it is there ;) > > >> > 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. > 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 :) > > Peace, > David > > -- github.com/KingCrunch
Re: [PHP] Re: PHP vs JAVA
On Wed, Aug 21, 2013 at 7:56 PM, Curtis Maurand 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
Re: [PHP] Re: PHP vs JAVA
Sebastian Krebs wrote: > 2013/8/21 Curtis Maurand > >> >> >> >> Sorry in advance for the top post. >> >> Use the right tool for >> the Job. I've use Java, C# and PHP. >> >> 1. I hate the >> Perl-like object calls in PHP. I'd rather use "." notation >> in C# and Java. It saves a lot of wear and tear on my left pinky >> finger. >> > > 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# > > >> 2. Java and C# are both typed languages. Say what >> you want, but I have working with a string like "02" and have >> PHP convert that to an integer. sometimes I want that zero in >> front. If I want that to be an integer in Java it's "int >> myInteger = Integer.parseInt("02");" >> >> 3. >> Java development environments (Eclipses, NetBeans, IBM RAD) are pretty >> horrible. Visual Studio is hands down a better envrionment, even the >> older versions of it. I've hooked Visual Studio into SVN in the past and >> it works well. >> > > 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. > > >> >> 4 PHP development environments are many and >> varied and all of them suck at web debugging. I've used PHPEdit, >> Zend, Bluefish, Eclipse and a couple others. Bluefish works better >> on Linux than it does on Windows. >> > > I use PhpStorm and it works quite fine. > > >> >> Use the tool for the job at >> hand. >> >> Just my $0.02 worth. >> >> cheers, >> Curtis >> >> Tim Streater wrote: >> > On 20 Aug 2013 at 23:59, >> PHP List wrote: >> > >> >> >> While I don't have any references to back it up - my guess would be >> >> that >> >> Java may be seen as more versatile in >> general programming terms. A >> >> staggering number of >> enterprise level web applications are built with >> >> Java, add >> to that the possibility of writing Android apps with the same >> >> knowledge. >> > >> > To me the salient point is, >> does java has as extensive a library or set of >> > interfaces to >> other packages (such as SQLite, mysql, etc)? >> > >> >> I >> would say that, in general, the other teacher is incorrect speaking >> >> strictly in terms of web development. PHP has already won that >> crown >> >> many times over. That said, when I was in University, >> it was difficult >> >> to find a programming class that taught >> anything but Java - and that >> >> was >> >> 10yrs ago >> now. I chalked it up to the education bubble not being able >> >> >> to see what the rest of the world is actually doing. >> > >> > >> Was PHP OOP-capable at the time? Perhaps the edu-bubble was simply >> looking >> > down its nose at PHP. There being lots of courses proves >> nothing in and of >> > itself. 20 years ago, there were lots of PC >> mags you could buy, which >> > caused some folks to say "look >> how much better the PC is supported than >> > other platforms". >> Truth was, at the time, such support was needed given >> > the mess >> of 640k limits, DOS, IRQs and the like, most of which issues have >> > ceased to be relevant. >> > >> > Anyway, why should one >> need a course to learn PHP, assuming you already >> > know other >> languages. It's simple enough. >> > >> > -- >> > Cheers >> -- Tim >> > >> > -- >> > PHP General Mailing List >> (http://www.php.net/) >> > To unsubscribe, visit: >> http://www.php.net/unsub.php >> > > > > -- > github.com/KingCrunch >
Re: [PHP] Re: PHP vs JAVA
2013/8/21 Curtis Maurand > > > > Sorry in advance for the top post. > > Use the right tool for > the Job. I've use Java, C# and PHP. > > 1. I hate the > Perl-like object calls in PHP. I'd rather use "." notation > in C# and Java. It saves a lot of wear and tear on my left pinky > finger. > 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. > 2. Java and C# are both typed languages. Say what > you want, but I have working with a string like "02" and have > PHP convert that to an integer. sometimes I want that zero in > front. If I want that to be an integer in Java it's "int > myInteger = Integer.parseInt("02");" > > 3. > Java development environments (Eclipses, NetBeans, IBM RAD) are pretty > horrible. Visual Studio is hands down a better envrionment, even the > older versions of it. I've hooked Visual Studio into SVN in the past and > it works well. > Ever tried the jetbrains products? :D (No, they don't pay me) > > 4 PHP development environments are many and > varied and all of them suck at web debugging. I've used PHPEdit, > Zend, Bluefish, Eclipse and a couple others. Bluefish works better > on Linux than it does on Windows. > I use PhpStorm and it works quite fine. > > Use the tool for the job at > hand. > > Just my $0.02 worth. > > cheers, > Curtis > > Tim Streater wrote: > > On 20 Aug 2013 at 23:59, > PHP List wrote: > > > >> > While I don't have any references to back it up - my guess would be > >> that > >> Java may be seen as more versatile in > general programming terms. A > >> staggering number of > enterprise level web applications are built with > >> Java, add > to that the possibility of writing Android apps with the same > >> knowledge. > > > > To me the salient point is, > does java has as extensive a library or set of > > interfaces to > other packages (such as SQLite, mysql, etc)? > > > >> I > would say that, in general, the other teacher is incorrect speaking > >> strictly in terms of web development. PHP has already won that > crown > >> many times over. That said, when I was in University, > it was difficult > >> to find a programming class that taught > anything but Java - and that > >> was > >> 10yrs ago > now. I chalked it up to the education bubble not being able > >> > to see what the rest of the world is actually doing. > > > > > Was PHP OOP-capable at the time? Perhaps the edu-bubble was simply > looking > > down its nose at PHP. There being lots of courses proves > nothing in and of > > itself. 20 years ago, there were lots of PC > mags you could buy, which > > caused some folks to say "look > how much better the PC is supported than > > other platforms". > Truth was, at the time, such support was needed given > > the mess > of 640k limits, DOS, IRQs and the like, most of which issues have > > ceased to be relevant. > > > > Anyway, why should one > need a course to learn PHP, assuming you already > > know other > languages. It's simple enough. > > > > -- > > Cheers > -- Tim > > > > -- > > PHP General Mailing List > (http://www.php.net/) > > To unsubscribe, visit: > http://www.php.net/unsub.php > -- github.com/KingCrunch
Re: [PHP] Re: PHP vs JAVA
Sorry in advance for the top post. Use the right tool for the Job. I've use Java, C# and PHP. 1. I hate the Perl-like object calls in PHP. I'd rather use "." notation in C# and Java. It saves a lot of wear and tear on my left pinky finger. 2. Java and C# are both typed languages. Say what you want, but I have working with a string like "02" and have PHP convert that to an integer. sometimes I want that zero in front. If I want that to be an integer in Java it's "int myInteger = Integer.parseInt("02");" 3. Java development environments (Eclipses, NetBeans, IBM RAD) are pretty horrible. Visual Studio is hands down a better envrionment, even the older versions of it. I've hooked Visual Studio into SVN in the past and it works well. 4 PHP development environments are many and varied and all of them suck at web debugging. I've used PHPEdit, Zend, Bluefish, Eclipse and a couple others. Bluefish works better on Linux than it does on Windows. Use the tool for the job at hand. Just my $0.02 worth. cheers, Curtis Tim Streater wrote: > On 20 Aug 2013 at 23:59, PHP List wrote: > >> While I don't have any references to back it up - my guess would be >> that >> Java may be seen as more versatile in general programming terms. A >> staggering number of enterprise level web applications are built with >> Java, add to that the possibility of writing Android apps with the same >> knowledge. > > To me the salient point is, does java has as extensive a library or set of > interfaces to other packages (such as SQLite, mysql, etc)? > >> I would say that, in general, the other teacher is incorrect speaking >> strictly in terms of web development. PHP has already won that crown >> many times over. That said, when I was in University, it was difficult >> to find a programming class that taught anything but Java - and that >> was >> 10yrs ago now. I chalked it up to the education bubble not being able >> to see what the rest of the world is actually doing. > > Was PHP OOP-capable at the time? Perhaps the edu-bubble was simply looking > down its nose at PHP. There being lots of courses proves nothing in and of > itself. 20 years ago, there were lots of PC mags you could buy, which > caused some folks to say "look how much better the PC is supported than > other platforms". Truth was, at the time, such support was needed given > the mess of 640k limits, DOS, IRQs and the like, most of which issues have > ceased to be relevant. > > Anyway, why should one need a course to learn PHP, assuming you already > know other languages. It's simple enough. > > -- > Cheers -- Tim > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: PHP vs JAVA
On 21 Aug 2013, at 15:01, "georg chambert" wrote: > my I shake the subject a little; Ive been doing some PHP and found it "ok" to > work with > not so much fuss, but that was PHP4, what about PHP5 ? > Dont really checked the difference but made a short-scan and found that it > had be > screwed around with ? > > Any think, should I change to 5 ? Yes, even if it's only because PHP4 hasn't been supported in any way, including security fixes, since August 7th, 2008! This fact alone makes it pretty dangerous to be using it on a public site, and that's without getting into all of the improvements that PHP5 has introduced over the past five years! -Stuart -- Stuart Dallas 3ft9 Ltd http://3ft9.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: PHP vs JAVA
2013/8/21 georg chambert > Hi, > > my I shake the subject a little; Ive been doing some PHP and found it "ok" > to work with > not so much fuss, but that was PHP4, what about PHP5 ? > Dont really checked the difference but made a short-scan and found that it > had be > screwed around with ? > > Any think, should I change to 5 ? > ehm ... serious? http://php.net/eol.php > > BR georg > > - Original Message - From: "Tim Streater" > To: "PHP List" ; > Sent: Wednesday, August 21, 2013 1:59 PM > Subject: [PHP] Re: PHP vs JAVA > > > > On 20 Aug 2013 at 23:59, PHP List wrote: > > While I don't have any references to back it up - my guess would be that >> Java may be seen as more versatile in general programming terms. A >> staggering number of enterprise level web applications are built with >> Java, add to that the possibility of writing Android apps with the same >> knowledge. >> > > To me the salient point is, does java has as extensive a library or set of > interfaces to other packages (such as SQLite, mysql, etc)? > > I would say that, in general, the other teacher is incorrect speaking >> strictly in terms of web development. PHP has already won that crown >> many times over. That said, when I was in University, it was difficult >> to find a programming class that taught anything but Java - and that was >> 10yrs ago now. I chalked it up to the education bubble not being able >> to see what the rest of the world is actually doing. >> > > Was PHP OOP-capable at the time? Perhaps the edu-bubble was simply looking > down its nose at PHP. There being lots of courses proves nothing in and of > itself. 20 years ago, there were lots of PC mags you could buy, which > caused some folks to say "look how much better the PC is supported than > other platforms". Truth was, at the time, such support was needed given the > mess of 640k limits, DOS, IRQs and the like, most of which issues have > ceased to be relevant. > > Anyway, why should one need a course to learn PHP, assuming you already > know other languages. It's simple enough. > > -- > Cheers -- Tim > > > > > --**--** > > > > > -- >> PHP General Mailing List (http://www.php.net/) >> To unsubscribe, visit: http://www.php.net/unsub.php >> > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- github.com/KingCrunch
Re: [PHP] Re: PHP vs JAVA
Hi, my I shake the subject a little; Ive been doing some PHP and found it "ok" to work with not so much fuss, but that was PHP4, what about PHP5 ? Dont really checked the difference but made a short-scan and found that it had be screwed around with ? Any think, should I change to 5 ? BR georg - Original Message - From: "Tim Streater" To: "PHP List" ; Sent: Wednesday, August 21, 2013 1:59 PM Subject: [PHP] Re: PHP vs JAVA On 20 Aug 2013 at 23:59, PHP List wrote: While I don't have any references to back it up - my guess would be that Java may be seen as more versatile in general programming terms. A staggering number of enterprise level web applications are built with Java, add to that the possibility of writing Android apps with the same knowledge. To me the salient point is, does java has as extensive a library or set of interfaces to other packages (such as SQLite, mysql, etc)? I would say that, in general, the other teacher is incorrect speaking strictly in terms of web development. PHP has already won that crown many times over. That said, when I was in University, it was difficult to find a programming class that taught anything but Java - and that was 10yrs ago now. I chalked it up to the education bubble not being able to see what the rest of the world is actually doing. Was PHP OOP-capable at the time? Perhaps the edu-bubble was simply looking down its nose at PHP. There being lots of courses proves nothing in and of itself. 20 years ago, there were lots of PC mags you could buy, which caused some folks to say "look how much better the PC is supported than other platforms". Truth was, at the time, such support was needed given the mess of 640k limits, DOS, IRQs and the like, most of which issues have ceased to be relevant. Anyway, why should one need a course to learn PHP, assuming you already know other languages. It's simple enough. -- Cheers -- Tim -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: PHP vs Java reliability
Geoff Caplan wrote: >Michael > >>>the "Why PHP" on zend.com is a great place to go for this sort of >>> >stuff... > >>Honestly, it doesn't seem all that professional a resource paper... >> > >I would tend to agree - not something you could show to a hard-headed >corporate purchasing committee with any confidence. > >>I believe Java *can* be pretty stable and robust, but at a cost which >>far exceeds PHP's. This is something that seemed to be missing from >>that article - a cost/benefit analysis compared to other platforms . >> > >>Yeah, Java/ASP/etc can have enormous benefits over PHP in >>some situations, but the price tag is often beyond what people initially >>imagine. >> > >I suspect that this is the vital point - for the right type of project PHP >will be quicker to develop and cheaper to deploy. I think the Zend case >would be more credible if they defined the niche for PHP more clearly - >which is surely the small to mid-sized project. > >My own project is aimed at making fully customised e-commerce affordable for >the smaller organisation, and this seems an ideal field for PHP. > >For end-to-end enterprise computing, PHP would need better namespaces, a >proper object model, more rigorous error handling, a thriving market in >high-quality components (and/or a robust interface to Java) and a fully >featured IDE. Zend 2 should lay the foundations for this, but by then Java >will be so far ahead that PHP may never catch up. But does this matter? The >great majority of organisations and projects are small, and for them PHP is >ideal. If I were Zend, I would be focusing on products and pricing that >appeals to this market, but they rather give the impression that they are >aiming for the enterprise... > >Geoff Caplan > > I aggree. It comes down to what you are doing. But I dont think java is needed unless you are doing one damn big e-com site. Php can handle a fair bit. And to use java costs you a hell of a lot more. First thing to work out is if you need to use java. To many places jump in, thinking yeah we need a $50,000 server and $100,000 worth of dev software, when they would of done fine with a $10,000 server and $0 software. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Re: PHP vs Java reliability
Michael > > the "Why PHP" on zend.com is a great place to go for this sort of stuff... > > > Honestly, it doesn't seem all that professional a resource paper... I would tend to agree - not something you could show to a hard-headed corporate purchasing committee with any confidence. > > I believe Java *can* be pretty stable and robust, but at a cost which > far exceeds PHP's. This is something that seemed to be missing from > that article - a cost/benefit analysis compared to other platforms . >Yeah, Java/ASP/etc can have enormous benefits over PHP in > some situations, but the price tag is often beyond what people initially > imagine. > I suspect that this is the vital point - for the right type of project PHP will be quicker to develop and cheaper to deploy. I think the Zend case would be more credible if they defined the niche for PHP more clearly - which is surely the small to mid-sized project. My own project is aimed at making fully customised e-commerce affordable for the smaller organisation, and this seems an ideal field for PHP. For end-to-end enterprise computing, PHP would need better namespaces, a proper object model, more rigorous error handling, a thriving market in high-quality components (and/or a robust interface to Java) and a fully featured IDE. Zend 2 should lay the foundations for this, but by then Java will be so far ahead that PHP may never catch up. But does this matter? The great majority of organisations and projects are small, and for them PHP is ideal. If I were Zend, I would be focusing on products and pricing that appeals to this market, but they rather give the impression that they are aiming for the enterprise... Geoff Caplan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]