Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Soooo many times in my career I've had to come back and "extract that variable into a function" that I just do it right away by force of habit.

Point is, this isn't trivial, it is the kind of thing that ends up saving work over the long haul.

Or include this in my agent 'rules' files.

GOOD EXAMPLE

query=f""" SELECT foo FROM {sometable} WHERE {condition} """ answer=spark.sql(query).toPandas()

BAD EXAMPLE

answer=spark.sql(f""" SELECT foo FROM {sometable} WHERE {condition} """).toPandas()



Consider applying for YC's Summer 2026 batch! Applications are open till May 4

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

Search: