Reply to Re: PHP6 - Comments?

Your name:

Reply:


Posted by Oliver Grδtz on 08/24/05 05:20

NC schrieb:

> Fortunately, we are not there yet. OOP can still be avoided
> if necessary. Reading a remote file still can be done in a
> single file_get_contents(),

OOP always seems to be "the bad guy". Sure, I like file_get_contents(),
especially if it's "file_get_contents('http://www.google.com');", but
what is so bad with

$myfile=new File('my-article.txt');
foreach($myfile as $line)
{
// do stuff
}

> as opposed to spawning a
> HttpWebRequest/WebResponse pair in VB.NET. Most importantly,
> string is still not an object.

What is so bad about

$s=new String('this is a test');
echo $s->reverse();

against

$s='this is a test';
echo strrev($s);

It's absolutely the same. But the String class could tell you about it's
capabilities:

print_r(get_class_methods('String'));

The only thing bad about strings being objects is having to write more
code. In Ruby this isn't true, since strings are first class objects and
you can actually call methods on the strings:

print "this is a test".reverse

Even numbers are objects and they've got handy methods:

5.times print "Hello."

Objects are good. Period.


AllOLLi

[Back to original message]


УдалСнная Ρ€Π°Π±ΠΎΡ‚Π° для программистов  •  Как Π·Π°Ρ€Π°Π±ΠΎΡ‚Π°Ρ‚ΡŒ Π½Π° Google AdSense  •  England, UK  •  ΡΡ‚Π°Ρ‚ΡŒΠΈ Π½Π° английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Π‘Π°ΠΉΡ‚ ΠΈΠ·Π³ΠΎΡ‚ΠΎΠ²Π»Π΅Π½ Π² Π‘Ρ‚ΡƒΠ΄ΠΈΠΈ Π’Π°Π»Π΅Π½Ρ‚ΠΈΠ½Π° ΠŸΠ΅Ρ‚Ρ€ΡƒΡ‡Π΅ΠΊΠ°
ΠΈΠ·Π³ΠΎΡ‚ΠΎΠ²Π»Π΅Π½ΠΈΠ΅ ΠΈ ΠΏΠΎΠ΄Π΄Π΅Ρ€ΠΆΠΊΠ° Π²Π΅Π±-сайтов, Ρ€Π°Π·Ρ€Π°Π±ΠΎΡ‚ΠΊΠ° ΠΏΡ€ΠΎΠ³Ρ€Π°ΠΌΠΌΠ½ΠΎΠ³ΠΎ обСспСчСния, поисковая оптимизация