Thoughts on peeling and readability
Palo Marton
palo.marton at gmail.com
Fri Dec 11 08:21:23 UTC 2015
ad 1), 2) - Current syntax is totally provisional and not important in the
current phase of valhalla project. There are other more important things
that have have to be solved first, syntax is left for later.
On Thu, Dec 10, 2015 at 11:33 PM, Paul Benedict <pbenedict at apache.org>
wrote:
> I truly like the peeling concept. Kudos Brian, Maurizio, et al.
>
> My only difficulty is reading the source code that contains the peeling.
> When I read it, I become concerned that mixing value-based blocks and an
> object-based blocks diminishes comprehension. In a way, I feel transported
> into C with preprocessor directives. :-) I wish there was cleaner
> separation.
>
> Three points:
>
> 1) In particular, I find reading most harmed when __WhereRef or ___WhereVal
> is within a function. I don't like these blocks at all.
>
> 2) Declared at the method level, reading is easy -- because a method is
> complete and distinct. This may be, in fact, the happy medium and the most
> preferred way of coding it.
>
> 3) At the other extreme, have you explored allowing developers to write
> semi-subclasses? Sorry for the poor term, but I don't know what else to
> call it. Some of the Collection changes are incredibly big, and almost seem
> like half-and-half code. I am concerned that when the division becomes so
> enormous yet equal, maintainability will be difficult. Perhaps something
> like this can be explored:
>
> public abstract class AbstractCollection<any E> implements Collection<E> {
> // shared
> }
>
> // in same compilation unit
> __WhereRef(E) AbstractCollection {
> public String toString() { ... }
> }
>
> // in same compilation unit
> __WhereVal(E) AbstractCollection {
> public String toString() { ... }
> }
>
> Cheers,
> Paul
>
More information about the valhalla-dev
mailing list