SlideShare a Scribd company logo
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!

More Related Content

What's hot (6)

PPTX
Web dev#1
Richard Bao
 
PPTX
Kotlin For Android (at DevFest İzmir 2016)
Semih Bozdemir
 
PDF
Peer Review Guidelines
Ombu Labs, The Lean Software Boutique
 
PPTX
Building Your Own DSL with Xtext
GlobalLogic Ukraine
 
PPTX
Clean code and Coding Standards
Mahesh Salaria
 
PDF
Bot design AIsatPN 2018
Jessica Tibaldi
 
Web dev#1
Richard Bao
 
Kotlin For Android (at DevFest İzmir 2016)
Semih Bozdemir
 
Building Your Own DSL with Xtext
GlobalLogic Ukraine
 
Clean code and Coding Standards
Mahesh Salaria
 
Bot design AIsatPN 2018
Jessica Tibaldi
 

Viewers also liked (6)

PDF
Using Open Educational Resources in Afghanistan: The Experience So Far
Open Education Global (OEGlobal)
 
PPTX
How Coding Can Make Your Life Better
Jamshid Hashimi
 
PPTX
Week 1: Getting Your Hands Dirty - Part 1
Jamshid Hashimi
 
PPTX
JavaScript Fundamentals & JQuery
Jamshid Hashimi
 
PPTX
Week 2: Getting Your Hands Dirty – Part 2
Jamshid Hashimi
 
PPTX
Introduction to C# - Week 0
Jamshid Hashimi
 
Using Open Educational Resources in Afghanistan: The Experience So Far
Open Education Global (OEGlobal)
 
How Coding Can Make Your Life Better
Jamshid Hashimi
 
Week 1: Getting Your Hands Dirty - Part 1
Jamshid Hashimi
 
JavaScript Fundamentals & JQuery
Jamshid Hashimi
 
Week 2: Getting Your Hands Dirty – Part 2
Jamshid Hashimi
 
Introduction to C# - Week 0
Jamshid Hashimi
 
Ad

Similar to Tips for Writing Better Code (20)

PPTX
Coding Standard And Code Review
Milan Vukoje
 
PDF
Code Inspection
Fáber D. Giraldo
 
PDF
NetWork - 15.10.2011 - Applied code generation in .NET
Dmytro Mindra
 
PDF
How to guarantee your change is integrated to Moodle core
Dan Poltawski
 
PPTX
Design Like a Pro: Scripting Best Practices
Inductive Automation
 
PPTX
Design Like a Pro: Scripting Best Practices
Inductive Automation
 
PDF
Miami2015
DevinVinson
 
PDF
Orthogonality: A Strategy for Reusable Code
rsebbe
 
PPTX
Javascript best practices
Jayanga V. Liyanage
 
PPTX
Autoframework design
Forge Events
 
PPTX
Software Design
Ahmed Misbah
 
PDF
Code Review for iOS
KLabCyscorpions-TechBlog
 
PPTX
Zend MVC pattern based Framework – Best for Enterprise web applications
Etisbew Technology Group
 
PDF
Client Technical Analysis of Legacy Software and Future Replacement
VictorSzoltysek
 
PPTX
Extreme Programming (XP): Revisted
Mike Harris
 
PPTX
Introduction to GoLang
NVISIA
 
PDF
Code Review
Erik Ecoologic
 
PPTX
Writing clean code in C# and .NET
Dror Helper
 
PPTX
Eurosport's Kodakademi #2
Benjamin Baumann
 
PDF
IDE, Terminal and SCM to work with Ruby on Rails
Henry Le
 
Coding Standard And Code Review
Milan Vukoje
 
Code Inspection
Fáber D. Giraldo
 
NetWork - 15.10.2011 - Applied code generation in .NET
Dmytro Mindra
 
How to guarantee your change is integrated to Moodle core
Dan Poltawski
 
Design Like a Pro: Scripting Best Practices
Inductive Automation
 
Design Like a Pro: Scripting Best Practices
Inductive Automation
 
Miami2015
DevinVinson
 
Orthogonality: A Strategy for Reusable Code
rsebbe
 
