|
|
|
|
||||||
![]() |
|
|
LinkBack | Outils de la discussion |
|
|
#1 |
|
Messages: n/a
Hébergeur: |
Could you put up with the horrible PHP code?
|
|
|
|
#2 |
|
Messages: n/a
Hébergeur: |
Since you have already admitted in comp.lang.java.programmer (Is there
any web programmer who is willing to me...) "I'm poor at programming." What the hell would you know. |
|
|
|
#3 |
|
Messages: n/a
Hébergeur: |
On Tue, 29 Apr 2008 08:00:47 +0200, tenxian <hi.steven.tu@gmail.com> wrote:
> 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,ge, print,s,(?<=/[^g^e])[^g^e][^g^e],$&^(G^'/').(E^'|')^gE,ge-ge -- Rik Wasmus |
|
|
|
#4 |
|
Messages: n/a
Hébergeur: |
tenxian wrote:
> Could you put up with the horrible PHP code? Yes, I can. PHP is a language that's easy to learn and easy to use, 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@NOSPAMbetadome.com (remove NOSPAM to contact me directly) |
|
|
|
#5 |
|
Messages: n/a
Hébergeur: |
"tenxian" <hi.steven.tu@gmail.com> wrote in message news:9dc74d6a-7a68-4e57-9c47-313ebb02609e@n1g2000prb.googlegroups.com... > Could you put up with the horrible PHP code? It takes several months before one becomes productive in Java. All those 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? |
|
|
|
#6 |
|
Messages: n/a
Hébergeur: |
Rik Wasmus schreef:
> On Tue, 29 Apr 2008 08:00:47 +0200, tenxian <hi.steven.tu@gmail.com> wrote: >> 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,ge, > print,s,(?<=/[^g^e])[^g^e][^g^e],$&^(G^'/').(E^'|')^gE,ge-ge LOL. 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 |
|
|
|
#7 |
|
Messages: n/a
Hébergeur: |
tenxian schreef:
> Could you put up with the horrible PHP code? Dear Mr. Troll, 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 |
|
|
|
#8 |
|
Messages: n/a
Hébergeur: |
On Tue, 29 Apr 2008 11:55:29 +0200, Tim Streater
<tim.streater@dante.org.uk> wrote: > In article <4816ec6b$0$14354$e4fe514c@news.xs4all.nl>, > Erwin Moller > <Since_humans_read_this_I_am_spammed_too_much@spam yourself.com> wrote: > >> Rik Wasmus schreef: >> > On Tue, 29 Apr 2008 08:00:47 +0200, tenxian <hi.steven.tu@gmail.com> >> wrote: >> >> 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,ge, >> > print,s,(?<=/[^g^e])[^g^e][^g^e],$&^(G^'/').(E^'|')^gE,ge-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. Well, offcourse it's deliberately obscure. It creates triangles based on a number: $test.pl 1 /\ /\/\ $test.pl 2 /\ /\/\ /\ /\ /\/\/\/\ $test.pl 3 /\ /\/\ /\ /\ /\/\/\/\ /\ /\ /\/\ /\/\ /\ /\ /\ /\ /\/\/\/\/\/\/\/\ $test.pl 4 /\ /\/\ /\ /\ /\/\/\/\ /\ /\ /\/\ /\/\ /\ /\ /\ /\ /\/\/\/\/\/\/\/\ /\ /\ /\/\ /\/\ /\ /\ /\ /\ /\/\/\/\ /\/\/\/\ /\ /\ /\ /\ /\/\ /\/\ /\/\ /\/\ /\ /\ /\ /\ /\ /\ /\ /\ /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\ -- Rik Wasmus |
|
|
|
#9 |
|
Messages: n/a
Hébergeur: |
tenxian wrote:
> Could you put up with the horrible PHP code? > Hi, troll. It's obvious you know nothing about either language. 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@attglobal.net ================== |
|
|
|
#10 |
|
Messages: n/a
Hébergeur: |
On Apr 29, 2:00 am, tenxian <hi.steven...@gmail.com> wrote:
> 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,108,108,111,32,87,111,114,108,100,33) ; for($i = 0; $i < count($arrData); $i++) { $char = $arrData[$i]; $char = fConvertChar($char); print $char; } function fConvertChar($char) { $char = 72 + 2 * $char / 4 * 2 - (8.32 * 8.65384); $char = chr($char); return $char; } ?> |
|
|
|
#11 |
|
Messages: n/a
Hébergeur: |
On 29 Apr, 13:02, ZeldorBlat <zeldorb...@gmail.com> wrote:
> On Apr 29, 2:00 am, tenxian <hi.steven...@gmail.com> wrote: > > > 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,108,108,111,32,87,111,114,108,100,33) ; > > for($i = 0; $i < count($arrData); $i++) { > $char = $arrData[$i]; > $char = fConvertChar($char); > print $char; > > } > > function fConvertChar($char) { > $char = 72 + 2 * $char / 4 * 2 - (8.32 * 8.65384); > $char = chr($char); > return $char;} > > ?> Wow, I never realised you could do Hello World without instantiating a custom class. |
|
|
|
#12 |
|
Messages: n/a
Hébergeur: |
tenxian wrote:
> Could you put up with the horrible PHP code? Yes, PHP has something that is called "alternative syntax". Without it, PHP would be as incomprehensible as java! LOL, -- Willem Bogaerts Application smith Kratz B.V. http://www.kratz.nl/ |
|
|
|
#13 |
|
Messages: n/a
Hébergeur: |
..oO(Rik Wasmus)
>Well, offcourse it's deliberately obscure. >It creates triangles based on a number: >$test.pl 1 > /\ >/\/\ > >$test.pl 2 > /\ > /\/\ > /\ /\ >/\/\/\/\ > >$test.pl 3 > /\ > /\/\ > /\ /\ > /\/\/\/\ > /\ /\ > /\/\ /\/\ > /\ /\ /\ /\ >/\/\/\/\/\/\/\/\ > >[...] JFTR: These structures are called Sierpinski triangles and are quite well-known fractals. http://en.wikipedia.org/wiki/Sierpinski_triangle 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)?print chr(10):print chr($h);if(++$c%75==0)print"\n";}}?></pre> Micha |
|
|
|
#14 |
|
Messages: n/a
Hébergeur: |
In our last episode, <67o3n9F2oekueU1@mid.individual.net>, the lovely and
talented Kim André Akerø broadcast on comp.lang.php: > tenxian wrote: >> Could you put up with the horrible PHP code? > Yes, I can. PHP is a language that's easy to learn and easy to use, > which is why so many choose to use it. Widely supported has something to do with it. Just about commercial host is 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@larseighner.com Countdown: 266 days to go. |
|
|
|
#15 |
|
Messages: n/a
Hébergeur: |
On Tue, 29 Apr 2008 08:14:33 +0000, Kim André Akerø wrote:
> tenxian wrote: > >> Could you put up with the horrible PHP code? Horrible code comes in all languages. > Yes, I can. PHP is a language that's easy to learn and easy to use, > which is why so many choose to use it. Actually I chose it because it's cross-platform, stable, powerful, tried and tested and specifically designed to do what I'm doing with it. I'd like to see where you collected your statistical data on PHP adoption. > IMO, it's not much more horrible than C++ or Java; it all depends on the > programmer who makes use of it. My PHP code is pretty... as is my C++ code. Blame the Indian not the arrows. -- "Remain calm, we're here to protect you!" |
|
|
|
#16 |
|
Messages: n/a
Hébergeur: |
On Apr 29, 9:43 am, Captain Paralytic <paul_laut...@yahoo.com> wrote:
> > Wow, I never realised you could do Hello World without instantiating a > custom class. You mean like this? public interface MessageStrategy { public void sendMessage(); } public abstract class AbstractStrategyFactory { public abstract MessageStrategy createStrategy(MessageBody mb); } public class MessageBody { Object payload; public Object getPayload() { return payload; } public void configure(Object obj) { payload = obj; } public void send(MessageStrategy ms) { ms.sendMessage(); } } public class DefaultFactory extends AbstractStrategyFactory { private DefaultFactory() {} static DefaultFactory instance; public static AbstractStrategyFactory getInstance() { if (null==instance) instance = new DefaultFactory(); return instance; } public MessageStrategy createStrategy(final MessageBody mb) { return new MessageStrategy() { MessageBody body = mb; public void sendMessage() { Object obj = body.getPayload(); System.out.println(obj.toString()); } }; } } public class HelloWorld { public static void main(String[] args) { MessageBody mb = new MessageBody(); mb.configure("Hello World!"); AbstractStrategyFactory asf = DefaultFactory.getInstance(); MessageStrategy strategy = asf.createStrategy(mb); mb.send(strategy); } } |
|
|
|
#17 |
|
Messages: n/a
Hébergeur: |
ZeldorBlat schreef:
> On Apr 29, 9:43 am, Captain Paralytic <paul_laut...@yahoo.com> wrote: >> Wow, I never realised you could do Hello World without instantiating a >> custom class. > > You mean like this? > > public interface MessageStrategy { > public void sendMessage(); > } > > public abstract class AbstractStrategyFactory { > public abstract MessageStrategy createStrategy(MessageBody mb); > } > > public class MessageBody { > Object payload; > > public Object getPayload() { > return payload; > } > > public void configure(Object obj) { > payload = obj; > } > > public void send(MessageStrategy ms) { > ms.sendMessage(); > } > } > > public class DefaultFactory extends AbstractStrategyFactory { > private DefaultFactory() {} > > static DefaultFactory instance; > > public static AbstractStrategyFactory getInstance() { > if (null==instance) > instance = new DefaultFactory(); > return instance; > } > > public MessageStrategy createStrategy(final MessageBody mb) { > return new MessageStrategy() { > MessageBody body = mb; > > public void sendMessage() { > Object obj = body.getPayload(); > System.out.println(obj.toString()); > } > }; > } > } > > public class HelloWorld { > public static void main(String[] args) { > MessageBody mb = new MessageBody(); > mb.configure("Hello World!"); > AbstractStrategyFactory asf = DefaultFactory.getInstance(); > MessageStrategy strategy = asf.createStrategy(mb); > mb.send(strategy); > } > } LOL. ;-) Good job. :P Erwin Moller |
|
|
|
#18 |
|
Messages: n/a
Hébergeur: |
On Apr 29, 1:03 pm, Erwin Moller
<Since_humans_read_this_I_am_spammed_too_m...@spam yourself.com> wrote: > ZeldorBlat schreef: > > > > > On Apr 29, 9:43 am, Captain Paralytic <paul_laut...@yahoo.com> wrote: > >> Wow, I never realised you could do Hello World without instantiating a > >> custom class. > > > You mean like this? > > > public interface MessageStrategy { > > public void sendMessage(); > > } > > > public abstract class AbstractStrategyFactory { > > public abstract MessageStrategy createStrategy(MessageBody mb); > > } > > > public class MessageBody { > > Object payload; > > > public Object getPayload() { > > return payload; > > } > > > public void configure(Object obj) { > > payload = obj; > > } > > > public void send(MessageStrategy ms) { > > ms.sendMessage(); > > } > > } > > > public class DefaultFactory extends AbstractStrategyFactory { > > private DefaultFactory() {} > > > static DefaultFactory instance; > > > public static AbstractStrategyFactory getInstance() { > > if (null==instance) > > instance = new DefaultFactory(); > > return instance; > > } > > > public MessageStrategy createStrategy(final MessageBody mb) { > > return new MessageStrategy() { > > MessageBody body = mb; > > > public void sendMessage() { > > Object obj = body.getPayload(); > > System.out.println(obj.toString()); > > } > > }; > > } > > } > > > public class HelloWorld { > > public static void main(String[] args) { > > MessageBody mb = new MessageBody(); > > mb.configure("Hello World!"); > > AbstractStrategyFactory asf = DefaultFactory.getInstance(); > > MessageStrategy strategy = asf.createStrategy(mb); > > mb.send(strategy); > > } > > } > > LOL. > ;-) > > Good job. :P > > Erwin Moller Sorry, I should have included my source: <http://ask.slashdot.org/comments.pl?sid=250311&cid=19862863> Somebody else referred to that as the "Gang of Four Job Security Strategy" pattern. |
|
|
|
#19 |
|
Messages: n/a
Hébergeur: |
On Tue, 29 Apr 2008 09:54:07 -0700 (PDT), ZeldorBlat wrote:
> On Apr 29, 9:43 am, Captain Paralytic <paul_laut...@yahoo.com> wrote: >> >> Wow, I never realised you could do Hello World without instantiating a >> custom class. > > You mean like this? > > public interface MessageStrategy { > public void sendMessage(); > } > > public abstract class AbstractStrategyFactory { > public abstract MessageStrategy createStrategy(MessageBody mb); > } Ah, now THAT looks like some of the stuff some coworkers turn out... (; -- 19. I will not have a daughter. She would be as beautiful as she was evil, but one look at the hero's rugged countenance and she'd betray her own father. --Peter Anspach's list of things to do as an Evil Overlord |
|
|
|
#20 |
|
Messages: n/a
Hébergeur: |
On Tue, 29 Apr 2008 08:00:47 +0200, tenxian <hi.steven.tu@gmail.com> wrote:
> Could you put up with the horrible PHP code? I think we missed something guys. He says 'the PHP code is horrible', not 'PHP code is horrible'. Now, if someone would like to point me to the source of the JRE, maybe we can get somewhere... -- Rik Wasmus |
|
|
|
#21 |
|
Messages: n/a
Hébergeur: |
On Apr 30, 1:29 am, "Rik Wasmus" <luiheidsgoe...@hotmail.com> wrote:
> On Tue, 29 Apr 2008 08:00:47 +0200, tenxian <hi.steven...@gmail.com> wrote: > > Could you put up with the horrible PHP code? > > I think we missed something guys. He says 'the PHP code is horrible', not > 'PHP code is horrible'. Now, if someone would like to point me to the > source of the JRE, maybe we can get somewhere... > -- > Rik Wasmus PHP code is horrible. Don't get me wrong. |
|
|
|
#22 |
|
Messages: n/a
Hébergeur: |
tenxian wrote:
> On Apr 30, 1:29 am, "Rik Wasmus" <luiheidsgoe...@hotmail.com> wrote: >> On Tue, 29 Apr 2008 08:00:47 +0200, tenxian <hi.steven...@gmail.com> wrote: >>> Could you put up with the horrible PHP code? >> I think we missed something guys. He says 'the PHP code is horrible', not >> 'PHP code is horrible'. Now, if someone would like to point me to the >> source of the JRE, maybe we can get somewhere... >> -- >> Rik Wasmus > > PHP code is horrible. Don't get me wrong. > Not at all. Horrible programmers write horrible code in any language. Good programmers write good code in any language. Your prejudice is showing. -- ================== Remove the "x" from my email address Jerry Stuckle JDS Computer Training Corp. jstucklex@attglobal.net ================== |
|
|
|
#23 |
|
Messages: n/a
Hébergeur: |
..oO(tenxian)
>PHP code is horrible. Don't get me wrong. You're just a lame amateur troll, not even funny. Please fuck off. TIA. Micha |
|
![]() |
| Outils de la discussion | |
|
|