Re: Confused about scope

"[email protected]" <[email protected]> Sat, 28 Sep 2024 01:28:29 +0200
Newsgroups gmane.comp.lang.groovy.user
Message-ID <[email protected]>
Blake,

> On 27. 9. 2024, at 21:04, Blake McBride <[email protected]> wrote:
> It is my opinion that having private and package-level scoping is critical.  Controlling scope is critical to managing a large project.

In my personal experience, not quite. I have worked as both part and leader of a team on a couple of big Objective C projects, the largest almost a million source lines. In Java (or even Groovy) that would be considerably more, for Java induces lots of (and Groovy some) boilerplate, especially when advanced OO-techniques like proxying and message redirection are concerned.

Objective C has essentially no scoping at the OO level: if an object responds to a message, it does not care about the sender at all. Any class can be subclassed in any module; any method can be always overridden.

It does lead to some very minor inconvenience, like e.g., naming „private” methods (which aren't private at all) with local prefixes; on the other hand, this very considerably improves code readability and maintainability. And we never ever had any problem caused by (the lack of) scoping, not once.

All the best,
OC