Hacker News new | past | comments | ask | show | jobs | submit login

If your data is not position-dependent a tuple doesn’t sound like the correct choice. In the price example you provided, a map would be much better.

As for how you know what’s in there - you should only know whether what’s relevant to your function is in there and not care about the rest of the world. For the former, tools like clojure.spec are helpful but ultimately good design helps the most (something that typed languages can often obscure).




> If your data is not position-dependent a tuple doesn’t sound like the correct choice.

That's kind of the problem though. Software is written by humans, and humans are fallible. We don't always make the correct choices. Also, there are economic pressures, deficiencies in specification, and changes in business requirements.

Personally, I believe businesses should accept the aforementioned reality and optimise for cost of change.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: