DjangoCon: Django Code Design and Writing Patches

A follow up to the “Inside the Django ORM” speak, Malcolm Tredinnick gave his second talk Sunday on Django Code design and patch writing (Aka Code Quality, Patch Quality).

After reading around 6000 bug tickets, certain patterns have emerged in the submitted patches…

Code Quality Matters — funny quote from Leah Culver: “Have you every written a library? It’s like people seeing you in your underwear. You gotta make sure it’s clean.”

Do the basics properly. The word “print” is in your patch. Similarly for “import pdb”. If you think PEP 8 is the name of a new energy drink. Run the django testsuite. Submit patches, and not entire files. Start from top of tree when using svn diff.

Read the contributing document (contributing.txt), use sensibly names, comments should last, comments should be correct.

Fix problems, not symptoms. The crowd is smarter than you think — the code mostly works. If you find yourself ripping out lots of code, stop and think.

  • Digg
  • del.icio.us
  • StumbleUpon
  • Technorati
  • Reddit

  • Gorodn Clarke
    Hi searching he web found your details online and have a number of customers that are looking to re-develop their HTML, PHP website to Django/Python. I am a Business Development Consultant and looking to team up with other Django/Python so that I can resell their skills and channel my customer projects via our website to them. Please feel free to get in touch via Skype: G.J.G.Clarke

blog comments powered by Disqus