acidbaseextract

Joined 10 years ago

Karma
576
Submissions
160
Member since
Aug 7
View on Hacker News

Recent submissions

Comment · 4 years ago
The normal way? You can implement whatever kind of index you like — b-tree index, bitmap index, hash index are all useful and conceptually simple if you're familiar with the backing data structures.

For example, if you want to index a "foreign key" id stored in each "record" in a JSON array of objects, you build a hash table from the FK id values to the JSON array indices of the objects that have that id. It can be as stupid simple as an `fk_index = defaultdict(set)` somewhere in your program, to use a Pythonism.

Now when someone wants JSON objects in that array matching a given FK id, they can just O(1) look in the index to know the position of records that match. Much better than an O(N) scan of every item in the array.

Of course you have to to maintain the index as writes to the JSON happen, but that's not bad once you understand how things work. No real secret sauce.

Comment · 4 years ago
I'm so sorry. Thank you for sharing your story.
Comment · 4 years ago
I don't regret putting it off until my 40s because it let me find a person I want to have a family with

Thank you for including this tidbit. I'm a man in my early 30s interested in having kids and recently discovered that I've poorly vetted my 5+ year SO's interest in having kids. Her "yeah, I'm hypothetically interested" has become "hard not interested".

The requirement to break up with her if I want kids is deeply painful, but the real source of my dread is the feeling that I won't then be able to find someone good in time. I'm very glad you found someone good to have a family with.

Comment · 4 years ago
I'll give you my answers to your questions as someone writing production JS/TS. Answering your questions is precisely illustrative of why hooks issues are hard to catch.

unexpected null/undefined values

This is an issue and has led to bugs. Switching to TS and making the compiler flag them fixed it.

mistyping variable or attribute names

Not an issue. Code obviously breaks if you have incorrect names.

using the wrong number of equal signs

This is an issue but causes few bugs. Linting generally catches it, though cute boolean punning still bites us.

failing to catch errors and handle rejected promises, etc.

This is an issue and has led to bugs.

Pretty much anything where there's some implicit details that the compiler or linters can't reason about programmers find a way to get wrong. One thing I like about the hooks linter setup is that what it encourages you to do by default will prevent most bugs, only lead to potential performance issues, unnecessary rerenders, unnecessary refetches.

Comment · 4 years ago
Comment · 4 years ago
Comment · 4 years ago
Wut? I just make websites man.

I don't want to be dismissive, but I hate deploying my applications for this reason. I'm an application developer. I'm not averse to infrastructure as code, and containerization, and I'm happy to do ops for my preferred stack. But I can't learn all this stuff too.

Comment · 4 years ago
Gassée also started Be Inc which created BeOS. Beyond being great in and of itself, BeOS was also slated to be the successor to Mac OS 9. If you're an operating system or file system nerd, you will find it very worth looking into BeOS. Gassée overplayed his hand and Apple's acquisition of Be Inc fell through.

Apple ultimately went with the NeXT / Steve Jobs combo, quite wisely, but for a long time there was a whole gang of BeOS fanboys lamenting that decision.

Comment · 4 years ago
Comment · 4 years ago
I've always had a soft spot in my heart for PHP style "raw query in the template". Even as we've moved away from that I feel like GraphQL recapitulates a lot of the reasons why having queries tightly bound to views is convenient.

It feels like "put the template in the query" is a great Uno reverse to "put the query in the template" and the associated issues it brings, but I'll have to think on the consequences more. Thought provoking article!

Comment · 4 years ago
The progressive C++ification of JS is scary and exciting in equal measure.
Comment · 4 years ago
It's been a long time since I was there, but I thought there were plenty of 15,000 call site refactorings done in a single final CL. Not that the Linux kernel should do the same!
Comment · 4 years ago
I don't know why you're getting downvoted. This seems like exactly the right move.
Comment · 4 years ago
Yeah, that little bit made my jaw drop. Package manifests in a format the language doesn't have stdlib support for is insane.

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton