Creating a Web API backend with ZERO lines of code, and invoking it with ONE line of code

About a year ago I told an acquaintance of me on Twitter that I was working on a “zero lines of code” software framework. His reply was “I don’t believe in zero lines of code, but I believe in ‘low code’ frameworks”. In the end he was right, because I couldn’t reduce the LOC to ZERO. Regardless of how much I tried, I still ended up with ONE single line of code … 😉

Failure comes in many flavours, also sweet

Anyways, Magic is now at the point where I can literally wrap any MySQL or MS SQL Server database into a Web API backend, without having to write one single line of code. This works by having my computer read meta data from the SQL database schema, for then to generate or “scaffold” Hyperlambda code, that results in HTTP REST endpoints, for every single CRUD operation towards my database. So far so good, still at ZERO lines of code. Watch the video below where my computer is automatically creating 888 HTTP REST endpoints, and equally many code files, in some roughly 40 seconds.

Then comes the need for authentication and authorisation, in addition to that sometimes the automatically generated CRUD endpoints sometimes needs to evaluate custom SQL, and you can’t rely upon the “automatically generated” SQL that only allows you to do simply CRUD – Even though it’s obviously powerful, and allows you to create fairly complex stuff “for zero effort”. Watch the following video for a “deep dive into how Magic actually works” – That demonstrates it in more details, and goes through it in more details.

So far we’ve created ZERO lines of code, right – Even though we have arguably created an entire CRM system, with 888 HTTP REST endpoints, wrapping an extremely complex and rich database (Sugar CRM’s database, with 222 tables). Then unfortunately to the point where I “fail” – Since I needed to “sugar the pill” with one single line of code – Where I invoke any HTTP REST endpoint from Hyperlambda, using the “Evaluator” of Magic – Which becomes the one single line of code, proving how my friend was right, and that “Zero code frameworks don’t exists”.

Sorry, I failed 😀

Psst, if you want to read my DZone article about how to invoke HTTP REST endpoints with a single line of C# code, you can find it here

Leave a Reply

Please log in using one of these methods to post your comment: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.