Skip to content

Comment about "View types" #4

@michalfita

Description

@michalfita

I haven't found other way to comment https://smallcultfollowing.com/babysteps//blog/2021/11/05/view-types/, having discussion section here could help.

While the idea is noble in principle, the syntax is horrible! Please don't let it be considered in this form.

Please consider something more verbose, even the keyword to define them, something like:

struct TheType {
    element: Vec<u32>,
    option: Option<i32>,
}

view TheElementView: TheType {
   element,
}

That way then can be kept named and are much easier to read, digest, refactor, less inhibitive on the learning journey.

Maybe next step would be implementations for view types?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions