JSJ 399:  Debugging with Async/Await with Valeri Karpov

JSJ 399: Debugging with Async/Await with Valeri Karpov

Valeri Karpov is a maintainer on Mongoose, has started a few companies, and works for a company called Booster Fuels. Today’s topic debugging with Async/Await. The panel talks about some of the challenges of debugging with Async. AJ, however, has never encountered the same problems, so he shares his debugging method. Valeri differentiates between .catch vs try...catch, and talks about why he prefers .catch. There are two ways to handle all errors in an async function without leading to an unhandled promise rejection. The first is to wrap the entire body of the async function in a try...catch, has some limitations. Calling an async function always returns a promise, so the other approach is calling .catch on the promise to handle any errors that occur in that function body. One of the key differences is if you return a promise within an async function, and that return promise is wrapped in a try...catch, the catch block won’t get called if that promise is rejected, whereas if you call .catch on the promise that the function returns, you’ll actually catch that error. There are rare instances where this can get tricky and unintuitive, such as where you have to call new promise and have resolve and reject, and you can get unexpected behavior.The panel discusses Valeri’s current favorite JS interview question, which is, “Given a stream, implement a function called ‘stream to promise’ that, given a stream, returns a promise that resolves to the concatenation of all the data chunks emitted by the stream, or rejects if the stream emits an error event.” It’s really simple to get this qustion right, and really simple to get it wrong, and the difference can be catastrophic. AJ cautions listeners to never use the data event except in the cases Val was talking about, only use the readable event.The conversation turns to the function of a readable event. Since data always pushes data, when you get a readable event, it’s up to you to call read inside the function handler, and then you get back a chunk of data, call read again and again until the read returns null. When you use readable, you are in control and you avoid piling functions into RAM. In addition, the right function will return true or false to let you know if the buffer is full or not. This is a way to mix imperative style into a stream.The next discussion topics are the differences between imperative style and reactive style and how a waits and promises work in a normal four loop. A wait suspends the execution of a function until the promise is resolved. Does a wait actually stop the loop or is it just transpiling like a promise and it doesn’t stop the loop. AJ wrote a module called Batch Async to be not as greedy as promise.all but not as limited as other options.The JavaScript panelists talk about different async iterators they’ve used, such as Babel. They discuss the merits of Babel, especially since baseline Android phones (which a significant portion of the population of the world uses) run UC Browser that doesn’t support Babel, and so a significant chunk of the population of the world. On the other hand, if you want to target a large audience, you need to use Babel.Since frameworks in general don’t handle async very well, the panel discusses ways to mitigate this. They talk about different frameworks like Vue, React, and Express and how they support async functions. They discuss why there is no way for you to actually cancel an async option in an actual case, how complex canceling is, and what you are really trying to solve for in the cancellation process. Canceling something is a complex problem. Valeri talks about his one case where he had a specific bug that required non-generic engineering to solve, and cancelling actually solved something. When AJ has come across cancellation issues, it’s very specific to that use case. The rest of the panelists talk about their experiences with having to cancel something. Finally, they talk about their experience with async generator functions. A generator is a function that lets you enter into the function later. This makes sense for very large or long running data sets, but when you have a bounded items, don’t complicate your code this way. When an async generator function yields, you explicitly need to call next in order for it to pick up again. If you don’t call ‘next’, it’s essentially cancelled. Remember that object.keys and object.values are your friends. Panelists
  • Christopher Buecheler
  • AJ O’Neal
  • Charles Max Wood
With special guest: Valeri KarpovSponsorsLinks Follow DevChatTV on Facebook and Twitter PicksAJ O’Neal:Christopher Buecheler:Charles Max Wood:Valeri Karpov:Special Guest: Valeri Karpov.

Support this podcast at — https://redcircle.com/javascript-jabber/donations

Privacy & Opt-Out: https://redcircle.com/privacy

Become a supporter of this podcast: https://www.spreaker.com/podcast/javascript-jabber--6102064/support.

Episoder(725)

Empowering Devs and Innovators: Inside Vercel’s Impact, Feature Flags, and the Rise of v0 - JsJ 674

Empowering Devs and Innovators: Inside Vercel’s Impact, Feature Flags, and the Rise of v0 - JsJ 674

