HN user

kipple

295 karma

Funny place this space.

Posts2
Comments86
View on HN

The actionable tip here is to start with the data. Try to reduce code complexity through stricter types on your interfaces or databases. Spend extra time thinking through the data structures ahead of time.

This is why I love TS over JS. At first it feels like more work up front, more hurdles to jump through. But over time it changed how I approached code: define the data (& their types) first, then write the logic. Type Driven Development!

Coming into TS from JS, it might feel like an unnecessary burden. But years into the codebase, it's so nice to have clear structures being passed around, instead of mystery objects mutated with random props through long processing chains.

Once the mindset changes, to seeing data definition as a new first step, the pains of getting-started friction are replaced by the joys of easy future additions and refactors.

I hate the Apple/Google text message incompatibility — but I can't argue with the results... I switched from Android to iPhone after years of my friends complaining about me degrading our group chat experience.

I was stubborn at first, but some messages would get sent out of order or dropped altogether, and finally I succumbed to the pressure.

I came from a centralized store background — and honestly I'm falling in love with the decentralized data responsibilities. Between React Query (fetch batching & caching) and Jotai (decentralized state) I love that every component can just take care of itself. No more prop-drilling, everyone just declares their dependencies and takes care of their own.

The # sigil has always bummed me out too.

Supposedly it's because of this:

Why isn't access this.x?

Having a private field named x must not prevent there from being a public field named x, so accessing a private field can't just be a normal lookup.

https://github.com/tc39/proposal-class-fields/blob/main/PRIV...

Combined with this:

Why aren't declarations private x?

This sort of declaration is what other languages use (notably Java), and implies that access would be done with this.x. Assuming that isn't the case (see above), in JavaScript this would silently create or access a public field, rather than throwing an error. This is a major potential source of bugs or invisibly making public fields which were intended to be private.

https://github.com/tc39/proposal-class-fields/blob/main/PRIV...

But I still think it's weird.

I agree, and I think there's another aspect too: the fragmentation of Android.

The "true Google" phones (Pixel) with their "true Android OS" are great. But there's so many other manufacturers, and so many other flavors of Android, that it can't help but feel like an ocean of knockoffs.

Apple feels so pure and clean in comparison.

Agreed. I think it itself could've been split into two books, and could easily merit a sequel or two.

But I suppose wanting more is better than the opposite?

FWIW I picked up & put down Anathem a few different times before it "clicked" for me — the made up words made it hard to get into at first. But now it's one of my favorite Stephenson novels.

A less-steep place to start with him might be:

- Snowcrash

- The Diamond Age

- Seveneves

Hah! I came here to recommend Blindsight. "vampires in space" sounded silly, but it was unexpectedly intelligent and creative — some real mind-opening perspectives on consciousness.

Meanwhile, I've read every Neal Stephenson & William Gibson book multiple times... anyone have suggestions for other authors to read, before I just loop again?

The point was that, though the article suggests loneliness stems from being unable to describe your feelings simply and concisely, it is more complex than that.

I think the point we're all trying to make is that a text barrage is _not_ expressing yourself simply and concisely.

I sent my SO a long string of text messages about a problem that I was having, including one of them that said "I feel like garbage."

Is it possible you buried the lede? I'm a fellow sender of long strings of text messages. I've found that not everyone appreciates my potentially sprawling/parallel communication style. They don't always have the time or capacity to pick through all my words and respond thoughtfully to each point.

I used to take it personally, until I realized I was just being overwhelming. Now, if one thing in particular matters to me, I focus on communicating that one thing. I leave the rest on the back burner for more casual conversation.

There's a couple reasons I personally don't find front-end unit tests valuable:

1. (In my experience) client code is mostly integration: it's integrating local user interactions and remote data APIs into a stable experience. It's rare that bugs come from an idempotent function with a clear I/O that can be unit tested — it's much more likely that bugs come from something like an unexpected API response or a complex combination of user states.

2. TypeScript. Static typing obviates a good chunk of the low-hanging unit tests. And it addresses your point here:

But I think the point that gets lost on people is that the value of unit tests isn't chiefly the output of running the test suite. It's that the process of writing good unit tests forces you to write well-structured code.

Strict TypeScript (+ ESLint) also does wonders to encourage well-structured code, such as making it hard to have a mystery object passed around your app, collecting new properties as it goes. That mystery object would need a type definition, and would be easier to deal with as a series of discrete states instead of an amalgamation of mutations. Types encourage clear structures and interfaces for your code.

With all that, I'd rather focus my time on type safety + integration tests.

The author! Hello

Bear in mind I'm talking about someone trying to learn something. If they don't know TS you're expectng them to boil code they don't understand down to its essence.

I agree with this, but only for people who are new to the JS language, and the content targeting them.

People using JS regularly should be able to separate out TS noise, and asking the world to avoid TS for _every_ piece of knowledge content sounds like hyperbole.

In regards to the jQuery comparison, I'm not suggesting that someone would ask such a question of TS. All I'm saying is that there was an expectation that everything should be done in jQuery at the time.

Then why include it in your argument?

TypeScript has a steep learning curve

Does TS have a steep learning curve, or just a steep config curve? I personally feel that once a project has TS up & running, the actual use of it can be straightforward. Inference is so good these days, you shouldn't see many actual types at all in your code.

Have I just been using it too long, and I've forgotten the initial pain?