Submission timeline
2007–2026One slot for every year since HN launched. Height is that year's peak points; orange marks a 100+ point or 50+ comment breakout. Select a bar to open its strongest thread.
First comments on top threads
HN comment orderThis is describing what I've known as "Typed Hungarian notation", and have seen a few times before, though I can't seem to find now. The original intent of Hungarian notation was to encode metadata into the variable name - for example, "validData = validate(rawData); showValidData(validData)". The idea was that the prefixes would make it just look wrong to the programmer if someone accidentally used mismatched names, such as "showValidData(rawData)", indicating a likely bug. This notation mutated into the far more…
I like how the author boils the idea down into a simple comparison between two alternative approaches to a simple task: getting the first element of a list. Two alternatives are presented: parseNonEmpty and validateNonEmpty. From the article: > The difference lies entirely in the return type: validateNonEmpty always returns (), the type that contains no information, but parseNonEmpty returns NonEmpty a, a refinement of the input type that preserves the knowledge gained in the type system. Both of these…
This principle is how pydantic[0] utterly revolutionized my python development experience. I went from constantly having to test functions in repls, writing tons of validation boilerplate, and still getting TypeErrors and NoneTypeErrors and AttributeErrors left and right to like...just writing code. And it working! Like one time I wrote a few hundred lines of python over the course of a day and then just ran it... and it worked. I just sat there shocked, waiting for the inevitable crash and…
This is very good advice and a great article. It comes up on this site now and then because of it. For those who don't necessarily program in statically typed functional languages: The idea transcends paradigms. You'll find very similar notions in 80's/90's OO literature, for example in Design by Contract. I'm sure one can dig deeper and find papers, discussions and specifications that go further back. I think TypeScript is often written in such a way where you refine…
The first top-level comment from each of the four biggest threads, in HN’s own order. Excerpts are shortened; open a comment for full context.
- Breakout years
- 5
- Total points
- 2042
- Total comments
- 997
100+ points or 50+ comments
reference only — not used in Hall rules or ranking
reference only — not used in Hall rules or ranking
Every submission
| Date | Title as submitted | By | Points | Comments |
|---|---|---|---|---|
| 2019-11-07 | Parse, Don't Validate | phonebucket | 31 | 4 |
| 2019-11-07 | Parse, Don’t ValidateFirst breakout · Best thread | undreren | 642 | 230 |
| 2021-02-11 | Parse, Don’t Validate | tambourine_man | 3 | 0 |
| 2021-03-19 | Parse, Don’t Validate | ducaale | 4 | 0 |
| 2021-06-26 | Parse, Don't Validate (2019) | melse | 389 | 270 |
| 2023-01-21 | Parse, Don’t Validate | lobo_tuerto | 2 | 0 |
| 2023-03-07 | Parse, Don't Validate (2019)Hall induction | declanhaigh | 398 | 219 |
| 2024-07-22 | Parse, Don't Validate (2019) | revskill | 321 | 102 |
| 2026-02-10 | Parse, Don't Validate (2019)Latest 20+ point return | shirian | 252 | 172 |
