|
|
|
|
|
by longrod
1358 days ago
|
|
If you are going for human readability then making your code expressive is the only way. Abstract away the code parts under a layer of very simply named functions/classes and boom! even a child will be able to understand what's going on. Obviously, that isn't always possible. I find this approach especially useful in writing e2e browser tests. You write an abstraction over the testing framework's (playwright, puppeteer etc) interaction and then use that in your tests. So instead of writing: await page.click(".play-button");
You do: await app.play();
This also has the benefit of extreme reusability. Doesn't work for everything though. |
|