-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rationale Feedback #3
Comments
Is it too late to change the name?
We already have some (thankfully limited) confusion between core and CORE. To now add Cor to the mix isn't going to help. Try explaining to someone new to Perl that Cor is in core but not in CORE and they are most likely to run screaming back to python. |
@openstrike This has complicated some video calls I've had with Sawyer and Stevan, so I know where you're coming from. When that happens, we just refer to it by its full name: Corinna. |
Indeed, "Corinna" would be much less ambiguous. Thanks. |
The Goals section doesn't match what is stated on the home page. |
My apologies for not chiming in sooner, but I've been surprisingly busier than when I had to commute for a living. This comment will deal with this code: has $cache :handles(get) :builder;
method _build_cache () { Hash::Ordered->new }
More to follow as I read. |
To me, this says "the
If that's a parsing nightmare, then maybe
|
In the above, we have a new :reader attribute which says "create a read-only method name created to read this value. But if you want a different method name, that's fine: :reader(get_created). See? In #3 (comment), I guessed readers were defined as |
You don't see it in the above code, but you automatically get a $self variable in a method if you declare it with Every OO language I know has some kind of explicit 'self' expression. I wonder how many people are going to blanche at not being able to tell their slots from other variables at first glance without a class Customer {
has $s_name :isa(Str) :new :reader(name) :writer(name);
has $s_birthdate :isa(DateTime) :new :reader(birthdate) :writer(birthdate);
} where |
Why call it version |
@duncand Version switched to v0.1.0. That's just me being silly. Thanks for catching that. |
The assertion that Cor is better than Moo/se is missing supporting arguments beyond performance/core-ness (i.e. non-syntax issues). IMHO, the short class definition (I mean the Constructor attributes ) is not going to win any converts to Perl because it is too dense. If we as readers didn't need white space, there would be no My suggestion for post-lockdown is to temp some Javascript developers with coffee and pastry to do some A/B/C testing. They won't freak out over $variables, they haven't used Moo/se before and people will agree to anything when pumped up on caffeine and sugar. Show them a simple class with a view attributes, a couple of clear methods and a frobobnicate method written up in bless, Moose and Corinna style as you've done in the Rationale. Ask them what the frobobnicate method does just to get them to engage with the class and then get them to rank the styles in order of clarity. Print the classes out on separate pieces of paper so they can be viewed side by side and shuffled around or scribbled on. Both bless and frobobnicate are distractors. You're trying to warm up your subjects so they relax and can give you their gut instinct on the syntax. You don't want them to overthink the differences between Moose and Corinna or you'll get bad data. My guess is that Moose will rank highest for clarity, but what if the sweet spot is somewhere between? Well then, time for A/B/C/D/E testing which is starting to resemble the Card sorting method of elicitation. Take a single feature from one syntax and drop it in the other so that you can identify the best combination of features. All of this side steps the issue of how easy it is to maintain, but with data, you stand a better chance of convincing p5p. |
One thing that's super-important when asking opinions on syntax is to use examples that are as realistic as possible, the kinds of classes that would be commonly written in real work intended for a real production system. So none of that "Point" class stuff having artificially short member names and no practical use. It would need to have member names with realistically descriptive lengths and quantities and variety. |
@duffee wrote:
Then add whitespace. class Cache::LRU {
use Hash::Ordered;
has $cache
:handles(get)
= Hash::Ordered->new;
has $max_size
:new
:reader
= 20;
has $created
:reader
= time;
method set ( $key, $value ) {
if ( $cache->exists($key) ) {
$cache->delete($key);
}
elsif ( $cache->keys > $max_size ) {
$cache->shift;
}
$cache->set( $key, $value ); # new values in front
}
} Seriously, I'm unsure if I'm missing the point or not. If Or an example similar to what I use in talks: has volume => (
is => 'ro',
init_arg => undef,
builder => '_build_volume',
);
sub _build_volume($self) {
return $self->height * $self->width * $self->depth;
} Why is the above preferable to Or you can do: has $volume
:reader
= $height * $width * $depth; I'm not trying to be difficult. I genuinely don't understand the issue here (also, post-lockdown is likely a year or more away). |
Right on Ovid, I find your Corinna version nicer than the Moo* ones. |
I prefer Moo(se) because the key/value pairs are better readable. |
This is resolved for the MVP. Further issues should be new tickets. |
Use this issue to leave feedback on the Cor Rationale.
The text was updated successfully, but these errors were encountered: