Technology Blogs by Members
Explore a vibrant mix of technical expertise, industry insights, and tech buzz in member blogs covering SAP products, technology, and events. Get in the mix!
cancel
Showing results for 
Search instead for 
Did you mean: 
hardyp180
Active Contributor
Most ABAP programmers are terrified of JavaScript or indeed any other language. Can an SAP Press book on JavaScript help address this fear?


01 JavaScript Book


As a disclaimer I get a free “E-Book” copy of such books provided I write a review on Amazon. Very few computer text books get reviews on Amazon. My “ABAP to the Future Books” get very few reviews also – one was from Jelena saying it was great, one was from someone who complained I used Monsters for all the examples, a very strange point of view.

The point is what you really want is half a ton of reviews so a prospective reader can get some sort of unbiased opinion. The ultimate example of this would be “How to Avoid Huge Ships” by Captain John W. Trimmer. I encourage you all to have a look at some of the reviews, to see how it is done.

https://www.amazon.com/Avoid-Huge-Ships-John-Trimmer/dp/0870334336

People have been posting reviews of that book on Amazon for over twenty years, there are hundreds of them. Without all those reviews that mega-classic would not be the success it has been.

Now some eagle-eyed people will say there have been a whole bunch of books from SAP Press about “JavaScript for ABAP Developers” before, and indeed an assortment of blogs on the subject over the years. What is different this time?

As it transpires most SAP Press books are about – wait for it – SAP – very few are about avoiding Huge Ships. In other words the target audience are people who deal with SAP products in their day to day lives, be they developers, business analysts, management or whatever.

However for many years now SAP Press have also been publishing ERP agnostic books about programming languages like Java or JavaScript – but only in German. This year they have decided to publish editions in English as well to see what happens.

Break Off

I have been having a good couple of weeks ABAP wise. Someone from a roofing company in Canada contacted me to see the best way to install ABAP2XLSX – which means they had heard of it. In the end they installed both abapGit and ABAP2XLSX and so I am anxious to learn how they go.

In addition someone else, this time from India, contacted me and said that all their programs were 20-25 years old and all FORM routines and DYNPRO programs and he had bought a copy of my book “Improving the Quality of ABAP Code” from APRESS (which I thought nobody had, though naturally I think it is a work of genius) and was asking how best to start turning them into OO code? Sadly most organizations are in that exact position, despite ABAP OO being introduced in the year 2000. As it turns out I am speaking on this very subject at the Australian SAP Users Group conference in Sydney next week, and I have spoken about this before e.g. at the inaugural SAP Online Track and so sent a link to that talk.


02 SAUG Conference


We cannot say "Australian SAP Users Group" as there is already another country starting with the letter "A" which has a SAP user group.

Past Mortem

I did not do a computer science degree- it was economics. When it comes to programming I am more or less self-taught, starting at about the age 14 with BASIC.I would say that me and some of my friends were at the height of our ability back then. I recall being told that text compression beyond 50% was impossible so I wrote something in machine code which I thought would achieve that goal (you could call machine code from BASIC on the BBC Micro) but I could not get it to work so my mate, also 14 at the time, fixed it up for me. What I was doing at the time was reading about all the new features in computer games and trying to see if I could replicate them e.g. the real time interaction in “The Hobbit” and text parsing so the program could understand input such as “GO LEFT THEN GO RIGHT THEN PICK UP THE AXE THEN ATTACK THE MONSTER”

So I got an O level in Computer Science, in the sixth form as I recall, but that was quite surreal as all of us who took that (optional) course knew more about computers than the teacher. That got me up to 9 “O” levels + 3 “A” levels which I thought somehow might be useful in later life, but it was not really. It did get me into university where I discovered everyone else had four “A” levels as there was one on general knowledge which my school did not do.

At university I did economics though there was a small course on PASCAL which was quite interesting.

When I started work in 1989 – whilst still a student – I discovered on the first day that LOTUS-123 had a programming language built in and you could write macros to automate repetitive tasks.

Then in 1999 whilst in Israel it was time to teach myself about ABAP (with some informal help at the start) and by the time I went on an official SAP training course in about 2001 I was already there. Fun fact – in that 2001 training course the instructor glossed over the ABAP Objects part of the course as fast as he possibly could and that was the only segment for which there was not any sort of test.

Later on I found that in some parts of SAP e.g. Ariba, there was a lot of Java code, some of which I needed to fix/maintain.

