AMA with: Faraz K. Kelhini (codebar Winter Lit Fest)

Ask Me Anything with
Faraz K. Kelhini
@Faraz

On February 27 and 28, we are giving you a chance to ask questions of PragProg author Faraz K. Kelhini as part of our Winter Literary Festival in partnership with codebar.

Faraz K. Kelhini is the author of JavaScript Brain Teasers, Modern Asynchronous JavaScript, and Text Processing with JavaScript and is working on a new book on TypeScript. With a profound understanding of the JavaScript language and its intricate APIs, Faraz’s journey has been fueled by a passion for championing innovative ideas that improve the coding experience, all while crafting solutions that seamlessly harmonize creativity and functionality. Ask him about programming, one of the technologies he has written about, or anything else—really!

Everyone commenting or asking a question will automatically be entered into a drawing to win one of the author’s books.

In addition, from from February 24 to March 2, as part of our Winter Literary Festival with codebar, you can use promo code 2025WinterFest to save 40 percent on purchases at pragprog.com. We’ll donate 20 percent of the net income from the promotion back to codebar after the event.

Offer not valid where prohibited or restricted. Offer not valid on previous purchases. The Pragmatic Programmer: 20th Anniversary Edition is not eligible for discounts, as we do not publish it.

Hit Reply to post your question below. The author will check in periodically to answer your questions.

2 Likes

Hi everyone! :wave: I’m eager to see what questions you all have!

I began my programming journey with PHP, then dabbled in Python for a while. But it was JavaScript that truly captured my interest. It’s no longer just a language for web development: you can now use it to build full-fledged applications, power server-side projects with tools like Node.js, create interactive mobile apps, and even dive into game development.

Feel free to ask me anything about my experiences with JavaScript or any other topics you’re curious about!

1 Like

Hello @Faraz.

I’ve been waiting for this AMA to open for a while so I’m glad that you are here.

My questions:

  1. I know you love Javascript but I wonder if there are days when you hate it. Most importantly how do you deal with “Javascript churn”.
  2. The introduction of ES modules brought a much needed refresh to the ecosystem but we still have to deal with Common JS and AMD libraries. If I was a noob and I wanted to understand it all from it all started, how it got there and where we are now, what resource(s) would you point me to? And no, MDN doesn’t count, at least not for today. :slight_smile:
  3. Web Assembly. It was praised and promised, but it’s here now and intake is still a bit “meh”. Do you use it? What are your thoughts on it?
  4. If you or someone smart, came up with a language that used WebAssembly under the hood to the point of providing ease of use and superb performance(at both user and browser levels), do you think that would be enough to totally eliminate Javascript and wipe it off the face of the earth? If not what would prevent it? :slight_smile:

Thank you in advance for your reply.

Alvin

3 Likes

I have a question about TypeScript. It seems like interest in TypeScript continues to be strong-#5 in 2024. However, I’ve also heard rumblings from developers that TypeScript adds unnecessary complexity. Since you are working on a new TypeScript book (shhhhh🤐), how would you answer those nay-sayers?

3 Likes

Hey Alvin! Glad to be here too. Thanks for kicking things off with some great questions.

Yes, I do love JavaScript. But, oh man, the “JavaScript churn” you mentioned is real. New frameworks, tools, and patterns pop up faster than I can keep up, and sometimes it feels like you’re sprinting just to stay in place. Honestly, I try to focus on the core: understanding the language itself, its quirks, and how it ticks. That way, when the ecosystem shifts, I’ve got a solid base to adapt from. Also, I pick what makes sense for my projects. I don’t jump ship just because something is “hot.” Stability > hype.

For your second question: ECMAScript didn’t have built-in module support for a long time, so developers got creative. They used JavaScript’s existing features and clever workarounds to mimic modular patterns in their code. I think ES modules are great, but CommonJS and AMD are like guests who won’t leave the party.

Since you ruled out MDN, I’d point you to:

JavaScript: The Definitive Guide by David Flanagan for historical context
Axel Rauschmayer’s Exploring JS (his blog in general)
The Node.js documentation on modules, which explains how CommonJS and ESM coexist

I’ve played with WebAssembly, and it’s useful, very fast for heavy lifting like games, but its adoption is slow because most web developers don’t need it daily. It’s great for performance-intensive tasks, but for your average web app, JavaScript is still the easiest and most straightforward choice.

Could a WebAssembly-based language kill JavaScript? I think even if we had the perfect language that ran on WebAssembly, it wouldn’t outright replace JavaScript. Millions of devs, libraries, and websites run on JS. A new language would need insane tooling and compatibility to even dent that. Second, browsers are built around JavaScript. Changing that would be like rewiring the internet. I don’t think JavaScript’s going down without a fight.

Thanks for the brain food, Alvin!

2 Likes

Great question, Margaret! I get it, some devs feel like they’re wrestling with extra layers of rules when all they want is to ship code fast.

TypeScript’s “complexity” is really just a trade-off for confidence. Without types, you’re guessing what userData is supposed to be three functions deep. Is it an object? A string? A surprise undefined? TypeScript forces you to define that upfront, and yes, it’s more work at the start, but it saves you from debugging nightmares later.

According to the 2024 State of JS survey, 67% of respondents said they write more TypeScript than JavaScript these days!

