Posts

Showing posts from January, 2026

Parse, don't validate

This is common lore that experienced programmers have long understood. When working with data types, strongly avoid free-form types like `str`, `string` or integers. Instead, prefer types that say what they are and can't be misinterpreted. This lore is compacted into "Parse, don't validate". A typical example is: should a column name be "str" or a ColumnName type? The answer is always the latter. The reason being that it's easy to locate all places in your codebase where a ColumnName is used. If you'd used str instead, the battle is already lost. If you're writing AI Assisted Python, there's little to no way that you'll be able to do any reasonable refactor once this pattern is well set in the codebase. Therefore, use your language's type system, use the types and avoid bare types like int, long and str as your fundamental code layers build up.

10 years of ML at Pinterest: it’s been good to be a part of it

Image

Critical days in my life

1988 - My year of birth. 2006 - Graduated school, went to IIT-Roorkee. My friends wrote me a spiral bound notebook. 2010 - Came to the US for the first time to Qualcomm 2011 - Came to the US for the second time with Google 2013 - Bought my first car 2015 - Married my wife 2017 - Bought a home 2020 - Dhruv is born. 2023 - Viraj is born Nov 30, 2023 & Dec 2, 2023 - Enlightenment Jan 12, 2024 - Last day of enlightenment. I wrote a spiral bound notebook. 2024 - Left Pinterest 2025 - Founded Nettle

23 TB on a laptop

Image
  In 75 days, my laptop has processed about 23 TB of data. Not bad for a laptop. A terabyte used to be a lot of data some time ago.