Function signature convention (style guide)
mcmillan03 opened this issue · comments
How should signatures be named and structured.
With namespaces and reasonable default arguments.
But given that we're in C, we just prefix everything with LAGr_.
To drill down a bit:
- There's a good chance that LAGraph will start to modularize and segment by domain. If algorithms were truly unique to an application area, I would suggest we add that to the signature (e.g. LAGr_ML_ or LAGr_NetSci_). However, many algorithms are unlikely to be used by only a single domain area. Maybe they can have their own version in their domain tailored specifically to their area, but we risk a lot of code duplication if we assume that from the start.
- Regarding argument ordering, do we want to use output-first like GraphBLAS? It would seem reasonable to do so.
- From a broader style and philosophy perspective, should we keep names short (LAGr_bc) or long (LAGr_BetweennessCentrality)?
Scott,
I’m sorry I’ve taken so long to reply to your message. It’s been a bit crazy at work these days. Here are my replies to your questions. Let’s get some discussion going in the group and see if we can settle some of these issues be email sooner rather than later.
Yes, we should agree on a prefix since we don’t get to define a name space. I am OK with “LAGr_”.
Do people think we should go all the way to LAGraph_”?
I do not think we should specialize to domain. Its too hard to anticipate all the different domains we need to support nor how the mappings will work. LAGraph_algorithm () does what we need (or LAGr_algorithm).
I like shortened algorithm names, LAGr_bc() rather than LAGr_BetweenessCentrality()
It would be nice to mimic the rules we used in GraphBLAS for argument order (output first than input). But if the group feels applications programmer using C would prefer a different convention, I’m OK with that. I actually do not expect a huge amount of overlap between people using GraphBLAS and people using LAGraph.
…--Tim
From: Scott Kolodziej <notifications@github.com>
Reply-To: GraphBLAS/LAGraph-Working-Group <reply@reply.github.com>
Date: Wednesday, April 8, 2020 at 6:40 AM
To: GraphBLAS/LAGraph-Working-Group <LAGraph-Working-Group@noreply.github.com>
Cc: Subscribed <subscribed@noreply.github.com>
Subject: Re: [GraphBLAS/LAGraph-Working-Group] Function signature convention (style guide) (#5)
With namespaces and reasonable default arguments.
But given that we're in C, we just prefix everything with LAGr_.
To drill down a bit:
* There's a good chance that LAGraph will start to modularize and segment by domain. If algorithms were truly unique to an application area, I would suggest we add that to the signature (e.g. LAGr_ML_ or LAGr_NetSci_). However, many algorithms are unlikely to be used by only a single domain area. Maybe they can have their own version in their domain tailored specifically to their area, but we risk a lot of code duplication if we assume that from the start.
* Regarding argument ordering, do we want to use output-first like GraphBLAS? It would seem reasonable to do so.
* From a broader style and philosophy perspective, should we keep names short (LAGr_bc) or long (LAGr_BetweennessCentrality)?
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub<#5 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AATVME247XGX3PEARL6P2ZTRLR5EVANCNFSM4LZDAEEA>.