Article View: comp.os.vms
Article #104Re: PHP "Features"
From: Dan Cross
Date: Tue, 27 Oct 2026 01:21
Date: Tue, 27 Oct 2026 01:21
102 lines
3347 bytes
3347 bytes
In article <11bjm3a$i12$1@reader2.panix.com>,
Dan Cross <cross@spitfire.i.gajendra.net> wrote:
>In article <11bjlgb$37fah$1@dont-email.me>,
>Arne Vajhøj <arne@vajhoej.dk> wrote:
>>On 10/24/2026 9:14 PM, Dan Cross wrote:
>>> In article <11bjjen$36tte$1@dont-email.me>,
>>> Arne Vajhøj <arne@vajhoej.dk> wrote:
>>>> On 10/24/2026 1:22 PM, Dan Cross wrote:
>>>>> I assume you've seen this? I think I may have posted it a
>>>>> couple of days ago.
>>>>>
>>>>> https://eev.ee/blog/2012/04/09/php-a-fractal-of-bad-design/
>>>> You have posted it before.
>>>>
>>>> I am not sure whether to laugh or cry.
>>>>
>>>> Stuff like:
>>>>
>>>> <quote>
>>>> Subclasses cannot override private methods. Subclass overrides of public
>>>> methods can’t even see, let alone call, the superclass’s private
>>>> methods. Problematic for, say, test mocks.
>>>> </quote>
>>>
>>> This point was listed as a weakness in the critique. It begs
>>> the question, however, what does that sentence mean to you?
>>
>>It tells that the author is pretty clueless about OOP.
>
>Are you sure? Is there a single, universal, definition of the
>semantics of `private` in Object-Oriented languages? (Hint:
>have you ever used Ruby? Smalltalk?)
>
>Can you think of another explanation they may be driving at?
>For instance, mabye they are questioning why a dynamic language
>like PHP has a definition of `private` that is as rigid as
>C++'s, while not also providing a `friend`-like abstraction.
Since Arne didn't answer, I'll answer for him: `private` does
not mean the same thing in every language. The following
examples are in Ruby:
```
term% ruby
class A
def foo
bar
end
private
def bar
puts "Hello from A's bar"
end
end
class B < A
def baz
bar
end
end
b = B.new
b.foo
b.baz
Hello from A's bar
Hello from A's bar
term% ruby
class A
def foo
bar
end
private
def bar
puts "Hello from A's bar"
end
end
class B < A
private
def bar
puts "Hello from B's bar"
end
end
a = A.new
a.foo
b = B.new
b.foo
Hello from A's bar
Hello from B's bar
term%
```
In *this* language, `private` doesn't mean what it means in C++.
The author of, "PHP: A Fractal of Bad Design" is not clueless
about OOP, but does draw on a wider breadth of knowledge of the
subject than some of the essay's critics.
- Dan C.
Technical Details
Message-ID:
<11bouab$2dh$1@reader2.panix.com>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!panix!.POSTED.spitfire.i.gajendra.net!not-for-mailReferences:
<11bcbi1$k068$1@dont-email.me> <11bjl55$shh$1@reader2.panix.com> <11bjlgb$37fah$1@dont-email.me> <11bjm3a$i12$1@reader2.panix.com>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!panix!.POSTED.spitfire.i.gajendra.net!not-for-mail From: cross@spitfire.i.gajendra.net (Dan Cross) Newsgroups: comp.os.vms Subject: Re: PHP "Features" Date: Tue, 27 Oct 2026 01:21:15 -0000 (UTC) Organization: PANIX Public Access Internet and UNIX, NYC Message-ID: <11bouab$2dh$1@reader2.panix.com> References: <11bcbi1$k068$1@dont-email.me> <11bjl55$shh$1@reader2.panix.com> <11bjlgb$37fah$1@dont-email.me> <11bjm3a$i12$1@reader2.panix.com> Injection-Date: Tue, 27 Oct 2026 01:21:15 -0000 (UTC) Injection-Info: reader2.panix.com; posting-host="spitfire.i.gajendra.net:166.84.136.80"; logging-data="2481"; mail-complaints-to="abuse@panix.com" X-Newsreader: trn 4.0-test77 (Sep 1, 2010) Originator: cross@spitfire.i.gajendra.net (Dan Cross)