HNHacker News
TopNewBestAskShowJobs

fleventynine

653 karma · joined October 19, 2015

submissionscomments
fleventynine··on Don’t mock what you don’t own
No tests can be better than a bunch of brittle mock object tests that don't test anything important. Thankfully it's very easy to delete them.

If changing one line of code regularly requires me to update mocks in 100 test cases, those test cases may have negative value.

fleventynine··on Had Enough, Eh? Come Back and Take What's Coming to You
Correlation is not causation. Without a proper randomized trial, these observations aren't worth much. The sort of people that keep their Tdap vaccination up to date likely do other things that reduce their risk (or are just in a better mental state than average).
fleventynine··on How to Make Rust Leak Memory (Also: How to Make It Stop)
The USB host controller does the polling in hardware. The cpu does not get involved until a key is pressed (the host controller can interrupt the cpu, telling it that new data is available).
fleventynine··on Monarch: Google’s Planet-Scale In-Memory Time Series Database
The histograms are useful on their own (visualized as a heatmap). If percentile lines are necessary (and they often aren't), I prefer to overlay them on top of the heatmap so it is clear where the bucket edges are.
fleventynine··on Unit Testing is Overrated (2020)
Some observations after using many different testing philosophies on many different teams in the past 20 years:

1. Unit tests for code with no side effects (code that takes well defined input and produces well-defined output) are easy to write, easy to understand, and I've never regretted writing them.

2. I've had good experiences transforming as much error-prone logic as possible into code with no side effects.

3. Integration tests that execute in an environment that is similar to production have proven to be incredibly valuable, especially when refactoring. When possible, I prefer to make technology-stack choices that make such an environment quick to setup and teardown such that these tests can run in seconds.

4. Many bugs occur because team A makes bad assumptions about how team B's system behaves, and they encode these assumptions into their (passing) test cases.

5. Unit tests with lots of mocks should be avoided; their cost-to-benefit ratio is terrible. Sometimes the best solution is to delete these tests. Relying on mocks for a few error-case tests that are hard to reproduce on the real system is ok.

6. If they cannot be avoided, fake implementations should be written by the same team that writes the real implementation. They understand how it actually behaves much better than their users, and are in a good place to reuse critical logic from the real implementation in the fake to make it more realistic.

7. If my project includes firmware running on custom hardware, building an emulator for the hardware that can run on standard computing infrastructure is valuable for writing test cases against.

8. More tests or coverage is not always better. We have a finite amount of time to improve our systems, and it is our duty as engineers to ensure that the benefit we get from adding a specific test-case is higher than using that time to make some other improvement to the project.

fleventynine··on I am a New York City public high school student. The situation is beyond control
More anecdotes that omicron infected patients are not a huge problem in highly vaccinated areas:

https://www.sfgate.com/bayarea/article/COVID-San-Francisco-s...

fleventynine··on I am a New York City public high school student. The situation is beyond control
https://www.thestar.com/news/gta/2022/01/11/are-you-for-or-w...

For what it's worth, I've been trying to find evidence of hospitals running out of ICU beds due to Omicron, but I'm not seeing it anywhere in North America, even in places that appear to have peaked. Staffing shortages due to quarantine policy seem to be a much bigger problem.

The vaccines really do seem to be working, and Ontario has a lot of vaccinated high risk folks compared to most US states.

fleventynine··on CSVCHAIN - NFTs backed by CSV technology
A marriage certificate that you bought from some random guy on the street and has no legal significance.
fleventynine··on I am a New York City public high school student. The situation is beyond control
It does say that, but I'm still skeptical. Shouldn't the total number of beds in use also be skyrocketing along with the Covid number?

Also:

""In ICU” numbers include people testing positive for COVID-19 and people who are in ICU for a COVID-19-related illness but have since tested negative."

It's not clear from the text that they are excluding people in the ICU with a positive test but are there for another reason.

fleventynine··on I am a New York City public high school student. The situation is beyond control
FYI: the number of ICU beds in use in Ontario has been trending down over the last 4 days:

https://covid-19.ontario.ca/data/hospitalizations#hospitaliz...

Over those same 4 days, a significantly increasing number of the folks in those beds are testing positive with Covid, but it's not clear to me whether that is the reason they're in the ICU. The hospitals need to provide better data about the reason these patients were admitted.

fleventynine··on This shouldn't have happened: A vulnerability postmortem
Incrementing an atomic counter every time a reference is copied is a significant amount of overhead, which is why most runtimes prefer garbage collection to reference counting (that, and the inability of referencing counting to handle cycles elegantly).

Rust doesn't rely on reference counting unless explicitly used by the program, and even then you can choose between atomically-reference-counted pointers (Arc) vs non-atomic-reference-counted pointers (Rc) that the type system prevents from being shared between threads.

fleventynine··on This shouldn't have happened: A vulnerability postmortem
I'm not super familiar with Swift, but I don't see how it could be memory-safe in a multi-threaded context without some sort of borrow checker or gc. So I think it is rejected by question #2.
fleventynine··on This shouldn't have happened: A vulnerability postmortem
If it can really guarantee single-digit microsecond pauses in my realtime thread no matter what happens in other threads of my application, that is indeed a game changer. But I'll believe it when I see it with my own eyes. I've never even used a garbage collector that can guarantee single-digit millisecond pauses.
fleventynine··on This shouldn't have happened: A vulnerability postmortem
By complicated I guess I mean "lots of types". Static typing makes up for its cost once I can't keep all the types in my head at the same time.

Point number 2 excludes pretty much all network-connected software, and that's intentional. I suppose single-player games are ok to write in C or C++.

fleventynine··on This shouldn't have happened: A vulnerability postmortem
My language selection checklist:

1. Does the program need to be fast or complicated? If so, don't use a scripting language like Python, Bash, or Javascript.

2. Does the program handle untrusted input data? If so, don't use a memory-unsafe language like C or C++.

3. Does the program need to accomplish a task in a deterministic amount of time or with tight memory requirements? If so, don't use anything with a garbage collector, like Go or Java.

4. Is there anything left besides Rust?

fleventynine··on Show HN: Security Camera Lens Calculator
It depends on your camera's low light sensitivity and how much noise you can tolerate. A cheap prime lens will let in an order of magnitude more light than a cheap kit lens. And some folks want that creamy bokeh effect behind them.
fleventynine··on Ask HN: Alternatives to Rust Programming Language
Ignore the drama. The language in its current state is great, and will survive bureaucratic spats.

Other languages may be more ergonomic or have more batteries included, but none of them can offer the holy grail of memory safety without garbage connection.

fleventynine··on US inflation jumps to 31-year high amid global supply chain crisis
We've had significant house price inflation for years due to insufficient supply. I want CPI to increase similarly, along with wages. If housing prices stay the same as today (in dollars) the house buying power of a young person will be much higher after the wage inflation. And because the dollar price of the house doesn't drop, today's mortgage holders won't find themselves underwater. Seems to me like the best we can do for both groups given the circumstances.

To make this happen we'd have to build new homes like crazy while keeping the interest rates low.

fleventynine··on US inflation jumps to 31-year high amid global supply chain crisis
In order for young people to have any chance at the same quality of life of their parents, the "real" value of housing needs to come down to at least 50% of the current value. The only way to accomplish this without wiping out those with mortgages is to have a large spike of inflation. It's painful, but likely necessary.
fleventynine··on New MacBook Pro has first ‘DIY-friendly’ battery replacement design since 2012
10GBASE-T is power hungry and unreliable, but dirt-cheap 10GBASE-LR and 25GBASE-LR transceivers work great up to 10km. If only they could figure out how to fit the transceivers into mobile-friendly packaging. But for a workstation they're great.
fleventynine··on The void in Calgary: How office towers emptied in a once bustling downtown
I worked in Calgary as a software engineer from 2000-2012 at various places, but never in big oil. At the time, a low cost of living, outdoor recreation opportunities, relatively young and healthy population, and good wages for engineers (compared to the rest of Canada) kept me there.

I left for a big-tech job in the bay area, but I still miss elements of the Calgary lifestyle. In particular, the insanely low mortgage payments compared to wages led to a feeling that I could feasibly bootstrap a business without taking a huge financial risk.

fleventynine··on Old iPhones become faster if you change the region to France
Fun the article:

"The GeekBench running score before changing the location to France is 286,632. However, after changing the location to France, the running score is 298,321."

I have a hard time caring about a 4% difference in performance.

fleventynine··on Interview with Jim Anderson, CEO of Lattice Semiconductor
Interfacing with CMOS image sensors, basic DSP, and transmitting uncompressed 4k video over 10G or 40G Ethernet.
fleventynine··on Interview with Jim Anderson, CEO of Lattice Semiconductor
Once we have a high quality "LLVM of digital logic", we have a great foundation for better high-level tools. It's just a matter of funding and motivation. In my dreams some Chinese FPGA upstart decides to invest huge in the open tools rather than negotiate with the current toolchain vendors...
fleventynine··on Interview with Jim Anderson, CEO of Lattice Semiconductor
Unfortunately, 10G serdes and >50kLUTs are table stakes to run the applications I have in mind...I think we're a long way from officially supported open toolchains for medium-size FPGAs.
fleventynine··on Interview with Jim Anderson, CEO of Lattice Semiconductor
If we could get similar momentum we have with gcc and LLVM behind projects like yosys and nextpnr, FPGAs would be much more useful and likely be a larger market overall.

I'm willing to personally donate 10k a year to projects like these to liberate myself from crappy vendor tools that I can't improve.

fleventynine··on A Burner Identity Protects Your Inbox, Phone, and Credit Cards
AwaaAaaaaaaaaaaaaaaa
fleventynine··on Ask HN: Go programming language is over ten years old. What do you think of it?
I don't hate it, but I don't love it either. For the projects I've used it with, it works fine up until I need some complex data structures, then it falls apart into bunch of runtime-casting-infected code. Also, I don't find that it makes threading less error-prone than a language like Java.

I've switched most of my personal projects over to Rust and so far I'm not looking back...

fleventynine··on How Can We Achieve Age Diversity in Silicon Valley?
I wonder how much of this discrimination is due to housing inequality. I suspect many young programmers resent paying $3500 a month rent to a landlord who bought their property for 75k 20 years ago. Denying jobs to that generation might be their way of fighting the perceived injustice.
← PreviousPage 7 of 7