+ 2
A function can still useful even if you don't pass any arguments to it and the function dosen't return any value back.
Is this statement true ?
5 Respuestas
+ 5
The statement is true.
+ 5
depends on the programming paradigm. For functional languages (strictly pure functions) the whole point of a function is it’s return value. A function with no return value is useless. In other paradigms, e.g. OOP and imperative programming paradigms a function without arguments and return values can be very useful. For example, someObject.destroy(), or invokeGarbageCollector().
+ 4
Jason Stone Indeed... you are correct. However, I'm assuming the context is imperative since the question is tagged with "c".
+ 4
David Carroll I did notice that but only right after I posted my comment. And a little more in depth information (probably) won’t hurt.