on 10-30-2018 9:29 AM
Hi guys,
I'm digging into some SAPUI5 standard coding at the moment and I can't help wondering about SAP's programming style...
Look at that extract from the "cross.fnd.fiori.inbox.util.ConfirmationDialogManagerInbox" for example:
_createConfirmationDialog: function(n, q, t, b, s) {
var c;
if (s) {
c = [new T({
text: q
}), new a("confirmDialogTextarea",{
liveChange: function(e) {
var f = e.getParameter('value');
var o = e.getSource().getParent();
o.data("note", f);
if (n) {
o.getBeginButton().setEnabled(f.length > 0);
}
As you can see, SAP likes to use only single letters as variable names. And I'm just wondering: is this standard JavaScript nomenclature? Does anybody understand this type of code? ("c is a new T with the text q"). I mean look at the signature alone: function(n, q, t, b, s) - Are you kidding me?!
What are your thoughts on this programming style? Am I too biased from the ABAP guidelines? Am I just out of the loop? Or is it really that "ugly"?
BR, Klaus
Actually if you use SAP Cloud Webide to push the app to server, then by default SAP will minify the code( For reducing the payload of the application). But if you look for other files, you can find -dbg files, which are the original files.
So SAP will put the original files in -dbg files and put the minified code in the actual file.
https://help.sap.com/doc/saphelp_tm92/9.2/de-DE/af/e809bf2a5b482e9c87974ffe5130b7/frameset.htm
Best Regards,
Mahesh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Mahesh,
I didn't know that - thank you for your answer! I will try out the debug mode next time!
BR, Klaus
That's minified Javascript.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Klaus,
I'm happy to help you here. Can I ask where you found this snippet? This code looks "minified" which is a common practice to improve the performance of webapps.
I can hardly imagine that this is the "real" code which needs to be maintained by anyone.
Regards,
Marius
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Marius,
that makes sense! Thanks for clarifying. I found this snippet while debugging the Inbox.
BR, Klaus
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.