Open lucasborin opened 3 years ago
This is all well and good, but does the compiler or code pal warn you that you're obscuring a built-in function? If not, you should be aware of all existing built-in functions.
There's also the problem of future built-in functions. Should be rare, but we should not retroactively warn users about new built-in functions introduced in the language. In the end, if the class is well designed and tested and uses a method with the name of a built-in function, then it was not intended to use the built-in function itself and all should be good.
Can't this issue be closed? #251 from 2022 covered this matter sufficiently in my opinion.
In a short dialogue about the self-reference rule (Code Pal, Clean ABAP), it came to a strange scenario where a class method is named as a built-in function.
For instance:
If you want to call the built-in function
strlen
, you are not allowed anymore because you "replaced" it:But, you can:
I haven't found anything on this matter in the style guide, and I will open a pull request discouraging the reuse of the built-in function names like the
line_exists
,lines
,line_index
,strlen
, etc. In parallel, I would like to see your opinion about it.Do you consider it a bad practice? Do you see it needed sometimes?