Hacker News new | past | comments | ask | show | jobs | submit login

This smells very "clean code" to me:

- main.ts file contains multiple small functions

- tests test the same thing twice: once with a unit test, and once with an integration test

But those are minor pet peeves. My main one is: what is this, exactly? Neither the project itself nor the proposed combination of tools and directory structures show that this is somehow better or more sustainable than any other approach.




> main.ts file contains multiple small functions

It's purely demo code. I personally subscribe to the "modules should be deep" school of thought (Ousterhout).

> tests test the same thing twice: once with a unit test, and once with an integration test

Again, purely a demonstration that Playwright handles E2E, integration, and unit tests equally well, not an endorsement of testing the same thing twice. Note the absence of jest, mocha, etc.

> somehow better

Hopefully, you can achieve similar gains to [0], e.g. 50% less time to load and 95% less bandwidth in that case, by avoiding frameworks and other runtime dependencies.

> more sustainable

Hopefully, code produced this way is less susceptible to framework churn and other changes in the environment. Also, knowledge gained by following the approach will be about the standard web platform, not about a particular framework (and version thereof).

[0] https://github.com/morris/vanilla-todo




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: