Beware that this post is related to an SDK in maintenance mode
More Info: Consider nRF Connect SDK for new designs
This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Design patterns and useability

Hi,

Having worked with your software on and off for some time now there are a few things I have noticed that are slightly disturbing when it comes to the SDK.

Usually any SDK (or API for that matter) is supposed to be a smorgasbord of routines to help and speed up program development. Some routines may either be linked to hardware or a "soft" feature but should preferrably be separated from other parts of the SDK and only files that are completely unified in their use should have a connection to each other. There is a term often used for this:"Separation of concern". Then building an application merely consists of selecting the proper building blocks and connect them in an orderly fashion (like LEGO).

Provided application examples should provide a crystal clear and simple use of the building blocks so that programmers get the hang of how things do work without necessarily go through the complete code base.

Unfortunately this is not what I see when I look at the nRF SDK5. Examples are overly complicated and does by no means explain how to write your own application. The SDK contains multiple interleaved samples, possible to save space but makes it virtually impossible to pick only the wanted features from the code base. I do not mind the code being obfuscated (like it is) if it is clear and to the point where programmers can just use the software. Programmers are often adviced to use an example and tweak it to their uses. This would also be fine if it were possible. In my opinion this is only possible if you make alterations to the SDK itself which is fine if you are just working on one single project. Having more than one project can therefore create undesired effects unless you are highly disciplined as a programmer (few of us really are).

Finally I have some objections to the use of the sdk_config file found in every project. Creating a project from scratch is thus a tedious task of finding the bits and pieces needed to make a sdk_config file. Even if you start with an example and add some features later, you will inevitable loose several hours on just finding out which defines are needed. The file also has a tendency to become very big with more than 4500 lines which does not help either. The idea is good that you can control the building blocks by using a configuration but it simply gets to much at times. I suspect that plenty of support cases actually comes down to small but important changes in the sdk_config file.

I realise that the "monster" that you have created is far from easy to change overnight and perhaps you should not even consider altering the code in any way, I still long for small separated building blocks that can be easily accessed and assembled. Perhaps you should consider creating such a SDK instead. Having said that, I still think that it is a good idea to have complete implementations of various standards (radio mostly) ready for the user but those are just slightly larger building blocks or possibly "soft devices".

Best regards

Anders

Parents Reply Children
  • Hi Einar,

    Making a complete SDK for several differnt processors is not an easy task... And making structural changes to the vast SDK is not something you do unless you really, really have no other option. I do not envy your developers in any way.

    Perhaps I am just another "grumpy old man" who have spent his last 24 years programming various processors, languages and operative systems. Over the years I have come across code in all forms and structures, some of which I have come to appreciate and therefore reuse as often as I can. As you probably already have guessed, that will not be the case with nRF SDK5 (or any similar code). That do not in any way imply that the code is bad, on the contrary, the fact that your programmers have managed to get a working (well almost working) SDK from this code is an achievement. I am also sure that there are plenty of programmers out there who disagree with me and thinks that the SDK is the "jewel in the crown" and I have nothing but envy for them, wishing I was like them, but sadly I am not.

    One final word of advice to your programmers: Admittedly there are advantages of having code in "defines", but when defines contains one or more defines that in turn contains defines and so on, things get a little "out of focus". It may of course be intentional so that no clumsy *** (like myself) even attempts to alter any of the code, but it is hard to understand and especially debug (if you, like I, have had to do) to understand why things do not work as expected.

    Best regards

    Anders 

Related