Talk:Function prototype

From Rosetta Code
(Redirected from Talk:Function prototyping)

What is a function prototype? The task should not assume the reader knows. --Paddy3118 21:00, 21 July 2011 (UTC)

Function prototype is not a truly general language concept. I think the task author has some very specific language in mind. --Ledrug 01:07, 22 July 2011 (UTC)
I found a wikipedia article, if that helps: http://en.wikipedia.org/wiki/Function_prototype Markhobley 01:49, 22 July 2011 (UTC)
Prototypes are fairly general, but not all languages use them. Markhobley 01:56, 22 July 2011 (UTC)
You probably wanted this link instead, which is a more general concept when the language is strongly typed. --Ledrug 02:45, 22 July 2011 (UTC)
Hmmm. They probably need to merge the two articles. :) Markhobley 08:53, 22 July 2011 (UTC)

I agree that this task is overly specific to a particular language design; I disapprove of it as it stands, because a lot of languages' take on this problem is simply "We do not require declaration-before-use". I was going to suggest that it be generalized to "that which the language requires you to do to write mutually recursive functions", but we already have the task mutual recursion. I would like to see this draft task generalized to state a problem, allowing languages' methods of solution of it to be illustrated, rather than showing variants of a specific solution. —Kevin Reid 21:31, 22 July 2011 (UTC)

Variants of a specific solution are good for making comparisons of languages IMHO. There are lots of tasks that are specific to a particular families of languages, because languages deal with different aspects of computing, and some languages are just designed in a particular way. Some tasks will fit languages better than others. For example, drawing a 3d object task may not suit a data extraction and reporting language. Not all languages even have functions, but that does not mean that we should not have the tasks relating to functions. We can simply omit languages that are not well suited to the job in hand, or create a workaround.

The task in this case is to show how function prototypes are defined within the language. Some languages will allow prototyping, others do not offer this facility, or do not need it. If the language does not require functions or does not have the facility for functions to be prototyped, then it can simply be omitted from the list.

Markhobley 21:56, 22 July 2011 (UTC)