Talks
Speakers
Events
Topics
Sign in
Home
Talks
Speakers
Events
Topics
Leaderboard
Use
Analytics
Sign in
Suggest modification to this talk
Title
Description
By, Nickolas Means As developers, we spend more of our time writing than we do thinking about the nuances of computer science. What would happen if we approached code like a writing exercise instead of a technical pursuit? What if we applied patterns from elegant prose instead of Gang of Four? Let's try it! We'll take some smelly Ruby and refactor it using only advice from Strunk and White's "The Elements of Style", the canonical text on writing beautiful, understandable English. You'll come away with a new approach to your craft and a new appreciation of the similarities between great writing and great code. Help us caption & translate this video! http://amara.org/v/FixO/
Date
Summarized using AI?
If this talk's summary was generated by AI, please check this box. A "Summarized using AI" badge will be displayed in the summary tab to indicate that the summary was generated using AI.
Show "Summarized using AI" badge on summary page
Summary
Markdown supported
In the video titled "How to Code Like a Writer," Nickolas Means explores the intersection of writing principles and coding, proposing a fresh approach to software development. He draws on the wisdom of Strunk and White's "The Elements of Style" to refactor messy Ruby code, emphasizing clarity, conciseness, and thoughtful design akin to writing prose. Key points discussed include: - **Approach to Coding**: Means challenges developers to view coding through the lens of writing, suggesting that much of software development is akin to writing and requires similar scrutiny and revision. - **Code Complexity**: He presents a particularly complex Ruby class named "shipment utilities.rb" which is filled with technical debt, reflected in its high Flog and Flay scores indicating complexity and duplication. - **Refactoring Principles**: Using rules from Strunk and White, Means emphasizes the importance of revising and rewriting (akin to refactoring) and the significance of working from a suitable design rather than jumping into coding. - **Practical Example**: Means dives deep into the code, explaining the current functionality that handles order shipments, illustrating how the code logic interacted with the underlying business rules regarding shipping items from multiple vendors. He also refactors the code throughout the video, applying writing principles to improve clarity and functionality. - **Clarity & Readability**: Throughout the refactoring process, Means emphasizes Strunk and White's recommendations such as avoiding needless words and ensuring coordinate ideas are presented in similar forms for easier understanding. He iterates on methods for consolidating shipments, optimizing code structure, and naming conventions to enhance readability. - **Final Outcome**: By the end of the talk, the refactored code shows significant improvements in complexity, readability, and modularity. Means concludes with a powerful reminder about the relationships between readability and maintainability in software, asserting that easier-to-read code is easier to change and maintain. Listeners are encouraged to appreciate the parallels between writing clear prose and writing concise, understandable code. This talk challenges developers to refine their coding practice by adopting a writer's mindset, resulting in code that is not only operational but also elegant and maintainable.
Suggest modifications
Cancel