Javascript best practices
Jayanga V. Liyanage
 
Autoframework design
Forge Events
 
Software Design
Ahmed Misbah
 
Code Review for iOS
KLabCyscorpions-TechBlog
 
Zend MVC pattern based Framework – Best for Enterprise web applications
Etisbew Technology Group
 
Client Technical Analysis of Legacy Software and Future Replacement
VictorSzoltysek
 
Extreme Programming (XP): Revisted
Mike Harris
 
Introduction to GoLang
NVISIA
 
Code Review
Erik Ecoologic
 
Writing clean code in C# and .NET
Dror Helper
 
Eurosport's Kodakademi #2
Benjamin Baumann
 
IDE, Terminal and SCM to work with Ruby on Rails
Henry Le
 
Ad

More from Jamshid Hashimi (20)

PPTX
RIST - Research Institute for Science and Technology
Jamshid Hashimi
 
PPTX
Mobile Vision
Jamshid Hashimi
 
PPTX
Launch Your Local Blog & Social Media Integration
Jamshid Hashimi
 
PPTX
Customizing Your Blog 2
Jamshid Hashimi
 
PPTX
Customizing Your Blog 1
Jamshid Hashimi
 
PPTX
Introduction to Blogging
Jamshid Hashimi
 
PPTX
Introduction to Wordpress
Jamshid Hashimi
 
PPTX
CodeIgniter Helper Functions
Jamshid Hashimi
 
PPTX
CodeIgniter Class Reference
Jamshid Hashimi
 
PPTX
Managing Applications in CodeIgniter
Jamshid Hashimi
 
PPTX
CodeIgniter Practice
Jamshid Hashimi
 
PPTX
CodeIgniter & MVC
Jamshid Hashimi
 
PPTX
PHP Frameworks & Introduction to CodeIgniter
Jamshid Hashimi
 
PPTX
Exception & Database
Jamshid Hashimi
 
PPTX
MySQL Record Operations
Jamshid Hashimi
 
PPTX
MySQL JOIN & UNION
Jamshid Hashimi
 
PPTX
MySQL basics
Jamshid Hashimi
 
PPTX
Php file upload, cookies & session
Jamshid Hashimi
 
PPTX
Php File Operations
Jamshid Hashimi
 
PPTX
Php Intermediate
Jamshid Hashimi
 
RIST - Research Institute for Science and Technology
Jamshid Hashimi
 
Mobile Vision
Jamshid Hashimi
 
Launch Your Local Blog & Social Media Integration
Jamshid Hashimi
 
Customizing Your Blog 2
Jamshid Hashimi
 
Customizing Your Blog 1
Jamshid Hashimi
 
Introduction to Blogging
Jamshid Hashimi
 
Introduction to Wordpress
Jamshid Hashimi
 
CodeIgniter Helper Functions
Jamshid Hashimi
 
CodeIgniter Class Reference
Jamshid Hashimi
 
Managing Applications in CodeIgniter
Jamshid Hashimi
 
CodeIgniter Practice
Jamshid Hashimi
 
CodeIgniter & MVC
Jamshid Hashimi
 
PHP Frameworks & Introduction to CodeIgniter
Jamshid Hashimi
 
Exception & Database
Jamshid Hashimi
 
MySQL Record Operations
Jamshid Hashimi
 
MySQL JOIN & UNION
Jamshid Hashimi
 
MySQL basics
Jamshid Hashimi
 
Php file upload, cookies & session
Jamshid Hashimi
 
Php File Operations
Jamshid Hashimi
 
Php Intermediate
Jamshid Hashimi
 

Recently uploaded (20)

PDF
Julia Furst Morgado The Lazy Guide to Kubernetes with EKS Auto Mode + Karpenter
AWS Chicago
 
PDF
How Current Advanced Cyber Threats Transform Business Operation
Eryk Budi Pratama
 
PPTX
Simplifying End-to-End Apache CloudStack Deployment with a Web-Based Automati...
ShapeBlue
 
PDF
Market Wrap for 18th July 2025 by CIFDAQ
CIFDAQ
 
PDF
NewMind AI Journal - Weekly Chronicles - July'25 Week II
NewMind AI
 
