‎2020 Mar 04 3:59 PM
Hello all,
Today I spoke for one hour with colleague about coding convention but we're still not agree. I would like to have your opinions.Can I have your naming convention (variable, object, table, structure, ...) ? (assuming that the client just starts his project and gives you the choice)
Second, do you write a header of class and a header of method like you write a header of program ?
The code version is earlier than 7.4.
Regards
‎2020 Mar 04 4:07 PM
Clean ABAP styleguide actually recommends to avoid such prefixes. Avoid Encodings describes the reasoning in depth.
‎2020 Mar 04 4:07 PM
Clean ABAP styleguide actually recommends to avoid such prefixes. Avoid Encodings describes the reasoning in depth.
‎2020 Mar 04 4:33 PM
I already read this doc and I have the book Clean code, but we won't/can't apply this for simple reason :
"If you follow Clean Code, your methods will become so short (3-5 statements) that prefixing is no longer necessary to tell importing from exporting parameters and local from global variables."
We currently have colleagues who are not familiar with oop and gap is too big so we prefer use Hungarian notation and my question is what Hungarian notation use ?
‎2020 Mar 04 6:21 PM
alexandre.dubots
Even if you do not use OOP keeping the length of modularization units at a manageable level should help maintainability in a great deal. Moreover, with less number of objects to deal with you don't need to rely on naming that much.
The ABAP Guideline itself suggests a simple prefixing system in order to avoid name collisions (I prefer to omit prefixes everywhere, but this can also make sense).
I do believe however, that coding technical information in the object's name is completely useless. We live in the era of modern code editors where you are literally one click away to check the type of an object.
‎2020 Mar 04 4:36 PM
Ok, but more generally :
Classe (static and instance), importing, exporting, modify, using, ...
And what about my second question ?
‎2020 Mar 04 7:42 PM
I would (also) suggest to check the Clean ABAP Guidelines on GitHub or the (English) DSAG Guidelines to ABAP Development (.PDF).
‎2020 Mar 04 7:50 PM
alexandre.dubots, others have discussed Hungarian notation, so i won't.
As to your "headers" question, I am assuming you mean the boilerplate comments that contain who wrote it and why and for what project and the change explanations.
While they, too, shouldn't be needed in this day and age, I have yet to meet a project manager who doesn't require them to be included. And when I work with objects, I use the form-based editor in SE24, so I add the boilerplate comments using the "Class Documentation" button.
Okay, I have to comment on Hungarian notation: move away from it as an engineering priority. If your colleagues aren't familiar with OOPS, then get them familiar with it before your lose maintainability of your project and have to outsource everything because they won't learn OOPS.