AHA Programming

Rate this content
Bookmark
The video discusses the concept of AHA programming, which stands for 'Avoid Hasty Abstractions'. The speaker emphasizes the importance of avoiding premature abstractions to prevent code complications. They use a live-coded example to illustrate how abstractions can evolve and become problematic if not handled thoughtfully. The speaker mentions resources like testingjavascript.com and epicreact.dev, which offer valuable content for developers. They also highlight the significance of the blog post 'The Wrong Abstraction' by Sandy Metz. The talk provides practical advice on handling code duplication and making thoughtful decisions about abstractions. The speaker suggests reintroducing code duplication to identify commonalities before creating abstractions. They stress that duplication is often cheaper than the wrong abstraction and advocate for an iterative approach to coding.

From Author:

Are you the kind of programmer who prefers to never see the same code in two places, or do you make liberal use of copy/paste? Many developers swear the Don't Repeat Yourself (DRY) philosophy while others prefer to Write Everything Twice (WET). But which of these produces more maintainable codebases? I've seen both of these approaches lay waste to codebases and I have a new ideology I would like to propose to you: Avoid Hasty Abstractions (AHA). In this keynote, we'll talk about abstraction and how you can improve a codebase applying and creating abstractions more thoughtfully as well as how to get yourself out of a mess of over or under-abstraction.

This talk has been presented at React Summit Remote Edition 2020, check out the latest edition of this React Conference.

FAQ

AHA programming stands for 'Avoid Hasty Abstractions'. It is a programming principle that emphasizes the importance of avoiding premature and unnecessary abstractions, which can complicate code maintenance and scalability.

Kent C. Dodds is a well-known software engineer and educator who specializes in frontend development. He is particularly famous for his work on testing and React frameworks. Kent actively contributes to the JavaScript community through his educational websites like testingjavascript.com and epicreact.dev.

Testingjavascript.com is a website created by Kent C. Dodds that offers comprehensive resources and courses designed to teach various aspects of testing in JavaScript. The platform is intended to help developers master testing techniques to improve the reliability and maintainability of their code.

Epicreact.dev is another educational platform by Kent C. Dodds that provides a vast amount of content on React, including tutorials, courses, and other learning materials aimed at helping developers become proficient in React development.

Kent C. Dodds suggests being thoughtful about creating abstractions. He advises against creating unnecessary or premature abstractions and recommends allowing code duplications until a clear pattern or necessity for abstraction emerges, to avoid complicating the codebase.

According to Kent C. Dodds, 'The Wrong Abstraction' by Sandy Metz is a significant resource that discusses the pitfalls of inappropriate or premature abstractions in coding. The blog post emphasizes that sometimes the fastest way to correct a bad abstraction is to remove it and reintroduce code duplication, refining it only when necessary.

Kent C. Dodds emphasizes testing because it ensures that the code works as expected and makes it safer to maintain and refactor. Testing helps in catching bugs early in the development process and improves the overall quality and reliability of the software.

Kent C. Dodds
Kent C. Dodds
32 min
02 Aug, 2021

Comments

Sign in or register to post your comment.

Video Transcription

Available in Español: Programación AHA

1. Introduction to AHA Programming

Short description:

Hi, everyone. My name is Kent C. Dodds and I am super excited to be talking to you virtually. I'm excited to be talking with you about AHA programming. So go ahead and let's talk about avoid hasty abstractions, AHA programming. I've got some links in here that might be interesting to you. I've got a website on the World Wide Web. And, in particular, testingjavascript.com. If you haven't tried it already or looked at it, definitely give that a look. And epicreact.dev is going to be even bigger. Such a huge amount of content that will be available to you at epicreact.dev in the very near future.

Hi, everyone. My name is Kent C. Dodds and I am super excited to be talking to you virtually. I hope that you're all healthy and happy and doing well. And I'm excited to be talking with you about AHA programming. So go ahead and take your dry and your wet programming principles, set them to the side for a little bit and let's talk about avoid hasty abstractions, AHA programming.

So I've got some links in here that might be interesting to you. Unlike my slides. And I'm coming to you from Utah. I've got a wife and four kids and a dog and they're awesome. I've got a website on the World Wide Web. And, in particular, testingjavascript.com. If you haven't tried it already or looked at it, definitely give that a look. It'll teach you everything that I know about testing, which is not a small amount. And epicreact.dev is going to be even bigger. Such a huge amount of content that will be available to you at epicreact.dev in the very near future. So look forward to that. Take a look at the rest of this stuff later.

2. Introduction to Abstraction Life-cycle

Short description:

This is a live-coded, contrived example of the life-cycle of an abstraction. We're going to be considering what's important and why it's important to be thoughtful about an abstraction. It's like an actual example of a story told by Sandy Metz in this blog post, The Wrong Abstraction.

Let's go ahead and get into this. This is what we're going to be covering today. This is a live-coded, contrived example of the life-cycle of an abstraction. Hopefully you can relate to this, even though it's a little bit contrived. But I think that you'll enjoy it nonetheless.

And we're going to be considering what's important and why it's important to be thoughtful about an abstraction. And we're basically going to be taking this story... It's like an actual example of a story told by Sandy Metz in this blog post, The Wrong Abstraction, that I strongly advise you take a look at.

We're not going to be going through slides. Most of this is in my text editor here, and it's not passively consumable. So you need to decide right now whether you're going to be focusing on Twitter or on my talk. Because you won't be able to do both very effectively. So just choose. I'm not offended.

QnA

Available in other languages: