cancel
Showing results for 
Search instead for 
Did you mean: 
Get Started Discussions
cancel
Showing results for 
Search instead for 
Did you mean: 

Best code practices in coding Notebooks

KVNARK
Honored Contributor II

Hi All,

Good day!

Could you suggest some best code practices while coding in Databricks Notebooks.

3 REPLIES 3

-werners-
Esteemed Contributor III

Let me think:

  • do not repeat yourself aka create functions
  • use markdown! this is probably the most important one as it is one of the big advantages of using a notebook
  • try to use libraries (or .py files) to group code which is used often
  • use repos
  • and this is personal taste and perhaps controversial but use python or scala (not SQL)
  • and a lot of stuff I probably forget, but other people will add this 🙂

Debayan
Esteemed Contributor III
Esteemed Contributor III

Hi, in addition to the above comment, you can also refer SE best practises with notebooks: https://www.databricks.com/blog/2022/06/25/software-engineering-best-practices-with-databricks-noteb...

Anonymous
Not applicable

Hi @KVNARK .​ 

Hope all is well! Just wanted to check in if you were able to resolve your issue and would you be happy to share the solution or mark an answer as best? Else please let us know if you need more help. 

We'd love to hear from you.

Thanks!

Welcome to Databricks Community: Lets learn, network and celebrate together

Join our fast-growing data practitioner and expert community of 80K+ members, ready to discover, help and collaborate together while making meaningful connections. 

Click here to register and join today! 

Engage in exciting technical discussions, join a group with your peers and meet our Featured Members.