Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

There is something oddly satisfying about just the methods names on the left.


What else would be there?

("Method" as the column name is actually incorrect... they're just bare C functions.)


What else would be there?

It's pretty standard to have the function's type signature and possibly a short description in the function lists of API docs. Here's a random example:

http://ffmpeg.org/doxygen/trunk/group__lavc__fft.html#func-m...

If a function has the same name across different versions of the OpenGL API, does it also have the same type signature? If so, it would be nice to have a version of this with more details.


What good is showing the function signature? It will be different per language implementing the OpenGL bindings.

The docs should be just about the OpenGL functions, not about how C implements them.



I find term "function" rather confusing and improper for programming language construct, because we use the same term in natural languages that is not necessarily 1:1 mapping. Consider commit message: "Implemented function `sort()` implementing sort(ing) function(ality)".


If we want to get really picky, they are procedures.

I think we should start to transition to using the word function only in the connotation provided in functional programming languages, where functions are first class citizens and can be treated as values. Also, should probably prefer to imply a lack of side effects from the word function.

Method is clearly a certain function or procedure that is scoped to a class. So that leaves procedure as a name left over for the type of bare function that isn't a value, that is a statement rather than an expression.

I think subroutine and subprogram are just archaic sounding, and don't really imply anything that the others don't. Method, functions, procedures, I think that's all we need.


So, the distinction that I've learnt is that functions return values and procedures are run for their side effects.

So, strlen, for example, is a function, and printf is a procedure.

(Yes I know prints returns an int, but it's run for it's side effects primarily.)


"Function" comes from mathematics, where it is a well-defined and total relation. The main place programmers use it wrong is that they often use the same term for partial functions, but that's easy to overlook, since a partial function is a 'kind' of function. (That and side effects, but those can be considered to be elided parts of the domain and codomain.)

What you are talking about might be called a relation, which is more general.


In that case you can omit the left side: "Implemented sorting functionality" or the right side: "Implemented function: sort".


I think they are typically called "entry points", at least in the spec. The term "function" is used for GLSL functions and for things like blending functions.


Being pedantic on a pedantic commit: You should use English sentences when writing commit messages. :P


Thanks, fixed the PR :)




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: