SlideShare a Scribd company logo
1 of 46
Download to read offline
A data-driven look at
conflicting attitudes towards
commenting and documentation.
@veronica_hanus #PyGotham
@veronica_hanus
Comments as a learner’s first documentation
Purpose of comments:
➔ Summary: authorship, purpose
➔ Describe functions
➔ Clearify “tricky code”/unclear decisions
Allowing:
➔ Easier stand-alone doc-writing!
➔ A “notepad”
➔ Tell why!
@veronica_hanus
Comments get a pretty bad rep!
@veronica_hanus
When does refactoring happen?
➔ New work > refactoring
➔ Time for feedback?
➔ Feel like a “nice to have”
Refactor when….
➔ Can’t stand it anymore
➔ Problem grows
Refactoring == self-care??
@veronica_hanus
Finally! Time to refactor!
@veronica_hanus
@veronica_hanus
@veronica_hanus
Don’t Repeat Yourself!
Keep it D.R.Y.!
Undocumented
code is unusable!
@veronica_hanus
@veronica_hanus
@veronica_hanus
Best practices we can (usually) get behind
Code is the “how”,
comments are the “why”
Don’t Waste Everyone’s
Time (WET)
Line-by-line show lack of
understanding
Docstrings should
have inputs, outputs,
transformation
Outdated comments
== lies
Too much is too much
Always! Maybe?
@veronica_hanus
@veronica_hanus
@veronica_hanus
@veronica_hanus
“JUST CODE
BETTER”Thanks, people of the Internet!
@veronica_hanus
[Subtext] HEY Newbie! Your
struggle BORES ME & shows
you are a bad programmer!
KTHXBYE
Design has methods
& tools!
Let’s face it… comments are magic
@veronica_hanus
@veronica_hanus
Comments can:
- Label
- Questions
- Notes
- Outline
- Storage
- References
- Support
overwhelmed
learners
@veronica_hanus
@veronica_hanus
# V!: TODO
[........] # Veronica
was heree!
Move fast & break things
write bad comments
@veronica_hanus
@veronica_hanus
@veronica_hanus
@veronica_hanus
Radial:
- Current/recent use: Comment uncertainty, Function-level comments, Clarification,
Unused code, Other
- When comments added: Scoping & planning, As functions written, Pairing, As I
learn people don’t understand, Clean-up
- How long programming?
- How long professionally?
- Path to programming?
Agree/Disagree (1-10):
- Comments:
- Help me remember what my code does
- Clarify my thinking
- Help me learn
- Save time
- Delete before projects is shared
- Yes to function-level, no in-line
- Clear code is self-documenting
- Uncomfortable writing @veronica_hanus
Not certain
Each function
In-line
Unused code
@veronica_hanus
Scoping
Experiment
Completing program
Pairing/learning
When others
misunderstand
@veronica_hanus
Not certain
Each function
In-line
Unused code
@veronica_hanus
Not certain
Each function
In-line
Unused code
@veronica_hanus
Not certain
Each function
In-line
Unused code
@veronica_hanus
Not certain
Each function
In-line
Unused code
@veronica_hanus
Not certain
Each function
In-line
Unused code
@veronica_hanus
Not certain
Each function
In-line
Unused code
@veronica_hanus
@veronica_hanusMake your own! https://www.ascii-art-generator.org/
“A global patchwork of Github &
Gitlab repositories don’t just
contain software--they contain
our shared understanding &
collaboration around common
interests & problem solving.”
Jono Bacon in his forward to “The Business Value of Developer Relations”
@veronica_hanus
Comments
teach us about
ourselves
@veronica_hanus
What can we do?
Goal: Support learners where they are at, praising their
accomplishments, while pointing them gently toward the future
➔ Empathy can be hard!
➔ Remember our overwhelmed learner
➔ Advise current them, not future them!
➔ Write w/ comments? Share them!
➔ Suggest a deep dive & reading others’ code?
What can we say? What do they need?
➔ Someone is learning their attitudes toward documentation
from you
Rethink comments
➔ Comments == docs?
➔ Comments teach us about ourselves @veronica_hanus
👇Your company recruiting a
DevRel or Dev Advocate?👇
🙌@veronica_hanus🙌
🙏 Each of you for coming, the
PyGotham organizing team for
the opportunity, & the ~170
internet-folk who have shared
their “comments on comments” <3
I tweet at @veronica_hanus
Non-tweeters 👋me@veronicahanus.com
Survey: http://bit.ly/comment-use
Video & Slides 🔜
http://veronicahanus.com/talks
🙌Write the comments you wish you had!
Learning resources
- Docs that drive code: https://blog.izs.me/2017/06/documentation-driven-development
- Readmes (start here!): http://tom.preston-werner.com/2010/08/23/readme-driven-development.html
- My post on Readme mechanics : http://veronicahanus.com/blog/2017/03/06/writing-readmes.html
- Docs are part of code: https://www.writethedocs.org/guide/docs-as-code/
- Motivation for docs:
https://stoplight.io/blog/writing-documentation-when-you-arent-a-technical-writer-part-two-59997587cc2a/
- Guideline for docs: https://opensource.com/business/15/5/write-better-docs
- Read code? Read docs too! (& resources for doc generation):
https://github.com/PharkMillups/beautiful-docs
- Goal of documentation: https://kadavy.net/blog/posts/productivity-cycles-podcast/
- Talks from “Compassionate Coding”: https://compassionatecoding.com/media
- Notes from a deep dive into “Clean Code”:
https://medium.com/mindorks/how-to-write-clean-code-lessons-learnt-from-the-clean-code-robert-c-martin-9ffc7a
ef870c
- Guidelines for comments: https://www.cs.utah.edu/~germain/PPS/Topics/commenting.html
@veronica_hanus
Credits
- ASCII comments: https://twitter.com/johnregehr/status/1095018518737637376
- “Suffering on StackOverflow”:
https://medium.com/@Aprilw/suffering-on-stack-overflow-c46414a34a52
- We all go through this: https://twitter.com/anupbattasha/status/1094959013194649600
- Comment your cats: https://twitter.com/carterwickstrom/status/1014165500056596481
- Commenting for learning: https://twitter.com/jessfraz/status/1093713454781784065
- Man pages for documentation: https://twitter.com/aemeredith/status/1033445823181287424
- Goal of documentation: https://twitter.com/kadavy/status/1093820499271000064
- Programmer in bath:
https://footage.framepool.com/en/shot/798293950-bath-tub-bathroom-information-technology-student-university
- A good programmer: https://code.likeagirl.io/herstory-software-engineer-maker-estefannie-d4fdec7b069a
- Squirrels wants you to stop:
https://patch.com/florida/brandon/stop-right-there-brandon-squirrel-wins-world-photo-contest
- Sad programmer:
https://drawception.com/game/H73GxcwzmW/a-sad-programmer-playing-drawception/#panel-1537906
- Inconceivable: https://images.app.goo.gl/2nnv4DN7E8yFkeKj8
@veronica_hanus
Not certain
Each function
In-line
Unused code
@veronica_hanus
@veronica_hanus
@veronica_hanus
@veronica_hanus

More Related Content

Similar to PyGotham 2019 "To comment or not to comment?"

gettingintothetechfieldwhatnext-210526205624.pdf
gettingintothetechfieldwhatnext-210526205624.pdfgettingintothetechfieldwhatnext-210526205624.pdf
gettingintothetechfieldwhatnext-210526205624.pdf
roystoncdsouza7
 

Similar to PyGotham 2019 "To comment or not to comment?" (20)

44 Common Copywriting Mistakes That Might Accidentally Kill Your Landing Page...
44 Common Copywriting Mistakes That Might Accidentally Kill Your Landing Page...44 Common Copywriting Mistakes That Might Accidentally Kill Your Landing Page...
44 Common Copywriting Mistakes That Might Accidentally Kill Your Landing Page...
 
APIdays Paris 2019 - Continuous Documentation by Kenigbolo Meya Stephen, BCaster
APIdays Paris 2019 - Continuous Documentation by Kenigbolo Meya Stephen, BCasterAPIdays Paris 2019 - Continuous Documentation by Kenigbolo Meya Stephen, BCaster
APIdays Paris 2019 - Continuous Documentation by Kenigbolo Meya Stephen, BCaster
 
Technical Writing meets Instructional Design
Technical Writing meets Instructional DesignTechnical Writing meets Instructional Design
Technical Writing meets Instructional Design
 
Hidden sides of Code Review (Do-iOS)
Hidden sides of Code Review (Do-iOS)Hidden sides of Code Review (Do-iOS)
Hidden sides of Code Review (Do-iOS)
 
How to Attract & Survive Media Attention as PhD
How to Attract & Survive Media Attention as PhDHow to Attract & Survive Media Attention as PhD
How to Attract & Survive Media Attention as PhD
 
This i Believe CATE2014 presentation
This i Believe CATE2014 presentationThis i Believe CATE2014 presentation
This i Believe CATE2014 presentation
 