Later on again when I wrote the ABAP to the Future book I could not help but notice that the UI5 code was in JavaScript so once again I did the good old IT thing of not reading very much but copying some examples and trying to work out how things worked until I got an example monster application working. I did the same with WebDynpro the same year (2015) and have to say that the JavaScript learning curve was much less steep.

At this point you are wondering – what was all that about?

The point is all throughout life there was a series of new languages and at no point did I throw up my hands in despair and refuse to even think about trying to program in that new language.

Yet that is exactly what a lot of ABAP programmers do. And because they do most management types have concluded that it is impossible for an ABAP programmer to learn a new language.

This is a lose-lose situation for everyone involved.

And so….

And so since I am having a year off writing books I decided this might be a good year to focus on actually doing some serious reading on JavaScript as opposed to guessing how it works and asking fellow Mentors for help when I get into trouble e.g. Graham Robinson / Wouter Lemaire.

The first cab off the rank will be the JavaScript book as pictured at the start of this blog and when I am done with that it will be the Clean UI5 book which I have already bought and read the first few pages.

You can usually tell when any sort of book (novel or textbook) is any good by the end of the first page. Often by the end of the first paragraph.

The Clean UI5 book passed that test. The JavaScript book took a little longer but by the end of the first chapter it survived to get the Green Tick of Approval.

Tales from the JavaScript

What most attracts me to JavaScript is people telling me it is a fun language to program in. I find ABAP to be fun also, which might possibly make me a madman, but anyway the more fun we have the better, especially at work.

Having dealt with ABAP for so long there are some JavaScript concepts that are explained to me, and sometimes I understand them for a short while, and then I forget again, almost as if they are so strange my ABAP brain expels them as alien invaders. These include, but are not limited to:-

  • No side effects. This one I can easily grasp. This is where a software routine has only local variables within it and cannot modify any global state. Thus every time you call the routine with the same input you get the same result. You can do that in ABAP as well, but I believe this is more rigidly enforced in functional languages.

  • Functions are first class citizens. This means functions can be passed as parameters of other functions. Initially I thought this was rather like passing an instance of a class as a parameter but no, it is nothing like that. I remember the light bulb going on when I worked out what this really means but now I have forgotten again,.

  • Immutable “Variables”. This is where you set a value to a variable and thereafter you can never change it. This is a very strange concept to an ABAP programmer. I recall “Uncle” Bob Martin writing a series of blogs about his “Space War” program. There when a player destroys a Klingon Battlecruiser instead of changing some sort of variable to flag that battlecruiser as destroyed what actually happens is a whole new identical new “universe” is created, exactly the same as the last but with the battlecruiser in question destroyed. Because you are not allowed to change any variables, so you have to create all new ones. This made my head spin. D.J. Adams explained this to me once, why this was good, and it made sense at the time, but now I have forgotten again.

  • “Promises” – apparently these are the bees’ knees, the best thing since sliced bread. I knew why once, now I have forgotten.


So the challenge now becomes to rediscover these concepts – and more – in such a way I do not forget them again.

Book, Book, Book, Reddit, Reddit, Reddit

OK now it might be a logical time to start actually talking about the JavaScript book. I have only just finished the first chapter so here I am actually not going to say very much – that will come in subsequent blogs.

If you read one of my books e.g. “ABAP to the Future” or “Improving the Quality of ABAP Code” you will be expected to have quite a bit of programming knowledge. Not so here, right at the start there is an explanation of “What is Programming?” and similar basic concepts. Since I am supposed to be an “expert” I was encouraged to skip such things but no, as I have no formal education, I was bursting to know the answer in case I had been doing it wrong all these years. Luckily, after reading the explanation I think I am OK.

When I started with ABAP circa 1997 I had no idea how “spoilt” we programmers were. We did not have to worry about developing on our local machine and merging it with the central system, we did not have to worry about connecting to the database, we did not have to worry about connecting to the GUI, we did not have to worry about what database was being used, we did not have to worry about what underlying operating system was in use, just write your code from incorrect specifications, get it wrong even based on those specifications and then go from there.

Programmers in other languages had to worry about every other thing in the list as well as the last two, which are universal.

As a result I remained blissfully ignorant of many of the basic concepts that “proper” programmers (i.e. ones who do not program in ABAP) find obvious. Now that greatness has been thrust upon us in the form of UI5 it would be a really good idea to get a handle on some of those concepts.

Cliff-hanger Ending

What are those concepts? Are they a force for good or a force for evil? To find out stay tuned to this channel and wait the next exciting episode of “JavaScript Book Review”

Cheersy Cheers

Paul
4 Comments
Labels in this area