Why should I use interfaces?

前端 未结 3 1800
轻奢々
轻奢々 2020-11-28 16:20

Whenever I program in Fortran I use modules and I don\'t have to worry about writing interfaces.

Now I\'m writing Fortran code to use inside R. The problem is that

3条回答
  •  难免孤独
    2020-11-28 16:45

    Just a slightly more "philosophical" viewpoint from the above excellent answers which deal with specific uses of interfaces.

    You declare all your variables don't you? Presumably you do this to protect yourself against typos, accidental mis- and ab-use of the variable, and to avoid the reader having knowledge of occasionally arcane rules, amongst other reasons. So why don't you want to do the same for all your subprograms? All the above and more apply.

提交回复
热议问题