PDF
CIFDAQ'S Token Spotlight for 16th July 2025 - ALGORAND
CIFDAQ
 
PDF
OpenInfra ID 2025 - Are Containers Dying? Rethinking Isolation with MicroVMs.pdf
Muhammad Yuga Nugraha
 
PPTX
Top Managed Service Providers in Los Angeles
Captain IT
 
PPTX
TYPES OF COMMUNICATION Presentation of ICT
JulieBinwag
 
PDF
visibel.ai Company Profile – Real-Time AI Solution for CCTV
visibelaiproject
 
PPTX
The Yotta x CloudStack Advantage: Scalable, India-First Cloud
ShapeBlue
 
PPTX
Extensions Framework (XaaS) - Enabling Orchestrate Anything
ShapeBlue
 
PDF
How a Code Plagiarism Checker Protects Originality in Programming
Code Quiry
 
PPTX
Building and Operating a Private Cloud with CloudStack and LINBIT CloudStack ...
ShapeBlue
 
PDF
The Past, Present & Future of Kenya's Digital Transformation
Moses Kemibaro
 
PDF
Trading Volume Explained by CIFDAQ- Secret Of Market Trends
CIFDAQ
 
PPTX
UI5Con 2025 - Beyond UI5 Controls with the Rise of Web Components
Wouter Lemaire
 
PDF
Novus-Safe Pro: Brochure-What is Novus Safe Pro?.pdf
Novus Hi-Tech
 
PDF
UiPath vs Other Automation Tools Meeting Presentation.pdf
Tracy Dixon
 
PDF
Apache CloudStack 201: Let's Design & Build an IaaS Cloud
ShapeBlue
 
Julia Furst Morgado The Lazy Guide to Kubernetes with EKS Auto Mode + Karpenter
AWS Chicago
 
How Current Advanced Cyber Threats Transform Business Operation
Eryk Budi Pratama
 
Simplifying End-to-End Apache CloudStack Deployment with a Web-Based Automati...
ShapeBlue
 
Market Wrap for 18th July 2025 by CIFDAQ
CIFDAQ
 
NewMind AI Journal - Weekly Chronicles - July'25 Week II
NewMind AI
 
CIFDAQ'S Token Spotlight for 16th July 2025 - ALGORAND
CIFDAQ
 
OpenInfra ID 2025 - Are Containers Dying? Rethinking Isolation with MicroVMs.pdf
Muhammad Yuga Nugraha
 
Top Managed Service Providers in Los Angeles
Captain IT
 
TYPES OF COMMUNICATION Presentation of ICT
JulieBinwag
 
visibel.ai Company Profile – Real-Time AI Solution for CCTV
visibelaiproject
 
The Yotta x CloudStack Advantage: Scalable, India-First Cloud
ShapeBlue
 
Extensions Framework (XaaS) - Enabling Orchestrate Anything
ShapeBlue
 
How a Code Plagiarism Checker Protects Originality in Programming
Code Quiry
 
Building and Operating a Private Cloud with CloudStack and LINBIT CloudStack ...
ShapeBlue
 
The Past, Present & Future of Kenya's Digital Transformation
Moses Kemibaro
 
Trading Volume Explained by CIFDAQ- Secret Of Market Trends
CIFDAQ
 
UI5Con 2025 - Beyond UI5 Controls with the Rise of Web Components
Wouter Lemaire
 
Novus-Safe Pro: Brochure-What is Novus Safe Pro?.pdf
Novus Hi-Tech
 
UiPath vs Other Automation Tools Meeting Presentation.pdf
Tracy Dixon
 
Apache CloudStack 201: Let's Design & Build an IaaS Cloud
ShapeBlue
 

Tips for Writing Better Code

  • 1. Tips for Writing Better Code Jamshid Hashimi Co-Founder, CodeZone
  • 2. Agenda • Why Better Code? • Tips
  • 3. 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)
  • 4. 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
  • 5. Tips • Limit Line Length • File and Folder Organization • Capitalize SQL Special Words • Use revision control for your code • Write good and detailed commit messages
  • 6. 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