HNHacker News
TopNewBestAskShowJobs

mehagar

124 karma · joined November 20, 2019

submissionscomments
mehagar··on Some thoughts on LLMs and software development
How could you possibly plan out "everything" in advance? Code itself would be the only way to explicitly specify the "everything".
mehagar··on React Still Feels Insane and No One Is Talking About It
Yes, the original set of web technologies was simply not designed with the kinds of interactive UIs people expect today.

Perhaps in the future UIs can be rendered with WASM, with the common rendering libraries being distributed as a separate WASM module (so users would not have to repeatedly download large files)?

mehagar··on React Still Feels Insane and No One Is Talking About It
More likely they don't even need to use useMemo if it's not an expensive calculation. They can just calculate the dependent values during rendering, which is explained in the docs: https://react.dev/learn/you-might-not-need-an-effect#updatin...

If `getLinkedCats` calls an external API, then the calculation can instead be all in the same useEffect.

The number one mistake I see people inexperienced with React doing is using too many useEffect's in their code, which is both hard to read and hurts performance, since it results in more renders than necessary.

mehagar··on Shift Left Is the Tip of the Iceberg
More broadly it includes moving activities that are normally performed at a later stage so that they are earlier in the process. The idea is that defects found later in the process are more costly.
mehagar··on How to test without mocking
Unit tests should be independent of the environment they are run in, and pass or fail consistently. Otherwise, it is not a unit test.
mehagar··on How to test without mocking
Unit testing proves correctness in regard to the test written (not necessarily the correctness of the application itself). They're similar in that they are both typically fast to run, and that they check an aspect of the program for correctness.
mehagar··on How to test without mocking
I like the testing pyramid specifically because it captures the tradeoffs between the different kinds of tests. Mocks can come in handy, but like anything else can be abused. We need a "Mock this, not that" kind of guide.
mehagar··on How to test without mocking
On that topic, static type checking can effectively be seen as a "unit test" that tests as well as documents the expected types for an interface.
mehagar··on How to test without mocking
That reminds me that Stripe actually maintains (or used to) their own mock for their Ruby package. This puts the burden on maintaining the mock on the library owner, where it is more likely that they would implement the mock correctly, edge cases and all.
mehagar··on How to test without mocking
I agree that if you need to write mocks, it's likely that your interfaces are poorly defined. This is one of the claimed benefits of test driven development - writing the tests first forces you to design the code in a way that cleanly separates modules so they can be tested.
mehagar··on How to test without mocking
The catch-22 with refactoring to be able to write unit tests is that refactoring introduces risk as you are changing code, and you need tests to help reduce that risk. But you can't easily write tests without refactoring. This has been a very difficult problem for the team I'm currently on.

The only strategy I'm aware of is described in `Working Effectively With Legacy Code`, where you start by writing throwaway unit or E2E tests that give you "cover" for being able to refactor. These tests depend on the implementation or may use mocking just to get started. Then you refactor, and write better unit tests. Then get rid of the throwaway tests.

mehagar··on Just Enough Software Architecture (2010)
Clean Architecture and Fundamentals of Software Architecture: An Engineering Approach.
mehagar··on WebSockets vs. Server-Sent-Events vs. Long-Polling vs. WebRTC vs. WebTransport
WebSocketStream is about to ship in Chrome, which adds backpressure: https://chromestatus.com/feature/5189728691290112
mehagar··on Deno 1.39: The Return of WebGPU
See also Web Neural Network API: https://www.w3.org/TR/webnn/
mehagar··on Replacing WebRTC: real-time latency with WebTransport and WebCodecs
An additional benefit of WebTransport over WebRTC DataChannels is that the WebTransport API is supported in Web Workers, meaning you can send and receive data off the main thread for better performance.
mehagar··on Replacing WebRTC: real-time latency with WebTransport and WebCodecs
It's being worked on now: https://github.com/WebKit/WebKit/pull/17320
mehagar··on Ask HN: How to switch software engineering domains
Does your current company have any lower level positions open? It may be easier to switch internally.
mehagar··on DevOps Is Bullshit (2022)
The keyword is self-service. Instead of engineers filing tickets that say "please deploy my application", you have a dedicated team create an internal web app or something that lets engineers deploy their application themselves, but minimizes the risk (compliance, security, stability, etc.) associated with that deploy.

