DEV Community

Cover image for Less awful module names

Less awful module names

Augusts Bautra on October 28, 2018

I'm a fan of naming things correctly. I loathe Devise. I just can't bring myself to read Enumerable source. Why is that?! TL;DR Stop na...
Collapse
 
jsrn profile image
James

I actually like the Somethingable convention of naming modules, because for me it is natural to think of modules in terms of what they allow the including object to do.

I do however dislike trying to name modules according to the Somethingable pattern, but I wonder if that's just a failure of my vocabulary.

Awarable is very clunky, though. Is the point that when included in an object, you can... make that object aware of something? Off the top of my head, I would have gone with Alertable, Notifiable or something. Something that, even if you don't like the naming convention, is actually recognisable as a word.

Collapse
 
tomk32 profile image
Thomas R. Koll • Edited

I'd like to think that the ruby community is a very friendly one where we don't call other people's concepts or naming schemes "**** stupid". But that's just my humble opinion.

Besides that, it's not the module that's enumerable, instead, by including Enumerable the class becomes enumerable. The module, due to its nature, isn't capable of doing anything on its own, only inside a class it gives power to the class.

Collapse
 
epigene profile image
Augusts Bautra

Like I said, I haven't read the source, but taken at the face value of the name include Enumeration would absolutely be more understandable than include Enumerable.

Collapse
 
moopet profile image
Ben Sinclair

— What did you include?
— "Awarable"
— Um, you mean like a fitbit?