slack-get API review
By Arnaud Dupuis on Wednesday 30 January 2008, 08:39 - slack-get - Permalink
Hi,
Back from holidays, I started to work again on slack-get by a huge code review and documentation updates of the API.
My current contract had an impact on this process since it consists in extending the NMIS tool. This tool is really great and useful like no other ones when it comes to network monitoring tasks.
But this tool also have an important flaw : its API is a real mess. It consist of a main script of 7000 code lines and few modules (around 10) totally undocumented !
My job is currently to run into this code, understand it (hopefully it's not too hard to guess) and find a way to add something like a plug-in system to it. Unfortunately, all NMIS modules exports all their functions in the calling script's namespace...
So I choose to have a different naming convention than the one in NMIS for plug-in's methods name... And their is no naming convention in NMIS...
And I sadly saw that it was exactly the same with slack-get Perl API... So starting today I will change that and tag along with the following naming convention :
Arnaud Dupuis
Back from holidays, I started to work again on slack-get by a huge code review and documentation updates of the API.
My current contract had an impact on this process since it consists in extending the NMIS tool. This tool is really great and useful like no other ones when it comes to network monitoring tasks.
But this tool also have an important flaw : its API is a real mess. It consist of a main script of 7000 code lines and few modules (around 10) totally undocumented !
My job is currently to run into this code, understand it (hopefully it's not too hard to guess) and find a way to add something like a plug-in system to it. Unfortunately, all NMIS modules exports all their functions in the calling script's namespace...
So I choose to have a different naming convention than the one in NMIS for plug-in's methods name... And their is no naming convention in NMIS...
And I sadly saw that it was exactly the same with slack-get Perl API... So starting today I will change that and tag along with the following naming convention :
- a method name consist of English words where space are replaced with underscores ;
- if the name is conflicting with Perl or C++ built-in function or language syntax, change the case of the first letter to upper case.
- if a conflict was solved according to rule 2), and if the name do not conflict with the other language, add a wrapper method around the renamed one, in order to comply with the rule 1).
Arnaud Dupuis
Comments
Off course you should have understood the rule 1) as :
"a method name consist of lower case English words where space are replaced with underscores"