In this episode, Lee Robinson, who works at Vercel, discusses the company’s impact on web development despite its relatively small size. He explains their approach to empowering small, founder-led teams to build impactful tools, highlighting their new open-source Flags SDK. They also discuss the importance of server-side feature flagging to improve performance and reduce UI shifts, while warning against exposing sensitive data through client-side experimentation. The conversation then shifts to Vercel’s internal innovation culture, particularly the development of v0, an AI-driven tool for building full-stack web applications quickly, which is especially accessible for non-developers with creative ideas.Become a supporter of this podcast: https://www.spreaker.com/podcast/javascript-jabber--6102064/support.

21 Apr 1h 22min

Building 50 Apps in 50 Days: The Power of Boring Stacks with Kelvin - JsJ_673

Building 50 Apps in 50 Days: The Power of Boring Stacks with Kelvin - JsJ_673

In this episode, we dive into an engaging conversation with Kelvin, where we explore his approach to full-stack JavaScript development and the power of using simple, stable technologies to speed up app development.Kelvin shares his exciting project, "Project 50," where he’s challenging himself to build 50 apps in 50 days, highlighting the importance of leveraging "boring" stacks to streamline the development process. We also touch on his journey in teaching web development through free resources and screencasts, aiming to make it easier for developers to build real-world apps quickly. Along the way, we discuss the value of strategy games like chess and Go, and how they help foster critical thinking and continuous learning. It’s a great mix of tech, strategy, and entertainment, making this episode a must-listen for developers and anyone looking to level up their skills. Tune in for a fun and insightful discussion!Become a supporter of this podcast: https://www.spreaker.com/podcast/javascript-jabber--6102064/support.

14 Apr 1h

Breaking Into Tech: Lessons from My Career Path - JsJ 672

Breaking Into Tech: Lessons from My Career Path - JsJ 672

This episode is a little different—thanks to a U.S. holiday, I’m flying solo. But that just means we get to have a one-on-one chat!I dive into my career journey—not to brag, but to offer insights for anyone feeling stuck, of how my inventor grandfather sparked my early interest in tech, how I transitioned from electrical engineering to computer engineering, and how I went from IT support to discovering my love for programming while solving real-world problems at Mosey with Ruby on Rails.Become a supporter of this podcast: https://www.spreaker.com/podcast/javascript-jabber--6102064/support.

7 Apr 44min

Pioneers of Computing: A Journey Through Tech History with Bob Martin - JsJ 671

Pioneers of Computing: A Journey Through Tech History with Bob Martin - JsJ 671

In this episode, we dive into a fascinating mix of tech history, personal stories, and entertainment recommendations. We chat with Bob Martin, who shares insights from his new book, offering a look back at the pioneers of computing, including early breakthroughs and the industry's evolution. Bob talks about the challenges of leaving out influential figures like Margaret Hamilton, Donald Knuth, and Linus Torvalds, while also reminiscing about his early career as a self-taught developer during the 70s.The conversation takes a fun turn when we discuss some mind-blowing tech feats, including a wild project where Doom was implemented using TypeScript’s type system—a true demonstration of the power of programming languages. For those into entertainment, we share some great picks, like the classic science fiction novels When Worlds Collide and After Worlds Collide, plus a rundown of TV shows like Reacher and the intriguing comparison between the Expanse books and TV show. Packed with history, tech talk, and plenty of geeky fun, this episode is a must-listen for anyone interested in the past, present, and future of computing!Become a supporter of this podcast: https://www.spreaker.com/podcast/javascript-jabber--6102064/support.

1 Apr 1h 9min

Beyond Aesthetics: What the Next Generation of Frameworks Should Offer - JsJ_670

Beyond Aesthetics: What the Next Generation of Frameworks Should Offer - JsJ_670

In this episode of JavaScript Jabber, our host Charles Max Wood, panelist Dan Shappir, and special guest Yoav Abrahami, CTO of Wix Enterprise, engage in a fascinating discussion on the evolving landscape of web frameworks. They dive into the functional and nonfunctional requirements of frameworks, the emerging innovations in meta frameworks, and the significant market shifts driven by increasing regulations and AI advancements. Yoav shares insights into his work on creating a collaborative web framework aimed at bridging the gap between designers and developers, while also addressing crucial future trends in security and design-to-code capabilities. Tune in to explore the dynamic future of web development with insights from industry leaders.Become a supporter of this podcast: https://www.spreaker.com/podcast/javascript-jabber--6102064/support.