Career Hacks for Developers
Career Hacks for DevelopersCareer Hacks for Developers
Career Hacks for Developers
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
gettingintothetechfieldwhatnext-210526205624.pdf
gettingintothetechfieldwhatnext-210526205624.pdfgettingintothetechfieldwhatnext-210526205624.pdf
gettingintothetechfieldwhatnext-210526205624.pdf
 
Getting to Senior in UX
Getting to Senior in UXGetting to Senior in UX
Getting to Senior in UX
 
Nasdaq Pro/Design Masterclass at the Entrepreneurial Center
Nasdaq Pro/Design Masterclass at the Entrepreneurial CenterNasdaq Pro/Design Masterclass at the Entrepreneurial Center
Nasdaq Pro/Design Masterclass at the Entrepreneurial Center
 
Publishing 102 11 18
Publishing 102  11 18Publishing 102  11 18
Publishing 102 11 18
 
Based Argumentative paper.docx
Based Argumentative paper.docxBased Argumentative paper.docx
Based Argumentative paper.docx
 
Phoenix Design Week: User Journeys for Damn Good Digital Design
Phoenix Design Week: User Journeys for Damn Good Digital DesignPhoenix Design Week: User Journeys for Damn Good Digital Design
Phoenix Design Week: User Journeys for Damn Good Digital Design
 
Tenure track socialmedia_10082010
Tenure track socialmedia_10082010Tenure track socialmedia_10082010
Tenure track socialmedia_10082010
 
Rich UX Research for Everyone
Rich UX Research for EveryoneRich UX Research for Everyone
Rich UX Research for Everyone
 
Content Strategy: Do It For Your Users
Content Strategy: Do It For Your UsersContent Strategy: Do It For Your Users
Content Strategy: Do It For Your Users
 
Build Your Own Contributors, One Part At A Time
Build Your Own Contributors, One Part At A TimeBuild Your Own Contributors, One Part At A Time
Build Your Own Contributors, One Part At A Time
 
How to Create Content for SEO That Earns Me Links?
How to Create Content for SEO That Earns Me Links?How to Create Content for SEO That Earns Me Links?
How to Create Content for SEO That Earns Me Links?
 
Defying the itch to stitch
Defying the itch to stitchDefying the itch to stitch
Defying the itch to stitch
 

Recently uploaded

CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 

Recently uploaded (20)

10 Trends Likely to Shape Enterprise Technology in 2024
10 Trends Likely to Shape Enterprise Technology in 202410 Trends Likely to Shape Enterprise Technology in 2024
10 Trends Likely to Shape Enterprise Technology in 2024
 
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
Define the academic and professional writing..pdf
Define the academic and professional writing..pdfDefine the academic and professional writing..pdf
Define the academic and professional writing..pdf
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
 
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdfAzure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
 
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
 
AI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplateAI & Machine Learning Presentation Template
AI & Machine Learning Presentation Template
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
 
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) SolutionIntroducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
 
Exploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdfExploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdf
 
Chinsurah Escorts ☎️8617697112 Starting From 5K to 15K High Profile Escorts ...
Chinsurah Escorts ☎️8617697112  Starting From 5K to 15K High Profile Escorts ...Chinsurah Escorts ☎️8617697112  Starting From 5K to 15K High Profile Escorts ...
Chinsurah Escorts ☎️8617697112 Starting From 5K to 15K High Profile Escorts ...
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 

