Preferences

I haven’t written a complicated library so I’m just guessing, but something as general as a form builder is probably so jam-packed with edge cases and configurability that I’d guess the types need to be that complex in order to be accurate.

I think it’s an inevitable trade off: the safer and more specific you want your type inference to be, the more inscrutable your generics become. The more accurately they describe complicated types, the less value they serve as quick-reference documentation.

Which makes me think the types are not the problem, it’s the lack of quick reference documentation. If a complicated type had a little blurb that said “btw here are 5 example ways you can format these args”, you wouldn’t need to understand the types at first glance. You’d just rely on them for safety and autocomplete


This item has no comments currently.

Keyboard Shortcuts

Story Lists

j
Next story
k
Previous story
Shift+j
Last story
Shift+k
First story
o Enter
Go to story URL
c
Go to comments
u
Go to author

Navigation

Shift+t
Go to top stories
Shift+n
Go to new stories
Shift+b
Go to best stories
Shift+a
Go to Ask HN
Shift+s
Go to Show HN

Miscellaneous

?
Show this modal