Hacker News new | ask | show | jobs
by wa1987 2082 days ago
Related video on this subject: https://www.youtube.com/watch?v=IcgmSRJHu_8
1 comments

I thought about that video today when integrating with an old SOAP API. I need to find the name+some property of some persons. Instead of having a list with [(name1, prop1), (name2, prop2),...], I get two distinct lists of [name1, name2,..] and [prop1, prop2,..]. In practice I think the lists will always match. But there is nothing stopping them from not being the same length, or even worse: one having a gap..
Put an assertion. It's better to throw early rather than dealing with wrong data later.