ruby - Naming convention for syntactic sugar methods -
ruby - Naming convention for syntactic sugar methods -
i'm build library generic reporting, excel(using spreadsheet), , of time i'll writing things out on lastly created worksheet (or active refer it).
so i'm wondering if there's naming convention methods sugar normal/unsugared method.
for instance saw blog post, scroll downwards composite, while ago author used #method sugared, , #method! when unsugared/manual. said normal way of doing things, or odd implementation?
what i'm thinking of doing is:
add_row(data) add_row!(sheet, data)
this feels fit me, there consensus on how these kinds of methods should named?
edit i'm aware ! used "dangerous" methods , ? query/boolean responses. why got curious whether usage in prawn (the blog post) said normal.
i think it's fair definitions:
add_row(data) add_row!(sheet, data)
are going confuse ruby users. there number of naming conventions ruby community considered de-facto standard naming. example, bang methods meant modify receiver, see map , map!. convention add together ?
suffix methods returns boolean. see all? or any? reference.
ruby naming-conventions syntactic-sugar
Comments
Post a Comment