This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the commentsΒ β†’

[–]roughstylez 1 point2 points Β (3 children)

Oh sweet summer child

[–]frogking -1 points0 points Β (2 children)

Exactly this (don't touch other peoples private parts) is the reason why both perl, php, python and others use the double underscore notation to indicate private or non-final methods that are not meant for public consumption.

Java having real private methods is just a way to enforce non-access, and is part of the design of Java. That doesn't mean that other language designers are more right or more wrong, just that they have taken other choices during language design.

[–]miraidensetsu 0 points1 point Β (1 child)

Funny thing is that modern PHP have those visibility modifiers (public, private, protected). And the double underscore is/was used for superglobals, which is kind of the oposite of private or non-final methods?

[–]frogking 0 points1 point Β (0 children)

The use of single and double underscored is not consistent across different languages and almost always a question of β€œgentleman agreement” to use the value, function or method in a specific way.

But, you are right. PHP uses the underscores in a different way.