6 Mar 1h 15min

A Guide to AI Models: From Tokenization to Neural Networks with Ishaan Anand - JsJ_669

A Guide to AI Models: From Tokenization to Neural Networks with Ishaan Anand - JsJ_669

In this enlightening episode of JavaScript Jabber, hosted by Charles Max Wood and Steve Edwards, panelist AJ O'Neil is joined by guest Ishaan Anand to delve deep into the intricacies of AI and large language models. Ishaan, an expert with over two decades of experience in engineering and product management, shares insights into his innovative implementation of GPT-2, providing a comprehensive breakdown of how transformers work in AI. The discussion covers various aspects of AI, including how models predict the next word, the concept of tokenization, embeddings, and the attention mechanism which is central to transformer architectures. Listen in as they explore practical applications, challenges, and the evolving landscape of AI, with a special emphasis on mentorship and education through Ishaan's unique course offering. Whether you're an AI aficionado or a JavaScript developer eager to expand your knowledge, this episode offers valuable perspectives and learning opportunities.Become a supporter of this podcast: https://www.spreaker.com/podcast/javascript-jabber--6102064/support.

21 Feb 1h 38min

Exploring ReactScan: Aiden Bai's Tool for Identifying React Performance Issues - JsJ 668

Exploring ReactScan: Aiden Bai's Tool for Identifying React Performance Issues - JsJ 668

In this episode of JavaScript Jabber, panelist Dan Shappir sits down with guest Aden Bai to delve into the nuances of React performance. Broadcasting from Tel Aviv, Dan welcomes Aden, who is based in San Francisco, for an insightful discussion on optimizing React apps. Aden, known for his projects Million JS and ReactScan, shares his journey into coding and his focus on enhancing web performance. Together, they explore the intricacies of the virtual DOM, React rendering processes, and the common pitfalls that developers face in managing performance. Aden introduces ReactScan, a tool designed to visualize and troubleshoot performance issues in React applications, making complex profiling accessible to a broader range of developers. The conversation also touches on broader performance metrics like Core Web Vitals and the challenges of maintaining efficiency across various devices and browsers. Whether you're a seasoned developer or new to React, this episode offers valuable insights into creating faster and more efficient web applications. Tune in to learn how you can improve your React project's performance and user experience with tools and techniques from top industry experts.Become a supporter of this podcast: https://www.spreaker.com/podcast/javascript-jabber--6102064/support.

13 Feb 1h 7min

TanStack: A Deep Dive into Server Functions and Routing with Tanner Linsley - JsJ 667

TanStack: A Deep Dive into Server Functions and Routing with Tanner Linsley - JsJ 667

In this episode of JavaScript Jabber, host Steve Edwards is joined by panelists Dan Shappir and AJ O'Neil, along with special guest Tanner Lindsley, to explore the innovative world of TanStack, a collection of open-source libraries designed to enhance web development. Tanner shares insights into the origins and evolution of TanStack, highlighting its journey from simple libraries like React Table to a comprehensive toolkit including TanStack Query, TanStack Virtual, and more. The discussion delves into the nuances of building framework-agnostic tools, the challenges of server-side rendering, and the rise of remote procedure calls (RPCs) as a modern development approach. With intriguing debates on the future of meta frameworks and the role of server components, this episode provides a deep dive into the cutting-edge technologies shaping the development landscape. Whether you're a fan of React, Solid, or just curious about the direction of web frameworks, this conversation offers valuable insights and expert opinions on the current and future state of web development. Tune in to discover how TanStack is influencing the way we build and manage applications in the ever-evolving JavaScript ecosystem.Become a supporter of this podcast: https://www.spreaker.com/podcast/javascript-jabber--6102064/support.

6 Feb 1h 29min

Populært innen Business og økonomi

stopp-verden
dine-penger-pengeradet
e24-podden
rss-penger-polser-og-politikk
rss-borsmorgen-okonominyhetene
livet-pa-veien-med-jan-erik-larssen
finansredaksjonen
utbytte
tid-er-penger-en-podcast-med-peter-warren
pengesnakk
pengepodden-2
stormkast-med-valebrokk-stordalen
morgenkaffen-med-finansavisen
rss-sunn-okonomi
rss-markedspuls-2
aksjepodden
lederpodden
rss-helt-ra
okonomiamatorene
rss-impressions-2