PyGotham 2019 "To comment or not to comment?"

  • 1. A data-driven look at conflicting attitudes towards commenting and documentation. @veronica_hanus #PyGotham
  • 3. Comments as a learner’s first documentation Purpose of comments: ➔ Summary: authorship, purpose ➔ Describe functions ➔ Clearify “tricky code”/unclear decisions Allowing: ➔ Easier stand-alone doc-writing! ➔ A “notepad” ➔ Tell why! @veronica_hanus
  • 4. Comments get a pretty bad rep! @veronica_hanus
  • 5. When does refactoring happen? ➔ New work > refactoring ➔ Time for feedback? ➔ Feel like a “nice to have” Refactor when…. ➔ Can’t stand it anymore ➔ Problem grows Refactoring == self-care?? @veronica_hanus
  • 6. Finally! Time to refactor! @veronica_hanus
  • 8. @veronica_hanus Don’t Repeat Yourself! Keep it D.R.Y.! Undocumented code is unusable!
  • 12. Best practices we can (usually) get behind Code is the “how”, comments are the “why” Don’t Waste Everyone’s Time (WET) Line-by-line show lack of understanding Docstrings should have inputs, outputs, transformation Outdated comments == lies Too much is too much Always! Maybe? @veronica_hanus
  • 16.
  • 17. @veronica_hanus [Subtext] HEY Newbie! Your struggle BORES ME & shows you are a bad programmer! KTHXBYE
  • 18. Design has methods & tools! Let’s face it… comments are magic @veronica_hanus
  • 20. Comments can: - Label - Questions - Notes - Outline - Storage - References - Support overwhelmed learners @veronica_hanus
  • 21. @veronica_hanus # V!: TODO [........] # Veronica was heree! Move fast & break things write bad comments
  • 26. Radial: - Current/recent use: Comment uncertainty, Function-level comments, Clarification, Unused code, Other - When comments added: Scoping & planning, As functions written, Pairing, As I learn people don’t understand, Clean-up - How long programming? - How long professionally? - Path to programming? Agree/Disagree (1-10): - Comments: - Help me remember what my code does - Clarify my thinking - Help me learn - Save time - Delete before projects is shared - Yes to function-level, no in-line - Clear code is self-documenting - Uncomfortable writing @veronica_hanus
  • 35. @veronica_hanusMake your own! https://www.ascii-art-generator.org/
  • 36. “A global patchwork of Github & Gitlab repositories don’t just contain software--they contain our shared understanding & collaboration around common interests & problem solving.” Jono Bacon in his forward to “The Business Value of Developer Relations” @veronica_hanus
  • 38. What can we do? Goal: Support learners where they are at, praising their accomplishments, while pointing them gently toward the future ➔ Empathy can be hard! ➔ Remember our overwhelmed learner ➔ Advise current them, not future them! ➔ Write w/ comments? Share them! ➔ Suggest a deep dive & reading others’ code? What can we say? What do they need? ➔ Someone is learning their attitudes toward documentation from you Rethink comments ➔ Comments == docs? ➔ Comments teach us about ourselves @veronica_hanus
  • 39. 👇Your company recruiting a DevRel or Dev Advocate?👇 🙌@veronica_hanus🙌 🙏 Each of you for coming, the PyGotham organizing team for the opportunity, & the ~170 internet-folk who have shared their “comments on comments” <3 I tweet at @veronica_hanus Non-tweeters 👋me@veronicahanus.com Survey: http://bit.ly/comment-use Video & Slides 🔜 http://veronicahanus.com/talks 🙌Write the comments you wish you had!
  • 40. Learning resources - Docs that drive code: https://blog.izs.me/2017/06/documentation-driven-development - Readmes (start here!): http://tom.preston-werner.com/2010/08/23/readme-driven-development.html - My post on Readme mechanics : http://veronicahanus.com/blog/2017/03/06/writing-readmes.html - Docs are part of code: https://www.writethedocs.org/guide/docs-as-code/ - Motivation for docs: https://stoplight.io/blog/writing-documentation-when-you-arent-a-technical-writer-part-two-59997587cc2a/ - Guideline for docs: https://opensource.com/business/15/5/write-better-docs - Read code? Read docs too! (& resources for doc generation): https://github.com/PharkMillups/beautiful-docs - Goal of documentation: https://kadavy.net/blog/posts/productivity-cycles-podcast/ - Talks from “Compassionate Coding”: https://compassionatecoding.com/media - Notes from a deep dive into “Clean Code”: https://medium.com/mindorks/how-to-write-clean-code-lessons-learnt-from-the-clean-code-robert-c-martin-9ffc7a ef870c - Guidelines for comments: https://www.cs.utah.edu/~germain/PPS/Topics/commenting.html @veronica_hanus
  • 41. Credits - ASCII comments: https://twitter.com/johnregehr/status/1095018518737637376 - “Suffering on StackOverflow”: https://medium.com/@Aprilw/suffering-on-stack-overflow-c46414a34a52 - We all go through this: https://twitter.com/anupbattasha/status/1094959013194649600 - Comment your cats: https://twitter.com/carterwickstrom/status/1014165500056596481 - Commenting for learning: https://twitter.com/jessfraz/status/1093713454781784065 - Man pages for documentation: https://twitter.com/aemeredith/status/1033445823181287424 - Goal of documentation: https://twitter.com/kadavy/status/1093820499271000064 - Programmer in bath: https://footage.framepool.com/en/shot/798293950-bath-tub-bathroom-information-technology-student-university - A good programmer: https://code.likeagirl.io/herstory-software-engineer-maker-estefannie-d4fdec7b069a - Squirrels wants you to stop: https://patch.com/florida/brandon/stop-right-there-brandon-squirrel-wins-world-photo-contest - Sad programmer: https://drawception.com/game/H73GxcwzmW/a-sad-programmer-playing-drawception/#panel-1537906 - Inconceivable: https://images.app.goo.gl/2nnv4DN7E8yFkeKj8 @veronica_hanus
  • 42.