Home United States USA — software Increasing code quality with Hyperlambda

Increasing code quality with Hyperlambda

93
0
SHARE

Join the DZone community and get the full member experience.
Fundamentally Hyperlambda is really just a Turing complete markup language, with some added capabilities resembling …

Join the DZone community and get the full member experience. Fundamentally Hyperlambda is really just a Turing complete markup language, with some added capabilities resembling features from XSLT and XPath. You could argue Hyperlambda is the programming equivalent of YAML. On the index of « programming level abstractions » if we argue that CISC x86 assembly code is at level 1 (the bottom level) and C# and Java is at level 5, while Python and PHP are at level 10 – Hyperlambda is at level 100+ somewhere. Of course, the point being, that 95% of the times you need a low level programming construct, Hyperlambda implicitly creates your C# objects and ties these together 100% correctly out of the box. This reduces the cognitive complexity of your resulting app’s code by orders of magnitudes. To illustrate this difference, please have a look at the following code snippet taken from Microsoft’s official documentation for how to correctly create an HTTP request from C#. In addition to the following snippet… … there are some roughly 10 additional code snippets at Microsoft’s example. However, I won’t bore you with all the details in regards to these – The point is that it’s extremely complex to simply GET a freakin’ HTTP request using C#, and hundreds of things might go wrong in the process… All in all we’re talking about 50+ lines of code, scattered in 3 different files, requiring the consumer of the class to understand constructs such as dependency injection, async method invocations, JSON serialisation and deserialisation, IDisposable objects, etc, etc. Notice, the above code doesn’t even include the model class for the returned objects either, so the actual code example would probably end up becoming almost 100 lines of code in at least 3 different files. Then look at the equivalent Hyperlambda example doing the exact same thing. Under the hoods the Hyperlambda code snippet does the exact same thing, with one crucial difference of course, being that the C# example is 50 to 100 times more complex, implying it is 50 to 100 times as likely that something will go wrong. This is not unique for HTTP requests, and similar differences can be found if you try to retrieve data from your database, create multiple threads, save and load files, etc, etc.

Continue reading...