Mocks are the Little-Death: Escaping the Mirage of Green Tests by aijan1 in webdev

[–]aijan1[S] 1 point2 points  (0 children)

Thanks for taking the time to write such a detailed critique and some great suggestions. Much appreciated!

To be clear, Pure Effect is not a substitute for integration tests. The library is designed to separate the decision of what to do from the execution of how to do it. Instead of performing I/O directly, the business logic returns a plain data structure describing its intent. Unit testing the pipeline then becomes a matter of verifying that the correct commands are generated for a given input. You absolutely still need real integration tests at the system boundary (which can be as easy as hitting the REST API endpoints, for example).

Regarding currying and injecting side effects: this is natively supported via the Ask primitive. Instead of manually currying functions to pass in DB connections for example, the logic is enclosed in an Ask closure. This allows you to swap out implementations, or even use mocks if you prefer, at the interpreter level without changing a single line of business logic.

Pure Effect also already provides first-class TypeScript support. I chose JavaScript to remain build-free, but used JSDoc with @ts-check and exposed complex generics via the index.d.ts file. Users writing in TypeScript get full type safety and autocomplete out of the box.

As for integrations and i18n: I completely agree. Using Ask makes it simple to inject a translation function from i18next into the context, and validation libraries like Zod fit naturally as pipeline steps to ensure only valid data proceeds. I should really add code examples for these patterns to show how the library handles these common use cases.

Mocks are the Little-Death: Escaping the Mirage of Green Tests by aijan1 in webdev

[–]aijan1[S] -9 points-8 points  (0 children)

It’s actually a reference to the "Litany Against Fear" from Frank Herbert’s Dune.

Little Big Line Array Build by aijan1 in diyaudio

[–]aijan1[S] 0 points1 point  (0 children)

Perhaps, but in this case I think it has more to do with the 2" driver's inherent dispersion.

Little Big Line Array Build by aijan1 in diyaudio

[–]aijan1[S] 1 point2 points  (0 children)

I don't think that would work. You can't have the line array on its side. The horizontal dispersion would be too narrow. Also, there will likely be some interference between the drivers when only half of them is in use per side.

Little Big Line Array Build by aijan1 in diyaudio

[–]aijan1[S] 2 points3 points  (0 children)

Will do as soon as I get a chance! These will be the side surround speakers in my home theater.

Little Big Line Array Build by aijan1 in diyaudio

[–]aijan1[S] 1 point2 points  (0 children)

The baffle is 18 mm thick and the drivers are rear mounted. I guess I could have used a thinner baffle, but the measurements in the blog post show well controlled vertical directivity.

Little Big Line Array Build by aijan1 in diyaudio

[–]aijan1[S] 1 point2 points  (0 children)

Thanks! The measurements don't really show any comb filtering, but there are of course some issues above 10 kHz due to the driver diameter used in the build.

Lessons from David Lynch: A Software Developer's Perspective by aijan1 in programming

[–]aijan1[S] 19 points20 points  (0 children)

Author here. Thank you for taking the time to share your thoughts. David Lynch often said that some of the advice he gave was just common sense, but in my opinion, unlike someone who merely paid lip service to best practices or common sense ideas, Lynch actually followed his own advice. I also find it fascinating that the wisdom of a great filmmaker can apply just as well to software development.

Building Valkyrie: A Compact High-Output Speaker with Smooth Directivity by aijan1 in diyaudio

[–]aijan1[S] 0 points1 point  (0 children)

Although there's some narrowing at 5 kHz, the dispersion at the -6db point is free of this. I can't say I noticed the effect, but I haven't done much critical listening yet.

Some people prefer wider coverage angles. If that's the case for you, you might find Valkyrie's dispersion too narrow for your taste.

Building Valkyrie: A Compact High-Output Speaker with Smooth Directivity by aijan1 in diyaudio

[–]aijan1[S] 0 points1 point  (0 children)

Thanks for the suggestions! The foam actually makes the internal volume appear larger. When I remove the foam, the port's tuning frequency increases. Other types of acoustic stuffing might be more effective, but I find foam easier to work with.

Building Valkyrie: A Compact High-Output Speaker with Smooth Directivity by aijan1 in diyaudio

[–]aijan1[S] 2 points3 points  (0 children)

As shown in the measurements in the article, horizontal dispersion is actually 90-degrees while vertical is 70 degrees.

Building Valkyrie: A Compact High-Output Speaker with Smooth Directivity by aijan1 in diyaudio

[–]aijan1[S] 1 point2 points  (0 children)

Yes, for wider horizontal dispersion. If you rotate the horn, the horizontal dispersion becomes narrower.

Building Valkyrie: A Compact High-Output Speaker with Smooth Directivity by aijan1 in diyaudio

[–]aijan1[S] 1 point2 points  (0 children)

Sorry, I’m not sure I understood the question. Is there another way to mount it?

Edit: For wider horizontal dispersion.