News for hackers. Stuff that matters.
Re:TypeScript Features to Avoid by JohnHaugeland on Thursday January 20, 2022 @04:27PM (#30015306)
Symbol is an extremely heavy hammer. It's also difficult to use correctly.

What value do you think it offers here?

Re:TypeScript Features to Avoid by piaste on Thursday January 20, 2022 @07:59PM (#30017778)
I brought up symbols because ameliaquining's declared requirements match symbols to a T:

> I don't want to think about the question of runtime representation; I just want a set of arbitrary symbols that are different from one another.

I wouldn't know how such requirements translate into value for her. Personally, when I need a set of type-checked fixed values, I favour string literal unions because a readable runtime representation eventually comes in handy.

The only time I recall using symbols was in order to have a "newtype"-like construct, which is a different thing entirely.