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
Databricks Employee
Databricks Employee

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!

Connect with Databricks Users in Your Area

Join a Regional User Group to connect with local Databricks users. Events will be happening in your city, and you won’t want to miss the chance to attend and share knowledge.

If there isn’t a group near you, start one and help create a community that brings people together.

Request a New Group