code analysis for a better future

29
Code analysis for a better future

Upload: gilforcada

Post on 18-Jul-2015

134 views

Category:

Software


0 download

TRANSCRIPT

Code analysis for a better future

Gil Forcada

Head developer at der Freitag

Few questions:pep8?

pep257?internal guidelines?

enforcing them?p.r.codeanalysis?p.api style guide?

hacking?

Why follow standards?

"Mars Climate Orbiter 2" by NASA/JPL/Corby Waste - Licensed under Public domain via

Wikimedia Commons

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)

BREAKING NEWS

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

Examples / Ideas / Thoughts

Sanetizing Plone Viewshttps://gist.github.com/regebro/5326178

@April 12 2013

Consistency MaTterS, size not

EXAMPLE OF INCONSISTENT FILE

100 devs, 1 file

Written once, read forever

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...

Commit messages / history log

http://stackoverflow.com/questions/1057564

Don't lie

Add grok.queryAnnotation() from grokcore.annotation

+from grokcore.annotation import queryAnnotation

Actually...Remove code on buildout.cfgNew version of bootstrap.py

https://github.com/zopefoundation/grok/commit/0e4ecf6e3f2531f90f7e7e49897d1b9439802f29

But please...

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".)

plone.recipe.codeanalysis to the rescue

.py.zcml.xml.pt.js

.css.rst

package structuretesting approach

...

FUTURE

Openspace anyone?

THANKS!