David Suarez
Dec 18, 2021

--

Interesting article, but regarding this specific point. Are you then suggesting to cast the list into a set before checking the membership of an element to improve performance? (Not sure if that would improve much the performance tho, because the casting comes with a price…). If this is the case you should be a bit more clear in the article.

Otherwise it doesn’t make much sense to say that is an anti-pattern since as you well mention list and set are not interchangeable, set is useful only for when expecting unique values, and that doesn’t happen very often.

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

--

--

David Suarez
David Suarez

Written by David Suarez

Passionate about modern Cloud Data Engineering.

No responses yet

Write a response