Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

What is the standard for describing functions/methods (function name, number of arguments, argument type, return type, etc...) in a manner that is language independent?

EDIT: More specifically, how does one describe a function without the use of diagrams? I thought there was a pure text standard.

share|improve this question
add comment

2 Answers 2

up vote 6 down vote accepted

Types are pretty language dependant. If you have a "language-independant" description of functions/methods that includes types that go beyond ints, floats and strings, then it's really a language of its own, an interface description language.

There are many of these to choose from; WSDL is probably the most widely known nowadays.

share|improve this answer
    
I guess that is why I can't find the answer I'm looking for. –  Blaise Swanwick Oct 2 '12 at 16:08
    
@Blaise Swanwick: a general answer may be: you're looking for an IDL –  Michael Borgwardt Oct 2 '12 at 16:10
add comment

What you are asking is a formal language for describing functions, independent of formal language. This clearly cannot exist due to the contradiction in its definition. You will have to relax one side or other.

Keeping independent of all languages, the you get pseudo code which, by definition, does not have a standard.

If you relax the other constraint there are various formal languages (e.g. UML or any PL) you can use to describe your solution, however you are then effectively implementing your solution in this formal language.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.