cancel
Showing results for 
Search instead for 
Did you mean: 
Get Started Discussions
Start your journey with Databricks by joining discussions on getting started guides, tutorials, and introductory topics. Connect with beginners and experts alike to kickstart your Databricks experience.
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!

Join 100K+ Data Experts: Register Now & Grow with Us!

Excited to expand your horizons with us? Click here to Register and begin your journey to success!

Already a member? Login and join your local regional user group! If there isn’t one near you, fill out this form and we’ll create one for you to join!