O slideshow foi denunciado.
Utilizamos seu perfil e dados de atividades no LinkedIn para personalizar e exibir anúncios mais relevantes. Altere suas preferências de anúncios quando desejar.

Dmytro Dziubenko "Developer's toolchain"

82 visualizações

Publicada em

There is not enough knowledge of programming languages to be good developers nowadays. It is important to understand the processes of continually improving the quality of the code and its performance. The ability to configure the development processes in a team more valuable than just writing code. To do this, you need to start using new tools or improve existing ones. We will go through all stages of development and find out what can be done better.

Publicada em: Tecnologia
  • Seja o primeiro a comentar

  • Seja a primeira pessoa a gostar disto

Dmytro Dziubenko "Developer's toolchain"

  1. 1. Developer’s toolchain Dmytro Dziubenko PayCore.io
  2. 2. About me ● 3 years in Interkassa ● CTO at PayCore.io ● 10 years in production ● https://github.com/dzubchik
  3. 3. Local development $ git clone git@vcs.company.name/mega-project.git
  4. 4. Local development ● Docker ● Docker-compose ● Task runner ● README.md
  5. 5. Docker
  6. 6. Docker-compose
  7. 7. $ make
  8. 8. IDE ● Correct php version ● IDE templates ● Hotkeys ● Refactoring ● Necessary plugins ● EditorConfig
  9. 9. Xdebug
  10. 10. Xdebug: conditions
  11. 11. Xdebug: dependencies
  12. 12. Codestyle
  13. 13. Codestyle diff Do you see what really changed?
  14. 14. Codestyle ● PSR-1 ● PSR-2 ● PSR-12 (in review) ● Framework style guide ○ Symfony ○ Laravel ○ Zend ● Code should use four spaces for indenting ● Lines should be 80 characters or less ● Opening braces must go on the next line after the function definition ● Closing braces must go on the next line after the function body ● Control structure keywords must have one space after them; method and function calls must not ● Boolean -> bool, integer -> int ● Class names are written using StudlyCase ● Constants - UPPERCASE_WITH_UNDERSCORE ● Function names are defined in camelCase ● Use UTF-8 encoding ● And much more...
  15. 15. Save them all $ composer require friendsofphp/php-cs-fixer --dev $ ./vendor/bin/php-cs-fixer fix src --rules=@PSR1,@PSR2 --dry-run --diff
  16. 16. Codestyle $ ./bin/php-cs-fixer fix --config=php_cs.php
  17. 17. Static code analyze ● Phpstan ● Phan ● Psalm ● Phpstorm Inspections ● Unpredictable function result ● Array shapes ● Class, method, function exists ● No syntax errors ● PhpDoc matches real types
  18. 18. Phpstan ● Easy to install ● A lot of plugins ● Zero configuration ● Can analyze a part of project ● Quick analyze ● Neon config format ● No custom annotations ● No array shapes ● No generic annotations
  19. 19. Testing ● Cover at least critical parts ● Write functional tests ● Write tests after something is broken
  20. 20. API standard ● Response format ● Pagination ● Sorting ● Filtering ● Updates ● Error responses ● Library for %framework%
  21. 21. API standard ● Collection+JSON ● GraphQL ● HAL ● HATEOAS ● Hydra ● JSON API ● JSON-LD ● SIREN
  22. 22. JSON-API ● Easy to implement on start ● A lot of libraries ● Easy to understand ● Resource includes ● Not trivial no CRUD operations ● Hard to implement on production ● Not suitable for all data types ● Requires custom header - application/vnd.api+json
  23. 23. Api specification (OpenAPI)
  24. 24. OpenAPI aka Swagger ● Schema ● UI ● Sandbox ● Versioning ● Code generation
  25. 25. Project lifecycle Dev Ops
  26. 26. Database migration ● Make database dump accessible for developers ● Run migrations on CI ● Evolutionary Database Design
  27. 27. Error handling ● Sentry ● NewRelic ● Rollbar
  28. 28. Questions?
  29. 29. Links ● https://habr.com/ru/company/southbridge/blog/323554/ ● https://habr.com/ru/company/badoo/blog/426605/ ● https://fwdays.com/event/php-fwdays-2018/review/static-analysis ● https://github.com/Symplify/EasyCodingStandard ● https://github.com/php-fig/fig-standards/blob/master/proposed/extended- coding-style-guide.md ● https://modeling-languages.com/modeling-web-api-comparing/ ● https://martinfowler.com/articles/evodb.html ● https://phpstorm.tips/ ● RAML ● ApiBlueprint
  30. 30. Symfony development

×