That being said, it’s not the right fit for every project. If you’re just creating a tiny script, plain JavaScript might be all you need. Nothing wrong with that! But when your codebase gets bigger or your team starts growing, TypeScript’s structure can be a lifesaver. Is there a bit of extra complexity? Sure. But unnecessary? Not when it helps you avoid a whole lot of headaches later on.

2 Likes

Hi Faraz! I’m glad Alvin mentioned JS churn because it’s so hard keeping up with everything going on in the JS world, hence my question is related to this. I’m curious what you think are the ‘best’ tools or frameworks in the JS world right now? And do you have any favourites? :blush:

2 Likes

Hello again, Faraz. Thanks for the response(s).

More questions for you :slight_smile:

I’m curious as to your thought process and how exactly you think about or determine what constitutes: stability versus hype.

In my case, I look at:

  1. The foundation: is this thing tied to the language at its core, is it magic or fluff stuff?
  2. The ease of use. If it has a learning curve is the process of learning useful? Does the performance outweighs the investment of time.
  3. Then I look at the benefits. Is this better than what’s currently out there and if so by what margin.
  4. Long term: is this thing going to last or will it be discarded by something else.

I’m curious as to your thought process. Mine is flawed because I managed to miss the whole ES6, React JS wave because I misread it as a hype phase(thanks to Angular dying) and went with Ember JS. But I did manage to successfully avoid the build tool chaos that was gulp, grunt, broccoli, brunch and eventually webpack and I am so glad I did. :slight_smile: So what is your thought process and have you missed any wave yet in your career?

Thanks for the list. I’m looking at the first book now, funny enough I’d bookmarked the Exploring JS but taken a while before doing so. These are excellent, I’ll dodge the Node.js documentation for now, me and it(them) have some unresolved issues… :smile:

Hmmm. I don’t know, but this sounds like a perfect “weekend challenge” for you. Are you up to the task? :slight_smile:

Thank you as well for the response(s), Faraz!

2 Likes

Hi Aston,

React remains my favorite framework for front-end development because of its component-based model, which just feels right with how I like to build applications. The ecosystem is massive: there’s a library or tool for almost anything. The ability to integrate with tools like Next.js for SSR and Jest for testing is great.

However, I’m increasingly intrigued by Svelte, particularly after its Version 5 release, which introduced “runes” and “Snippets”. It’s compiler-based approach, which generates optimized JavaScript with no runtime overhead.

For tools, I gravitate toward Webpack despite its initial complexity. Once you get it set up, its power and customization options are hard to beat.

I like how TypeScript adds a layer of type safety that makes development more robust, especially for larger projects.

For back-end, Node.js with Express is hard to beat for its flexibility. :slight_smile:

2 Likes

Stability versus hype, to me, comes down to a mix of gut, evidence, and a bit of pattern recognition. I look at things like how often it breaks backward compatibility, who’s using it (big players or just loud startups?), and whether the docs are more than a hype page.

I think Ember was a reasonable pick at the time: stable, opinionated, not a bad bet if you value consistency. But yes, ES6 and React turned out to be more than hype because they solved real pain points and stuck around. The build tool chaos you dodged was peak hype: everyone throwing out half-baked tools, and webpack only won not because it was initially the most stable or well-designed, but because it aggressively absorbed features from other tools, gained widespread adoption, and outlasted the competition.

I totally ignored Docker for a while, assuming it was just ops folks showing off. Turns out containerization was a game-changer, and I had to play catch-up. Same with TypeScript. I dismissed it as JavaScript with extra steps until I saw how it scales in big teams. On the flip side, I dodged the NoSQL hype train when everyone was ditching SQL for MongoDB. Turns out, relational databases still rule for most of what I build.

Hmmm. I don’t know, but this sounds like a perfect “weekend challenge” for you. Are you up to the task? :slight_smile:

Alright, a new language to topple JavaScript. Sure, I’ll get back to you by Sunday! :joy:

3 Likes

It was then but the learning curve was/is crazy. I don’t think they’ve recovered from this aspect. Which is a shame because I really gave it my time and effort just like many others.

Same here. I got caught out too. But I think the passage of time enables us to enjoy tools without experiencing the burns and cuts that come from the growing pains of the tool itself. But that’s just my opinion.

It won for a time. Then got replaced because of the complexity. I get it that you love it, but man, it is literally something else… :confused:

I am so looking forward to this! Thank you in advance. I’ll ping you on Monday morning! :joy:

2 Likes

Hello everyone!

I’m your friendly Devtalk bot :nerd_face:

Thank you to all of you who participated in our Spotlight AMA!

This is now closed and all of those who commented above have been entered into the draw - meaning we’re now ready to pick a winner!

The process will be initiated when somebody clicks the special link below:

:arrow_right: :arrow_right: :arrow_right: Devtalk - Dev forum at Devtalk - the forum for developers! :arrow_left: :arrow_left: :arrow_left:

Don’t be shy, we need one of you to help make the magic happen! :sparkles:

1 Like

Thank you for initiating the draw process…

Entering the following members into the draw…

:arrow_down: :arrow_down: :arrow_down: :arrow_down: :arrow_down: :arrow_down: :arrow_down: :arrow_down:

2 Likes

And the winner is…

Drum roll…

2 Likes

Congratulations @alvinkatojr you are the chosen one!! We’ll be in touch about your prize via PM soon :smiley:

Thank you everyone who entered, and of course @Faraz for taking part in our Spotlight - thank you! :blue_heart:

2 Likes