5 Steps to better writing: Vince tips from University of Tokyo
Tips for Writing Better Code
-
Upload
jamshid-hashimi -
Category
Technology
-
view
92 -
download
3
Transcript of Tips for Writing Better Code
Tips for Writing Better Code
Jamshid Hashimi
Co-Founder, CodeZone
Agenda
• Why Better Code?
• Tips
Why Better Code?
• Writing better code is a universal subject in the world of computer programming.• Readability (for you and anyone else who has look into your code)
• Maintainability (easy to modify)
• Simplicity (not complicating things when there's no need for that)
• Efficiency (of course your code should execute fast)
• Clarity (if your code is self-explanatory, there's no need for comments most of the time, name your methods/properties etc. sensibly, break the long code down, never copy & paste a block of code)
Tips
• Commenting & Documentation• @author, @category, @link, @license, @package, @since, @version and
more at http://www.phpdoc.org/docs/latest/index.html
• Consistent Indentation
• Avoid Obvious Comments
• Code Grouping
• Consistent Naming Scheme
• Avoid Deep Nesting
Tips
• Limit Line Length
• File and Folder Organization
• Capitalize SQL Special Words
• Use revision control for your code
• Write good and detailed commit messages
Tips
• Know your editor
• Automate all repetitive tasks (DRY Principle)
• Refactor every so often
• Allow time for learning
• Watch talks and presentations
• Read Open Source Code
Thank You!