This approach scales because it doesn't create a queue in front of ops.

mehagar··on DevOps Is Bullshit (2022)
Rather than developers not wanting to do ops, I took the article to mean that

- ops is sufficiently complex - The incentive to deliver features means that ops corners tend to be cut

So the suggestion is to build a self service platform that encapsulates the complexity, while making it easier for developers to use.

mehagar··on Lehman’s Laws of Software Evolution
https://www.hyrumslaw.com/
mehagar··on Always use Zoom in a browser. Avoid the app (2020)
Check out https://chrome.google.com/webstore/detail/xoom-redirector/oc...
mehagar··on Zoom is adding email and calendar features to take on other workspace platforms
They're implementing that as part of their calendar service: https://youtu.be/Dw1HiYxl7CE?t=7920
mehagar··on I have complicated feelings about TDD
I think TDD is great in the ideal, but in reality I have only worked on legacy systems where TDD was not practiced from the start. Such systems are hard to fit TDD style tests into because modifying existing code often requires large refactoring to properly inject dependencies and create seams for testing. The catch-22 is that refactoring itself is prone to breaking things without sufficient testing.

As a result, I often try to fit my tests into these existing systems rather than starting with the test and refactor the code under test to fit that shape. The only resource I've seen for dealing with this issue is the advice in the book "Working Effectively with Legacy Code", to write larger system tests first so you can safely refactor the code at a lower level. Still, that's a daunting amount of work when it's ultimately much easier for me to just make the change and move on.

mehagar··on I have complicated feelings about TDD
You make a good point about not being able to enforce that TDD is actually followed. The best we could do is check that unit tests exist at all.

In theory, if TDD really reduces the number of bugs and speeds up development you would see if reflected in those higher level metrics that impact the customer.

mehagar··on You have only so much time – are you using it right?
"Right" implies there is some objective authority who could tell you whether you are using your time the correct way or not. Thinking about spending time this way leads me to feel guilty (I'm not spending it the right way!).

The question I ask myself is "what do I want?". It is a tough question. I consider my present and future needs, as well as how I feel. When I have thought about my answer, then it becomes clearer how I want to spend my time.

mehagar··on Zoom: Remote Code Execution with XMPP Stanza Smuggling
Check out https://github.com/arkadiyt/zoom-redirector. You can also join meetings from https://pwa.zoom.us/wc/.
mehagar··on Moderation in Infrastructure
I understand that you're very angry about the situation. A lot of things Trump has made me angry. I'd like to express my anger in a way that doesn't involve trying to make others feel ashamed about their own actions or beliefs. It's not easy - it's very much part of our culture to call each other names and judge others as good or bad.
mehagar··on Snyk: Find and fix vulnerabilities in open-source dependencies
They use a different vulnerability database. Snyk's contains vulnerabilities that NPM's doesn't have, and vice versa. We're using them both in combination.
mehagar··on Ask HN: Do Developers Use TDD?
Was a .NET programmer a year ago. Tests regularly took more than several seconds to run, so it wasn't feasible - the feedback loop was too high.

I'm a web developer now (Ruby on Rails), and I rarely do TDD. The feedback loop is quicker, but I still end up not doing it, and feel guilty for it.

mehagar··on People that think you’re an asshole
I feel a strong need to be accepted by other people, and one of the ways that I meet that need is by considering how my actions ("taking the leap") might affect others. Sometimes, though, I place more value on others' needs than my own. This can lead to sadness that I'm not able to do what I want.

This author seems like he wants to overcome this fear of how others may respond, and do the thing anyway. I'm reminded of the stages of emotional liberation:

First stage: Emotional slavery: we see ourselves responsible for others’ feelings.

Second stage: “Obnoxious”: we feel angry; we no longer want to be responsible for others’ feelings.

Third stage: Emotional liberation: we take responsibility for our intentions and actions.

[1] - https://about-nvc.tumblr.com/post/98642157391/from-emotional...

← PreviousPage 2 of 3Next →