48
No more code headers?
(midwest.social)
Welcome to the main community in programming.dev! Feel free to post anything relating to programming here!
Cross posting is strongly encouraged in the instance. If you feel your post or another person's post makes sense in another community cross post into it.
Hope you enjoy the instance!
Rules
Follow the wormhole through a path of communities !webdev@programming.dev
Your friend may have a point.
It depends where the SQL is.
Is the SQL in a data model in an analytics platform? Some platforms will happily carry comments around like last week's pizza during query generative phases of visualization, so it may not be appropriate to put comments inside a data model, as those comments could become bugs if the analytics platform is lame, like most are.
Others, certain flavors of SQL DDL (Tables, views, etc), comments outside the DDL don't make it inside the resulting object, so headers may not be the right place either. Most RDBMS have meta-descriptors that can apply to DDL so those might be good to look at.
For arbitrary SQL, outside a brief inline comment describing why it exists, and what invokes it, your next best bet may be a link to a more descriptive data architecture diagram that shows how this unit of SQL integrates with others. You might prefer hyperlinked descriptions from that data architecture over searching thru code.
As long as comments don't require continual parsing (a one-time tax is inconsequential), definitely add details that you have figured out so others don't have to re-learn the tribal mysteries of long-deceased ancients.