B
B
baksovnet2017-09-14 16:59:16
PHP
baksovnet, 2017-09-14 16:59:16

Whether it is possible to push descriptions of the same functions into user-defined functions? Wouldn't that be bad manners?

I have the following question, if I stuff a description of the very same function into each of my user-defined functions, will it not be some kind of bad form in programming? Or not? What do you think?
Here is an example:
If I forget, for example, what this function does, I simply pass it as a string parameter, such a secret code - "}{eLpEr#", and it gives me a hint:
"The myBasket() function does not accept anything , but returns an array."
If nothing is conveyed, it will simply fulfill its purpose.
PHP example.
function myBasket($data=""){
if($data == "}{eLpEr#")
echo 'MyBasket() does not accept anything, but returns an array.';
else{
... the code that executes the myBasket() function;
}

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
Vladimir Skibin, 2017-09-14
@megafax

And what is it for then?
https://ru.wikipedia.org/wiki/PHPDoc

I
Ivan, 2017-09-14
@asmodeusta

To do this, there are comments and PHP code commenting standards that many IDEs support. And yes, that would be bad manners.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question