pep8 is not enough

39
ealthy practices for happy and successful codebase Misha Behersky KyivPy, September, 2016

Upload: misha-behersky

Post on 15-Apr-2017

172 views

Category:

Software


0 download

TRANSCRIPT

Page 1: Pep8 is not enough

ealthy practices for happy and successful codebase

Misha Behersky KyivPy, September, 2016

Page 2: Pep8 is not enough

Code style

2

Page 3: Pep8 is not enough

Same code

3

Page 4: Pep8 is not enough

Bearsharktopus

4

Page 5: Pep8 is not enough

pep8 is not enough

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

5

Page 6: Pep8 is not enough

isort

standard library modules

third-party modules

user-defined modules

6

Page 7: Pep8 is not enough

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

Page 8: Pep8 is not enough

tick with strict rules

8

Page 9: Pep8 is not enough

Managing requirements

9

Page 10: Pep8 is not enough

pgrade fast

pypiup pip-tools

10

Page 11: Pep8 is not enough

Dependency hell

11

Page 12: Pep8 is not enough

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

Page 13: Pep8 is not enough

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

Page 14: Pep8 is not enough

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

Page 15: Pep8 is not enough

o not write tests

15

Page 16: Pep8 is not enough

rief is not better

16

Page 17: Pep8 is not enough

self-descriptive speaks for itself

17

Page 18: Pep8 is not enough

Overcommunicate

18

Page 19: Pep8 is not enough

Naming

19

Page 20: Pep8 is not enough

utomate routine

20

Page 21: Pep8 is not enough

Put your two cents in

21

Page 22: Pep8 is not enough

ail early

22

Page 23: Pep8 is not enough

ail early

23

Page 24: Pep8 is not enough

ail early

24

Page 25: Pep8 is not enough

Dream within a dream

25

Page 26: Pep8 is not enough

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

26

Page 27: Pep8 is not enough

vulture

27

Page 28: Pep8 is not enough

Are you ready?

28

Page 29: Pep8 is not enough

ime is the only resource you truly need

29

Page 30: Pep8 is not enough

easure everything

30

Page 31: Pep8 is not enough

Wakatime

31

Page 32: Pep8 is not enough

cloc

32

Page 33: Pep8 is not enough

Toggl

33

Page 35: Pep8 is not enough

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

Page 37: Pep8 is not enough

&

37

Page 38: Pep8 is not enough

e are hiring

datarobot.com/careers/38

Page 39: Pep8 is not enough

hanks for your attention

bmwlog.pp.ua

[email protected]

@bmwant

39