Hello, Deno

Posted on Leave a comment

Deno v1 is here, and so is my experiment. Unlike my usual first programs, this one is a bit better than a pure “Hello, world”. So not only it is a meaningful program (does not literally print out “hello world”), it also has data models, unit tests and CI integration (Travis).

From its documentation:

A super-simple Deno app that pulls (from an API) national COVID-19 stats for India, and displays the total count of people who have recovered from the disease till yesterday.

What else did you expect? Let’s spread some positivity in tough times!

Check it out here and let me know your thoughts (if you exist):

https://github.com/anuragbhd/hello-deno

Btw, this is the best damn geeky one-liner code to explain what is Deno. Totally cool.

Express API Refkit

Posted on Leave a comment

https://github.com/anuragbhd/express-api-refkit

I frequently create APIs for muse/professional apps, and every time I find myself scrambling to pick the best pieces from my previously built APIs or online repositories.

To streamline this, I recently created this reference kit (mostly for myself) to help me in writing a production-grade Express-based API from scratch. Sharing with this group in hopes that my fellow XTians will benefit from it when writing their own RESTful APIs.

As noted in the docs:

This is NOT a starter template. The purpose of this repository is to provide reference code to anyone looking to create a beautiful, secure and well-tested Node/Express-based API from scratch.

Creating from scratch has the invaluable benefit of learning while doing. Most likely, there will be struggle which will make you better. You will know by heart all parts under the hood and exactly how they interact with each other. Basing your project off of a starter kit takes that away from you. Hence the need for a reference kit (or refkit, as I like to call it).

If you are experienced in Express, feel free to open pull requests to add improvements.

Contributions in any form are welcome 💁‍♂️

Featured image credit Nick Youngson CC BY-SA 3.0 Alpha Stock Images

The charm of functional programming

Posted on Leave a comment

While reading modern JavaScript code, you might have come across such things as Array.prototype.map(), Array.prototype.filter(), pure functions, higher order functions, the spread operator, etc. Basically, all the things that React and Redux made us write willingly or unwillingly. I am not going to spend the next 2-3 hrs going into finer details about FP. Instead, I am going to link you to 2 great articles I found on this topic.

Functional Programming (or FP) is a programming paradigm, a collection of guiding principles to write code in a particular style. Any developer who strongly adheres to this way of writing code will tell you that it eventually leads to code that is more readable, maintainable, testable and bug-free. In saying that, they would probably be right. Creating in React and GraphQL has made me a big fan of the declarative programming style. FP promotes declarative over imperative. Again, don’t worry too much about all the jargon. Once you’ve read the following articles, you’ll have a good understanding yourself.

FP is just one of multiple paradigm that JavaScript supports (other ones being event-driven, object-oriented and prototype-based; last two being forms of imperative paradigm). There are several other languages that support FP, most notably Haskell which supports ONLY the functional style. The currying technique is an essential ingredient in creating functional code, and is supported in a lot of modern languages including JavaScript.

Interestingly, there was a (famous?) guy named Haskell Curry who is the namesake of the language and the technique described above. Haskell. Currying. Get it?

Enough said!

Here are two excellent articles that introduce functional programming superbly. Read the first one first, after which all code examples in the second article will be immediately understood (really, Avi Aryan has done a great job with those examples).

Master the JavaScript Interview: What is Functional Programming?

Intro to Functional Programming: JavaScript Paradigms | Toptal

Meetup: Enterprise JavaScript Version 2

Posted on Leave a comment
Enterprise JavaScript Version 2 poster

After 3 long months, we had the second edition of Enterprise JavaScript meetup. The first one was in June. It was an interesting meetup. 40-odd people signed up (RSVP’d) and 10 turned up. That’s a nearly 25% conversion rate. Not bad! Despite the small group size, we had a good time.

Enterprise JavaScript: Building Beautiful Modern UI/UX

In this second edition of our popular NCR meetup, we will learn to build elegant, professional and modern user interfaces and experiences. Do not miss out on the opportunity to hear from and interact with distinguished developers. Learn from real-world experiences of the speakers.

Meetup.com: Enterprise JavaScript – Version 2

