The hottest Substack posts of Vatsal’s Substack

And their main takeaways
1 HN point 20 Aug 23
  1. When changing values in a dictionary in Python, make sure the key exists to avoid KeyError.
  2. Using setdefault in Python eliminates the need to check if a key is present and sets its value if it doesn't exist.
  3. Method chaining and eliminating intermediate variables can make Python code cleaner and more efficient.
0 implied HN points 20 Aug 23
  1. Vatsal Patel is launching a Substack soon.
  2. The Substack link is vatsalpatel.substack.com.
  3. Share and subscribe for updates.
0 implied HN points 20 Feb 24
  1. In the early stages of a project, it's okay to duplicate code. This can help you experiment and try out different ideas without getting bogged down.
  2. Sometimes, trying to make code too simple can make it confusing. If making code DRY makes it hard to understand, a bit of repetition might be better.
  3. In situations where speed is crucial, duplicating code can actually improve performance. Sometimes, it's more important to focus on speed than to keep everything sleek and minimal.