Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Code analysis for a better future

768 views

Published on

Talk given at Plone Conference 2014 about code analysis and how to make your life better.

Discusses the current status of plone.recipe.codeanalysis and its future.

See recorded talk at: http://vimeo.com/110364146

Published in: Software
  • Be the first to comment

  • Be the first to like this

Code analysis for a better future

  1. 1. Code analysis for a better future
  2. 2. Gil Forcada Head developer at der Freitag
  3. 3. Few questions: pep8? pep257? internal guidelines? enforcing them? p.r.codeanalysis? p.api style guide? hacking?
  4. 4. Why follow standards?
  5. 5. "Mars Climate Orbiter 2" by NASA/JPL/Corby Waste - Licensed under Public domain via Wikimedia Commons
  6. 6. It is not clear which coding style is used for various shell scripts present in this repository. Having some clear guidelines, like how many characters are used for indentation, if then appears in the same line as if, and such will be helpful to create consistent code easier to read by humans. - developer trying to start contributing on a project (emphasis mine)
  7. 7. BREAKING NEWS
  8. 8. FWT meeting notes from 2013-03-05 ... ... ... ... ... We approved the style guide used by plone.api as the official code style guide for Plone core. http://plone.293351.n2.nabble.com/Framework-team-meeting-2013-03-05-td7563639.html
  9. 9. Examples / Ideas / Thoughts
  10. 10. Sanetizing Plone Views https://gist.github.com/regebro/5326178 @April 12 2013
  11. 11. Consistency MaTterS, size not
  12. 12. EXAMPLE OF INCONSISTENT FILE
  13. 13. 100 devs, 1 file
  14. 14. Written once, read forever
  15. 15. EXAMPLE OF A DIFF WITH: Trailing whitespaces, extra empty lines, different cases, mixing string quotings, different indentation, changing parts that are not related to the code, typos here and there...
  16. 16. Commit messages / history log
  17. 17. http://stackoverflow.com/questions/1057564
  18. 18. Don't lie
  19. 19. Add grok.queryAnnotation() from grokcore.annotation +from grokcore.annotation import queryAnnotation Actually... Remove code on buildout.cfg New version of bootstrap.py https://github.com/zopefoundation/grok/commit/0e4ecf6e3f2531f90f7e7e498 97d1b9439802f29
  20. 20. But please...
  21. 21. Cognitive load Is the load related to the executive control of working memory (WM). Theories contend that during complex learning activities the amount of information and interactions that must be processed simultaneously can either underload or overload the finite amount of working memory one possesses. All elements must be processed before meaningful learning can continue. Wikipedia (quoting book "Cognitive Load Theory: Instructional Implications of the Interaction between Information Structures and Cognitive Architecture".)
  22. 22. plone.recipe.codeanalysis to the rescue
  23. 23. .py .zcml .xml .pt .js .css .rst package structure testing approach ...
  24. 24. FUTURE
  25. 25. Openspace anyone?
  26. 26. THANKS!

×