Menu

#10 Specify intents

unspecified
open
2014-12-09
2014-12-03
No

Specifying the intent of subroutine arguments is good practice for a number of reasons (it allows the compiler to flag up when we're modifying arguments which we said we didn't want to change, it can allow better compiler optimisation, required to declare routines pure etc.).

Currently there are a number of routines in which we don't specify the intent. It is likely to take quite a while to track them all down (as I can't find a simple way to get the compiler to flag this up, though some compilers may provide this -- if anyone knows how please let me know) and as such I'd suggest this should be an ongoing activity, i.e. if you write new code please specify the intent of all arguments and if you come across existing routines which don't have specified intent then please think about adding this. I've created a branch [r3128] (from trunk [r3127]) to try to address this.

As this is not really a new feature and is something that is ongoing we may want to think about doing this directly in trunk in the future?

Related

Commit: <Commit _id='51b89c172718462f49a95b40:3128' tree_id='179789530252de35a05a0e1ab41331dad0eb5012' committed=I{'date': datetime.datetime(2014, 12, 3, 12, 21, 57, 629000), 'email': '', 'name': 'ddickinson'} authored=I{'date': datetime.datetime(2014, 12, 3, 12, 21, 57, 629000), 'email': '', 'name': 'ddickinson'} message='Creating a branch for specifying the intent of subroutine arguments.' parent_ids=I['51b89c172718462f49a95b40:3127'] child_ids=I['51b89c172718462f49a95b40:3129'] repo_ids=I[ObjectId('51b89c172718462f49a95b40')]>
Commit: <Commit _id='51b89c172718462f49a95b40:3127' tree_id='054cbf53d49a742325059b3b49b65d7057de6534' committed=I{'date': datetime.datetime(2014, 12, 3, 12, 5, 50, 581000), 'email': '', 'name': 'edmundhighcock'} authored=I{'date': datetime.datetime(2014, 12, 3, 12, 5, 50, 581000), 'email': '', 'name': 'edmundhighcock'} message='--Added the variable user_comments to the namelist parameters. This is a string which can be used to add a description of the run. It is added as metadata to the netcdf file' parent_ids=I['51b89c172718462f49a95b40:3126'] child_ids=I['51b89c172718462f49a95b40:3128'] repo_ids=I[ObjectId('51b89c172718462f49a95b40')]>

Discussion

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.