pep8 is not enough

Post on 15-Apr-2017

174 Views

Category:

Software

0 Downloads

Preview:

Click to see full reader

TRANSCRIPT

ealthy practices for happy and successful codebase

Misha Behersky KyivPy, September, 2016

Code style

2

Same code

3

Bearsharktopus

4

pep8 is not enough

Grid, vertical, hanging indent, vertical hanging indent, hanging grid...

5

isort

standard library modules

third-party modules

user-defined modules

6

pycodestyle, pyflakes, pylint, pychecker, etc.

● No global found ● Passing the wrong number of parameters● Using format strings that don't match arguments● Using a variable before setting it● self is not the first parameter defined for a method● Unused function/method arguments (can ignore self)● No doc strings in modules, classes, functions● ...

7

tick with strict rules

8

Managing requirements

9

pgrade fast

pypiup pip-tools

10

Dependency hell

11

Environments

● Develop in env that is as close as possible to production one

● Test in all possible envs that your app might run● Select your favourite IDE and use it)

12

Testing

● Test what's likely to break● Test negative cases and edge cases● If writing tests is hard, that might be a bug● Aggressively make your test suite fast and reliable● Run it automatically

13

Flaky???

● If it’s flaky it’s not a test*● Stop calling your build flaky*

*If I was in my office I would bite my tongue14

o not write tests

15

rief is not better

16

self-descriptive speaks for itself

17

Overcommunicate

18

Naming

19

utomate routine

20

Put your two cents in

21

ail early

22

ail early

23

ail early

24

Dream within a dream

25

elete code as soon as you know you don't need it any more, no questions asked

26

vulture

27

Are you ready?

28

ime is the only resource you truly need

29

easure everything

30

Wakatime

31

cloc

32

Toggl

33

ecap

● Play stupid● If you don’t try, you’ll never know● Save your energy for something better than

programming work● Consider and reason● …● ???● PROFIT!

35

&

37

e are hiring

datarobot.com/careers/38

hanks for your attention

bmwlog.pp.ua

bmwant@gmail.com

@bmwant

39

top related