Find Your Feature Fit: How to Pick a Text Editor for Python Programming

Find Your Feature Fit: How to Pick a Text Editor for Python Programming

Interested in learning more about this topic? Visit this web site to read my blog: https://www.gregorykapfhammer.com/blog/

4ae30d49c8cc07e42d5a871efb9bcfba?s=128

Gregory Kapfhammer

July 27, 2019
Tweet

Transcript

  1. PyOhio 2019 Find Your Feature Fit How to pick a

    text editor for Python programming Gregory M. Kapfhammer Madelyn M. Kapfhammer
  2. @GregKapfhammer www.gregorykapfhammer.com Hi! Glad to be Back at PyOhio! GREGORY

    M. KAPFHAMMER
  3. @MaddyKapfhammer www.madelynkapfhammer.com Hello! It's Great to Meet You! MADELYN M.

    KAPFHAMMER
  4. Developer Productivity Programming Fun Effective Code Why Care About a

    Text Editor?
  5. VS CODE VIM

  6. A FAST PACED FIELD

  7. Showcase noteworthy features Compare and contrast text editors Highlight less

    available information Share the thrill of customization Key Goals
  8. Ease of ... Installation Use Customization Evaluation Metrics

  9. Learn Key Editor Features Learn the basics before you copy

    confusing con gurations
  10. Install Useful Text Editor Plugins Discover new plugins and update

    them on a regular basis
  11. Visual Studio Code Open Command Palette: Ctrl+Shift+P IntelliSense: Uses Language

    Server Protocol Save con guration in the User Settings Remember to download the Python Extension The Basics
  12. Enable Black Code Formatting

  13. Enable Tab Completion

  14. Enable Flake8 Code Linting

  15. Vim or Neovim Vim or Neovim in a terminal with

    tmux Con gure editor through .vimrc or init.vim Install plugins with a plugin manager Add con guration options for plugins The Basics
  16. Overview of Vim's Con guration File

  17. Useful in both VS Code and Vim pyenv: Download and

    manage Python versions pipenv: Application deps and virtualenvs pytest: Run test cases and report their status coverage: Track statements and branches Development Tools
  18. Con guration and Plugins BOTH SUPPORT PROJECTS AND OFFER MANY

    PLUGINS, BUT VS CODE IS EASIER TO CONFIGURE
  19. Open-source tool to check the work of writers and programmers

    On GitHub at GatorEducator/gatorgrader pipenv shell: Enter a virtual environment pipenv run test: Run the test suite pipenv run cover: Check for full coverage GatorGrader
  20. Install the Application Dependencies

  21. Install Application Dependencies

  22. Start Your Virtual Environment

  23. Selecting a Virtual Environment

  24. Start Project in a Virtual Environment

  25. Virtual Environments and Package Installation BOTH EFFECTIVELY USE PIPENV TO

    MANAGE VIRTUALENVS AND APP DEPENDENCIES
  26. Let's Start Programming in Python!

  27. Calculate Test Suite Coverage Work on an existing code base

  28. Terminal command: pipenv run cover

  29. 99% total coverage 98% coverage test_util.py

  30. I thought coverage was 100%? "It is 100%! Wait, what?"

  31. Fuzzy File Finding for the Test

  32. What's the Problem?

  33. Hardcoded Test Variable

  34. Let's Fix the Test! Use Pytest's tmpdir test xture

  35. Use Pytest's tmpdir xture

  36. Wait, this x is still incomplete!

  37. View and Act on Flake8 Warning

  38. Automated Code Linting BOTH ALLOW MULTIPLE BACKGROUND LINTERS, WITH CUSTOMIZATION

    DIFFERENCES
  39. Code Autocompletion BOTH EDITORS OFFER SUPPORT, WITH TRADE-OFFS IN RELEVANCE

    AND PERFORMANCE
  40. Source Code Formatting

  41. Code Formatting BOTH EDITORS CAN LEVERAGE BLACK, BUT VS CODE

    IS MUCH EASIER TO CONFIGURE
  42. Run Test Suites Did we x the hard-coded test?

  43. Python Test Explorer

  44. Convert tmpdir to a String

  45. Run Tests and Coverage

  46. Check Test Suite Coverage

  47. 100% total coverage!

  48. Automated Testing BOTH SUPPORT TESTING WELL, BUT OFFER A VERY

    DIFFERENT USER EXPERIENCE
  49. Source Code Highlighting BOTH SUPPORT FAST SYNTAX HIGHLIGHTING, BUT VIM

    REQUIRES AN EXTRA PLUGIN
  50. Text Snippets Save time by using a template for text

    Autocompletion trigger inserts text
  51. Snippet Expansion BOTH EDITORS SUPPORT SNIPPETS, BUT VIM WORKS WELL

    IN MORE SCENARIOS
  52. Try multiple editors! Which one did you like best? Why?

  53. VS CODE VIM

  54. VS CODE VIM

  55. Editing Documentation in Markdown Integration with Git and GitHub Automated

    source code refactoring Adding and removing dependencies Releasing a Python application to PyPI Learning Opportunities
  56. 100 likes for a FREE blog post! On all things

    VS Code and Vim ... ... and what it's like to work as a "Father Daughter Duo"! @GregKapfhammer @MaddyKapfhammer WANT MORE?
  57. come on, you can do it it's not that hard!

    Just 100 Likes
  58. Two awesome text editors and a great learning experience! Remember

    ... 100 likes for a blog post! @GregKapfhammer @MaddyKapfhammer Key Points