Unlike the last time’s conference-style schedule, we had this time only 2 sessions:

Building Enterprise-ready Web Applications With OpenUI5 and Fiori by Nitish Mehta

Creating Beautiful Cross-Platform Apps With Flutter by Anurag Bhandari (me)

A relatively short schedule allowed us to go deeper into our respective topics and entertain more questions from the audience. Talking about the audience, we had a decently diverse group of enthusiasts and learners from undergrads to junior devs to project managers. They were all just lovely. We even had a foreign guest: a nice guy from South Korea 🇰🇷. That means we have international reach now, haha.

As usual, Nitish’s session was well-prepared and touched most aspects of this topic, OpenUI5. I personally learned a lot since (surprisingly) I had never heard of this UI framework before. Too much Bootstrap hypnotism?

As for the Flutter session, it was my first-ever attempt at teaching and evangelizing it in public. I loved doing that as much as I loved coding my showcase app. Oh yeah, it was a mostly hands-on session where we spun up a beautiful Health App in just over 60 mins (including learning Flutter and Dart stuff on the way). The full source code and tutorial of the app is in my GitHub repository.

Okay, I am done blabbering. Here are some pics:

Meetup: Enterprise JavaScript Version 1

Posted on 1 Comment
Enterprise JavaScript Version 1 poster

As with a lot of other posts on my blog, this one is also delayed. I mean, A LOT delayed. The event happened in June, so you get the idea.

In Delhi/NCR, not a lot of software meetups happen. The scene is maturing but is not yet on par with the other techie cities such as Bangalore or Hyderabad. Again, not a lot of software meetups happen here and definitely not enough on JavaScript.

One tendency I’ve consistently observed in this region is developers’ reliance on jugaad. That is, they try to “duct-tape” their way through the code if they cannot find out the root cause in a reasonable amount of time. I know, we have all been there once. But this culture is less pronounced in technically more mature cities such as Bangalore.

When it comes to JavaScript, the attitudes are even worse. A lot of developers see it as a ‘scripting language used for validations in browser.’ Yes, some devs do realize the power of frameworks such as Angular, React and Ember in creating full-blown applications. Still, there’s a lot of us who do not see JavaScript itself as a first-class OOP programming language. That is simply tragic! So back in June I thought enough was enough and that this attitude toward JavaScript MUST change.

The opportunity to organize and curate a meetup themed on enterprise use of JavaScript came from Gaurav Gandhi, a great community builder, techie and AI geek. So I worked with him to organize this meetup, signed up a few speakers, and got the venue arranged.

From our consistent promotions on meetup.com, we got 400+ RSVPs! But going by our earlier experience, we weren’t expecting more than 30 (10% of total). Around 50 actually turned up. Man, that was no less than a mini-success.

Coming to the event’s agenda. We planned it as a sequence of conference-style talks by industry experts. For more, I’ll probably just copy-paste from our meetup.com page.

Enterprise JavaScript: Are You Using It THE RIGHT WAY?
Learn from startup journeys, hands-on exercises and product showcases

JavaScript is arguably the most popular programming language on planet[1] and yet a lot of us use it the WRONG way! But the blame is not entirely on you. With so many learning resources around — courses, blogs, tutorials, books, and what not — it’s hard to find the best place to start or improve. Most of these learning resources target a beginner audience. That is where the problem lies! In an attempt to be concise, they leave out the finer details that separate a good programmer from a bad one.

Don’t worry, we have all been there. Learning is a great way to improve. But is there a better way? Of course there is: it’s called “hands-on experience”.

In this special edition event of our popular NCR meetup, we bring to you that priceless experience in the form of 5 sessions. Do not miss out on the opportunity to hear from and interact with distinguished developers behind some massively scalable consumer and B2B apps. Learn from real-world experiences as speakers share their journeys on implementing NodeJS and client-side JavaScript at scale.
Learn to code in JavaScript and NodeJS the RIGHT way!

Meetup.com: Enterprise JavaScript – Journeys, Code Labs & Showcases

Here are some pics from the event:

Many thanks to 91springboard for generously sponsoring the venue and food. Kudos to all the wonderful speakers. And special thanks to all who came to attend, learn and share 🎉.