Could you put up with the horrible PHP code?
I couldn't understand why PHP is so popular. The PHP code looks sohorrible compared with Java.
Collapse
This topic is closed.
X
X
-
tenxianTags: None -
macca
Re: I couldn't understand why PHP is so popular. The PHP code looksso horrible compared with Java.
Since you have already admitted in comp.lang.java. programmer (Is there
any web programmer who is willing to help me...)
"I'm poor at programming."
What the hell would you know.
-
Rik Wasmus
Re: I couldn't understand why PHP is so popular. The PHP code looks so horrible compared with Java.
On Tue, 29 Apr 2008 08:00:47 +0200, tenxian <hi.steven.tu@g mail.comwrote:No offcourse not, that's why we read this group.Could you put up with the horrible PHP code?
For comparison, here's some Perl:
#!/usr/bin/perl -l
s--@{[(gE^Ge)=~/[^g^e]/g]}[g^e]x((!!+~~g^e^g^e )<<pop).!gE-ge,
s-[^ge^ge]-s,,,,s,@{[(g^';').(e^'?')]},(G^'/').(E^'|')^Ge,g e,
print,s,(?<=/[^g^e])[^g^e][^g^e],$&^(G^'/').(E^'|')^gE,g e-ge
--
Rik Wasmus
Comment
-
=?iso-8859-1?Q?Kim_Andr=E9_Aker=F8?=
Re: I couldn't understand why PHP is so popular. The PHP code looks so horrible compared with Java.
tenxian wrote:
Yes, I can. PHP is a language that's easy to learn and easy to use,Could you put up with the horrible PHP code?
which is why so many choose to use it.
IMO, it's not much more horrible than C++ or Java; it all depends on
the programmer who makes use of it.
--
Kim André Akerø
- kimandre@NOSPAM betadome.com
(remove NOSPAM to contact me directly)
Comment
-
Cosmic programmer
Re: I couldn't understand why PHP is so popular. The PHP code looks so horrible compared with Java.
"tenxian" <hi.steven.tu@g mail.comwrote in message
news:9dc74d6a-7a68-4e57-9c47-313ebb02609e@n1 g2000prb.google groups.com...It takes several months before one becomes productive in Java. All thoseCould you put up with the horrible PHP code?
abstract classes and interfaces are quite confusing. PHP is much simpler but
very powerful.
Btw can you access a field of resultset in Java like this
resultset[var]
where var is a variable and not a literal?
Comment
-
Erwin Moller
Re: I couldn't understand why PHP is so popular. The PHP code looksso horrible compared with Java.
Rik Wasmus schreef:LOL.On Tue, 29 Apr 2008 08:00:47 +0200, tenxian <hi.steven.tu@g mail.comwrote:>>Could you put up with the horrible PHP code?
No offcourse not, that's why we read this group.
>
For comparison, here's some Perl:
#!/usr/bin/perl -l
s--@{[(gE^Ge)=~/[^g^e]/g]}[g^e]x((!!+~~g^e^g^e )<<pop).!gE-ge,
s-[^ge^ge]-s,,,,s,@{[(g^';').(e^'?')]},(G^'/').(E^'|')^Ge,g e,
print,s,(?<=/[^g^e])[^g^e][^g^e],$&^(G^'/').(E^'|')^gE,g e-ge
The old I-hate-PERL-vibes are running up my spine again.
Thanks for reminding me why I code PHP these days. ;-)
Regards,
Erwin Moller
Comment
-
Erwin Moller
Re: I couldn't understand why PHP is so popular. The PHP code looksso horrible compared with Java.
tenxian schreef:Dear Mr. Troll,Could you put up with the horrible PHP code?
I expect you mastered both Java and PHP before spitting your wisdom?
Is that correct?
I coded a few years in both languages, and can only say I need LOADS of
time to get things done in Java (J2EE/tomcat).
My honest estimate is that I code around 3-4 times faster in PHP, and I
produce readable code.
In Java, you needs to have intimate knowledge of all classes interfaces
you use, even to get the most modests tasks done.
Personally, I don't see the advantage of Java above PHP when it comes to
serverside programming.
For me PHP is easier to read, easier to understand, and easier to
maintain. Above that: PHP is less errorprone since you don't need to
know hundreds of classes/interfaces to do basic stuff.
Now I wonder, what made you post this?
Regards,
Erwin Moller
Comment
-
Tim Streater
Re: I couldn't understand why PHP is so popular. The PHP code looks so horrible compared with Java.
In article <4816ec6b$0$143 54$e4fe514c@new s.xs4all.nl>,
Erwin Moller
<Since_humans_r ead_this_I_am_s pammed_too_much @spamyourself.c omwrote:
Does that actually *do* anything? Or is it *really* just line-noise? IRik Wasmus schreef:>On Tue, 29 Apr 2008 08:00:47 +0200, tenxian <hi.steven.tu@g mail.comwrote:No offcourse not, that's why we read this group.Could you put up with the horrible PHP code?
For comparison, here's some Perl:
#!/usr/bin/perl -l
s--@{[(gE^Ge)=~/[^g^e]/g]}[g^e]x((!!+~~g^e^g^e )<<pop).!gE-ge,
s-[^ge^ge]-s,,,,s,@{[(g^';').(e^'?')]},(G^'/').(E^'|')^Ge,g e,
print,s,(?<=/[^g^e])[^g^e][^g^e],$&^(G^'/').(E^'|')^gE,g e-ge
LOL.
The old I-hate-PERL-vibes are running up my spine again.
Thanks for reminding me why I code PHP these days. ;-)
copy pasted it into Terminal and all I got was a perl syntax error.
Comment
-
Rik Wasmus
Re: I couldn't understand why PHP is so popular. The PHP code looks so horrible compared with Java.
On Tue, 29 Apr 2008 11:55:29 +0200, Tim Streater
<tim.streater@d ante.org.ukwrot e:
Well, offcourse it's deliberately obscure.In article <4816ec6b$0$143 54$e4fe514c@new s.xs4all.nl>,
Erwin Moller
<Since_humans_r ead_this_I_am_s pammed_too_much @spamyourself.c omwrote:
>>>Rik Wasmus schreef:>wrote:On Tue, 29 Apr 2008 08:00:47 +0200, tenxian <hi.steven.tu@g mail.com>>>Could you put up with the horrible PHP code?
>
No offcourse not, that's why we read this group.
>
For comparison, here's some Perl:
#!/usr/bin/perl -l
s--@{[(gE^Ge)=~/[^g^e]/g]}[g^e]x((!!+~~g^e^g^e )<<pop).!gE-ge,
s-[^ge^ge]-s,,,,s,@{[(g^';').(e^'?')]},(G^'/').(E^'|')^Ge,g e,
print,s,(?<=/[^g^e])[^g^e][^g^e],$&^(G^'/').(E^'|')^gE,g e-ge
>LOL.
>The old I-hate-PERL-vibes are running up my spine again.
>Thanks for reminding me why I code PHP these days. ;-)
Does that actually *do* anything? Or is it *really* just line-noise? I
copy pasted it into Terminal and all I got was a perl syntax error.
It creates triangles based on a number:
$test.pl 1
/\
/\/\
$test.pl 2
/\
/\/\
/\ /\
/\/\/\/\
$test.pl 3
/\
/\/\
/\ /\
/\/\/\/\
/\ /\
/\/\ /\/\
/\ /\ /\ /\
/\/\/\/\/\/\/\/\
$test.pl 4
/\
/\/\
/\ /\
/\/\/\/\
/\ /\
/\/\ /\/\
/\ /\ /\ /\
/\/\/\/\/\/\/\/\
/\ /\
/\/\ /\/\
/\ /\ /\ /\
/\/\/\/\ /\/\/\/\
/\ /\ /\ /\
/\/\ /\/\ /\/\ /\/\
/\ /\ /\ /\ /\ /\ /\ /\
/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
--
Rik Wasmus
Comment
-
Jerry Stuckle
Re: I couldn't understand why PHP is so popular. The PHP code looksso horrible compared with Java.
tenxian wrote:Hi, troll. It's obvious you know nothing about either language.Could you put up with the horrible PHP code?
>
The language has nothing to do with it. It all depends on the
programmer. If you write horrible code in PHP, that's your problem.
--
=============== ===
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attgl obal.net
=============== ===
Comment
-
ZeldorBlat
Re: I couldn't understand why PHP is so popular. The PHP code looksso horrible compared with Java.
On Apr 29, 2:00 am, tenxian <hi.steven...@g mail.comwrote:I completely agree. I mean, it's ridiculous that you need all thisCould you put up with the horrible PHP code?
code just for a simple "hello world" program:
<?php
$arrData = array(72,101,10 8,108,111,32,87 ,111,114,108,10 0,33) ;
for($i = 0; $i < count($arrData) ; $i++) {
$char = $arrData[$i];
$char = fConvertChar($c har);
print $char;
}
function fConvertChar($c har) {
$char = 72 + 2 * $char / 4 * 2 - (8.32 * 8.65384);
$char = chr($char);
return $char;
}
?>
Comment
-
Captain Paralytic
Re: I couldn't understand why PHP is so popular. The PHP code looksso horrible compared with Java.
On 29 Apr, 13:02, ZeldorBlat <zeldorb...@gma il.comwrote:Wow, I never realised you could do Hello World without instantiating aOn Apr 29, 2:00 am, tenxian <hi.steven...@g mail.comwrote:
>>Could you put up with the horrible PHP code?
I completely agree. I mean, it's ridiculous that you need all this
code just for a simple "hello world" program:
>
<?php
$arrData = array(72,101,10 8,108,111,32,87 ,111,114,108,10 0,33) ;
>
for($i = 0; $i < count($arrData) ; $i++) {
$char = $arrData[$i];
$char = fConvertChar($c har);
print $char;
>
}
>
function fConvertChar($c har) {
$char = 72 + 2 * $char / 4 * 2 - (8.32 * 8.65384);
$char = chr($char);
return $char;}
>
?>
custom class.
Comment
-
Willem Bogaerts
Re: I couldn't understand why PHP is so popular. The PHP code looksso horrible compared with Java.
tenxian wrote:Yes, PHP has something that is called "alternativ e syntax". Without it,Could you put up with the horrible PHP code?
PHP would be as incomprehensibl e as java!
LOL,
--
Willem Bogaerts
Application smith
Kratz B.V.
Comment
-
Michael Fesser
Re: I couldn't understand why PHP is so popular. The PHP code looks so horrible compared with Java.
..oO(Rik Wasmus)
JFTR: These structures are called Sierpinski triangles and are quite>Well, offcourse it's deliberately obscure.
>It creates triangles based on a number:
>$test.pl 1
/\
>/\/\
>
>$test.pl 2
/\
/\/\
/\ /\
>/\/\/\/\
>
>$test.pl 3
/\
/\/\
/\ /\
/\/\/\/\
/\ /\
/\/\ /\/\
/\ /\ /\ /\
>/\/\/\/\/\/\/\/\
>
>[...]
well-known fractals.
Here's something similar in PHP, also quite famous:
<pre><?php $c=0;for($y=1.2 ;$y>-1.3;$y-=0.1){for($x=-2.08;$x<.92;$x+ =.04){$r=
$n=0;for($h=127 ;$r*$r+$n*$n<4& &--$h>32;){$d=$r;$ r=$r*$r-$n*$n+$x;$n=2*$ d*$n+
$y;}($x>0.98)?p rint chr(10):print chr($h);if(++$c %75==0)print"\n ";}}?></pre>
Micha
Comment
-
Lars Eighner
Re: I couldn't understand why PHP is so popular. The PHP code looks so horrible compared with Java.
In our last episode, <67o3n9F2oekueU 1@mid.individua l.net>, the lovely and
talented Kim André Akerø broadcast on comp.lang.php:
tenxian wrote:>Could you put up with the horrible PHP code?Widely supported has something to do with it. Just about commercial host isYes, I can. PHP is a language that's easy to learn and easy to use,
which is why so many choose to use it.
going to have PHP and MySQL.
For web applications, it is sort of like inside-out perl. Lots of
processing and little markup output: perl or C(++). Lots of markup, a
little processing: PHP. Giant dedicated serverzilla for major landmark
site: Java.
IMO, it's not much more horrible than C++ or Java; it all depends on
the programmer who makes use of it.
--
Lars Eighner <http://larseighner.com/usenet@larseigh ner.com
Countdown: 266 days to go.
Comment
Comment