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

To me, that's a procedure, not a function.

It's a pity that so few of our programming languages distinguish between these two quite different concepts.



What is the difference between a function and a procedure to you? I assume it's not just about whether something returns a value or not.

The only language I use that differentiates between functions and procedures is PostgreSQL, and to be honest I find the distinction pretty annoying in practice. One can return values, the other can control transactions. So when refactoring code you sometimes need to make a function a procedure or vice versa and it's a pain. (As a consequence, I try to always use functions to make things easier)


Fortran distinguishes between the two as well.




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

Search: