Skip to content
This repository has been archived by the owner on Mar 6, 2019. It is now read-only.

drop footgun support #13

Open
shadowcat-mst opened this issue Jun 12, 2015 · 4 comments
Open

drop footgun support #13

shadowcat-mst opened this issue Jun 12, 2015 · 4 comments

Comments

@shadowcat-mst
Copy link

augment is always a terrible idea, override is almost always better expressed as around.

There may be more - many of the things I skipped in Moo were because they'd proven to be a bad idea and were disrecommended in Moose - but those two would definitely be a start.

augment especially scares the crap out of me.

@bluefeet
Copy link
Owner

Hey Matt - o.augment is a low-level function for extending an object's prototype. Think of it as poor-man's single-inheritance extends() support in Moo(se) terms. It wasn't meant to have anything to do with the Moose augment which I agree is terrible.

The only method modifiers supported by o.js are before, after, and around.

@bluefeet
Copy link
Owner

The low-level functions for method modifiers:

https://github.com/bluefeet/o-js/blob/current/doc/Plumbing.md

Method modifiers as part of traits:

https://github.com/bluefeet/o-js/blob/current/doc/o-Trait.md

@shadowcat-mst
Copy link
Author

Oooooh. Right. I, er, wonder if it might be worth picking a different name and leaving augment as an undocumented alias for a while for backcompat? While clearly I suffered a reading comprehension error due to skimming, given i'm now including o-js in my slides for 'Moo(se) ported to other languages' I may end up sending more people your way who'll make the same mistake :)

@bluefeet
Copy link
Owner

Oh, thanks for including this in your slides. o.js is heavily inspired by Moo(se) for sure, and Type::Tiny.

Ya, renaming augment makes sense. Now I have to come up with a name. If I called it extend it would be very familiar to Moo(se) users.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants