SlideShare a Scribd company logo
1 of 23
Coding Standards
in WordPress
@swapypatil
Swapnil V. Patil
patilswapnilv@gmail.com
What are coding
standards?
@swapypatil
Coding conventions are a set of guidelines for a specific
programming language that recommend programming
style, practices, and methods for each aspect of a program
written in that language. These conventions usually cover
file organization, indentation, comments, declarations,
statements, white space, naming conventions,
programming practices, programming principles,
programming rules of thumb, architectural best practices,
etc.
@swapypatil
Have you ever came across something
like this?
Have you ever came across
something like this?
THIS ITEM IS
REDUCED DUE
TO MISSPELLING
OF THE
WORD BIRD.
THANK YOU.
“
Coding Standards in
WordPress
Why are
Important?
Transition headline
The best applications are coded
properly. This sounds like an obvious
statement, but by ‘properly’, I mean
that the code not only does its job
well, but is also easy to add to,
maintain and debug.
Hello!
I am Swapnil Patil
I am here because I love the
open source community.
You can find me at:
@swapypatil
Transition headline
When we learn a new language, we usually begin to
code in a specific style. In most cases, we’ll write in a
style that we want, not one that has been suggested to
us.
But once we start to code using a particular style, like
a spoken language dialect, it will become second
nature — we’ll use that style in everything we create.
Such a style might include the conventions we use to
name variables and functions ($userName, $username
or $user_name for example), and how we comment
our work. Any style should ensure that we can read our
code easily.
Transition headline
A coding standards document tells developers how
they must write their code.
Instead of each developer coding in their own
preferred style, they will write all code to the standards
outlined in the document.
This makes sure that a large project is coded in a
consistent style — parts are not written differently by
different programmers.
Not only does this solution make the code easier to
understand, it also ensures that any developer who
looks at the code will know what to expect throughout
the entire application.
Transition headline
Can you actually read the code? Is it spaced out clearly?
o Do you separate blocks of code into ‘paragraphs’ so that
different sections are easily defined?
o Are you using indentation to show where control structures
(if, else, while and other loops) begin and end, and where the
code within them is?
o Are your variable naming conventions consistent throughout
the code and do they briefly describe that data that they’ll
contain?
o Are functions named in accordance with what they do?
Transition headline
If you come back to the code in a
few weeks or months, will you be
able to work out what’s happening
without needing to look at every line?
Transition headline
How are you commenting
the work?
Transition headline
How are you commenting
the work?
Transition headline
Have you used complex
language functions/constructs
that are quicker to write but
affect readability?
Transition headlineCreate Maintainable Code
Transition headline
Transition headline
Here are two ways we might write the same code — you can
see the difference between easily readable code and complex,
but more quickly written code. Even if you don’t know much
PHP, you probably noted that the second snippet is much tidier
and easier to understand. I’ve named functions using a verb
(get, display), used variable names that describe the data they
contain, and used brackets to help show what the for condition
is. Not only that, but I’ve also included the braces for the control
structures and used indentation to show which code appears
under each structure.
Transition headline
I have my own personal coding standards, because I liked the way
they were written. For example, in my own standards, I put the
braces for control structures on a new line:
Transition headline
But in the WordPress standards, the first brace is on the
same line as the if (condition):
“
Coding standards are great — but how
do you decide which standards you
want to apply, and how they will be
defined? When you formulate your
ideal coding style, you should think
about these points:
Transition headline
https://codex.wordpress.org/WordPress_Coding_Standards
https://make.wordpress.org/core/handbook/best-
practices/coding-standards/
https://make.wordpress.org/core/handbook/best-
practices/coding-standards/php/
https://varyingvagrantvagrants.org/
https://github.com/Varying-Vagrant-Vagrants/VVV
Thanks!
Any questions?
You can find me at:
@swapypatil on Twitter
patilswapnilv@gmail.com

More Related Content

What's hot

Design pattern in an expressive language java script
Design pattern in an expressive language java scriptDesign pattern in an expressive language java script
Design pattern in an expressive language java scriptAmit Thakkar
 
Best Practices of Software Development
Best Practices of Software DevelopmentBest Practices of Software Development
Best Practices of Software DevelopmentFolio3 Software
 
Understanding, measuring and improving code quality in JavaScript
Understanding, measuring and improving code quality in JavaScriptUnderstanding, measuring and improving code quality in JavaScript
Understanding, measuring and improving code quality in JavaScriptMark Daggett
 
Ncrafts.io - Refactor your software architecture
Ncrafts.io - Refactor your software architectureNcrafts.io - Refactor your software architecture
Ncrafts.io - Refactor your software architectureJulien Lavigne du Cadet
 
Software development best practices & coding guidelines
Software development best practices & coding guidelinesSoftware development best practices & coding guidelines
Software development best practices & coding guidelinesAnkur Goyal
 
Documenting Code - Patterns and Anti-patterns - NLPW 2016
Documenting Code - Patterns and Anti-patterns - NLPW 2016Documenting Code - Patterns and Anti-patterns - NLPW 2016
Documenting Code - Patterns and Anti-patterns - NLPW 2016Søren Lund
 
Documenting code yapceu2016
Documenting code yapceu2016Documenting code yapceu2016
Documenting code yapceu2016Søren Lund
 
Git branching policy and review comment's prefix
Git branching policy and review comment's prefixGit branching policy and review comment's prefix
Git branching policy and review comment's prefixKumaresh Chandra Baruri
 
Testing with cucumber testing framework
Testing with cucumber testing frameworkTesting with cucumber testing framework
Testing with cucumber testing frameworkAIMDek Technologies
 
Increased productivity with visual c sharp ide
Increased productivity with visual c sharp ideIncreased productivity with visual c sharp ide
Increased productivity with visual c sharp idenkaluva
 
Internal domain-specific languages
Internal domain-specific languagesInternal domain-specific languages
Internal domain-specific languagesMikhail Barash
 
Beyond Unit Testing
Beyond Unit TestingBeyond Unit Testing
Beyond Unit TestingSøren Lund
 
sitHVR - The Hitchhikers Guide to the Legacy
sitHVR - The Hitchhikers Guide to the LegacysitHVR - The Hitchhikers Guide to the Legacy
sitHVR - The Hitchhikers Guide to the LegacyLaurens van Rijn
 
ALPHA Script - Development Steps
ALPHA Script - Development StepsALPHA Script - Development Steps
ALPHA Script - Development StepsPROBOTEK
 
Introduction to lambda behave
Introduction to lambda behaveIntroduction to lambda behave
Introduction to lambda behaveRichardWarburton
 
Smu bca sem 5 spring 2015 assignments
Smu bca sem 5 spring 2015 assignmentsSmu bca sem 5 spring 2015 assignments
Smu bca sem 5 spring 2015 assignmentssolved_assignments
 

What's hot (19)

Design pattern in an expressive language java script
Design pattern in an expressive language java scriptDesign pattern in an expressive language java script
Design pattern in an expressive language java script
 
Best Practices of Software Development
Best Practices of Software DevelopmentBest Practices of Software Development
Best Practices of Software Development
 
Understanding, measuring and improving code quality in JavaScript
Understanding, measuring and improving code quality in JavaScriptUnderstanding, measuring and improving code quality in JavaScript
Understanding, measuring and improving code quality in JavaScript
 
Ncrafts.io - Refactor your software architecture
Ncrafts.io - Refactor your software architectureNcrafts.io - Refactor your software architecture
Ncrafts.io - Refactor your software architecture
 
Software development best practices & coding guidelines
Software development best practices & coding guidelinesSoftware development best practices & coding guidelines
Software development best practices & coding guidelines
 
Documenting Code - Patterns and Anti-patterns - NLPW 2016
Documenting Code - Patterns and Anti-patterns - NLPW 2016Documenting Code - Patterns and Anti-patterns - NLPW 2016
Documenting Code - Patterns and Anti-patterns - NLPW 2016
 
Whats New In C Sharp 4 And Vb 10
Whats New In C Sharp 4 And Vb 10Whats New In C Sharp 4 And Vb 10
Whats New In C Sharp 4 And Vb 10
 
Documenting code yapceu2016
Documenting code yapceu2016Documenting code yapceu2016
Documenting code yapceu2016
 
Git branching policy and review comment's prefix
Git branching policy and review comment's prefixGit branching policy and review comment's prefix
Git branching policy and review comment's prefix
 
BDD and Behave
BDD and BehaveBDD and Behave
BDD and Behave
 
Testing with cucumber testing framework
Testing with cucumber testing frameworkTesting with cucumber testing framework
Testing with cucumber testing framework
 
Increased productivity with visual c sharp ide
Increased productivity with visual c sharp ideIncreased productivity with visual c sharp ide
Increased productivity with visual c sharp ide
 
Please review and merge
Please review and mergePlease review and merge
Please review and merge
 
Internal domain-specific languages
Internal domain-specific languagesInternal domain-specific languages
Internal domain-specific languages
 
Beyond Unit Testing
Beyond Unit TestingBeyond Unit Testing
Beyond Unit Testing
 
sitHVR - The Hitchhikers Guide to the Legacy
sitHVR - The Hitchhikers Guide to the LegacysitHVR - The Hitchhikers Guide to the Legacy
sitHVR - The Hitchhikers Guide to the Legacy
 
ALPHA Script - Development Steps
ALPHA Script - Development StepsALPHA Script - Development Steps
ALPHA Script - Development Steps
 
Introduction to lambda behave
Introduction to lambda behaveIntroduction to lambda behave
Introduction to lambda behave
 
Smu bca sem 5 spring 2015 assignments
Smu bca sem 5 spring 2015 assignmentsSmu bca sem 5 spring 2015 assignments
Smu bca sem 5 spring 2015 assignments
 

Viewers also liked

El aprendizaje en los MOOC
El aprendizaje en los MOOCEl aprendizaje en los MOOC
El aprendizaje en los MOOCJordi Adell
 
PLEs Alacant 2014
PLEs Alacant 2014PLEs Alacant 2014
PLEs Alacant 2014Jordi Adell
 
Introduction to WordPress 2016
Introduction to WordPress 2016Introduction to WordPress 2016
Introduction to WordPress 2016LumosTech
 
What's new in WordPress 4.7
What's new in WordPress 4.7What's new in WordPress 4.7
What's new in WordPress 4.7Steven Watts
 
Reconociendo prácticas de acceso y producción de contenidos desde el licencia...
Reconociendo prácticas de acceso y producción de contenidos desde el licencia...Reconociendo prácticas de acceso y producción de contenidos desde el licencia...
Reconociendo prácticas de acceso y producción de contenidos desde el licencia...Marcela Hernandez
 
Nuevas tecnologías y educación: tendencias, investigación y futuro
Nuevas tecnologías y educación: tendencias, investigación y futuro Nuevas tecnologías y educación: tendencias, investigación y futuro
Nuevas tecnologías y educación: tendencias, investigación y futuro Jordi Adell
 
Webinar: Experts Weigh in on the State of WordPress for 2017
Webinar: Experts Weigh in on the State of WordPress for 2017Webinar: Experts Weigh in on the State of WordPress for 2017
Webinar: Experts Weigh in on the State of WordPress for 2017WP Engine
 
Jordi Adell "El diseño de actividades didácticas con TIC" JEDI2010 Bilbao
Jordi Adell "El diseño de actividades didácticas con TIC" JEDI2010 BilbaoJordi Adell "El diseño de actividades didácticas con TIC" JEDI2010 Bilbao
Jordi Adell "El diseño de actividades didácticas con TIC" JEDI2010 BilbaoJordi Adell
 
State of the Word 2016
State of the Word 2016State of the Word 2016
State of the Word 2016photomatt
 
Open Source Creativity
Open Source CreativityOpen Source Creativity
Open Source CreativitySara Cannon
 

Viewers also liked (11)

El aprendizaje en los MOOC
El aprendizaje en los MOOCEl aprendizaje en los MOOC
El aprendizaje en los MOOC
 
PLEs Alacant 2014
PLEs Alacant 2014PLEs Alacant 2014
PLEs Alacant 2014
 
Introduction to WordPress 2016
Introduction to WordPress 2016Introduction to WordPress 2016
Introduction to WordPress 2016
 
Bootstrap 3.
Bootstrap 3.Bootstrap 3.
Bootstrap 3.
 
What's new in WordPress 4.7
What's new in WordPress 4.7What's new in WordPress 4.7
What's new in WordPress 4.7
 
Reconociendo prácticas de acceso y producción de contenidos desde el licencia...
Reconociendo prácticas de acceso y producción de contenidos desde el licencia...Reconociendo prácticas de acceso y producción de contenidos desde el licencia...
Reconociendo prácticas de acceso y producción de contenidos desde el licencia...
 
Nuevas tecnologías y educación: tendencias, investigación y futuro
Nuevas tecnologías y educación: tendencias, investigación y futuro Nuevas tecnologías y educación: tendencias, investigación y futuro
Nuevas tecnologías y educación: tendencias, investigación y futuro
 
Webinar: Experts Weigh in on the State of WordPress for 2017
Webinar: Experts Weigh in on the State of WordPress for 2017Webinar: Experts Weigh in on the State of WordPress for 2017
Webinar: Experts Weigh in on the State of WordPress for 2017
 
Jordi Adell "El diseño de actividades didácticas con TIC" JEDI2010 Bilbao
Jordi Adell "El diseño de actividades didácticas con TIC" JEDI2010 BilbaoJordi Adell "El diseño de actividades didácticas con TIC" JEDI2010 Bilbao
Jordi Adell "El diseño de actividades didácticas con TIC" JEDI2010 Bilbao
 
State of the Word 2016
State of the Word 2016State of the Word 2016
State of the Word 2016
 
Open Source Creativity
Open Source CreativityOpen Source Creativity
Open Source Creativity
 

Similar to WordCamp Pune 2017- WordPress Coding standards

Coding standards
Coding standardsCoding standards
Coding standardsMimoh Ojha
 
WordCamp Asheville 2017 - So You Wanna Dev? Join the Team!
WordCamp Asheville 2017 - So You Wanna Dev? Join the Team!WordCamp Asheville 2017 - So You Wanna Dev? Join the Team!
WordCamp Asheville 2017 - So You Wanna Dev? Join the Team!Evan Mullins
 
Code review best practice
Code review best practiceCode review best practice
Code review best practiceOren Digmi
 
Code Craftsmanship Checklist
Code Craftsmanship ChecklistCode Craftsmanship Checklist
Code Craftsmanship ChecklistRyan Polk
 
WordCamp Nashville: Clean Code for WordPress
WordCamp Nashville: Clean Code for WordPressWordCamp Nashville: Clean Code for WordPress
WordCamp Nashville: Clean Code for WordPressmtoppa
 
Effective Programming In Scala
Effective Programming In ScalaEffective Programming In Scala
Effective Programming In ScalaHarsh Sharma
 
Weekly Session with the local .NET Developer Community
Weekly Session with the local .NET  Developer CommunityWeekly Session with the local .NET  Developer Community
Weekly Session with the local .NET Developer Communitykazimanzurrashid
 
8 programming concepts_you_should_know_in_2017
8 programming concepts_you_should_know_in_20178 programming concepts_you_should_know_in_2017
8 programming concepts_you_should_know_in_2017Rajesh Shirsagar
 
Working together
Working togetherWorking together
Working togetherhimaye
 
Say Hello 2 Bdd
Say Hello 2 BddSay Hello 2 Bdd
Say Hello 2 Bddmh_azad
 
Coding standard and coding guideline
Coding standard and coding guidelineCoding standard and coding guideline
Coding standard and coding guidelineDhananjaysinh Jhala
 
Dependency Injection, Design Principles and Patterns
Dependency Injection, Design Principles and PatternsDependency Injection, Design Principles and Patterns
Dependency Injection, Design Principles and PatternsJuan Lopez
 
Moving From JavaScript to TypeScript: Things Developers Should Know
Moving From JavaScript to TypeScript: Things Developers Should KnowMoving From JavaScript to TypeScript: Things Developers Should Know
Moving From JavaScript to TypeScript: Things Developers Should KnowFibonalabs
 
Introduction to Behavior Driven Development
Introduction to Behavior Driven Development Introduction to Behavior Driven Development
Introduction to Behavior Driven Development Robin O'Brien
 
How to do code review and use analysis tool in software development
How to do code review and use analysis tool in software developmentHow to do code review and use analysis tool in software development
How to do code review and use analysis tool in software developmentMitosis Technology
 
9 Tips to write efficient and scalable code.pdf
9 Tips to write efficient and scalable code.pdf9 Tips to write efficient and scalable code.pdf
9 Tips to write efficient and scalable code.pdfOprim Solutions
 
Software Development Standard Operating Procedure
Software Development Standard Operating Procedure Software Development Standard Operating Procedure
Software Development Standard Operating Procedure rupeshchanchal
 

Similar to WordCamp Pune 2017- WordPress Coding standards (20)

Coding standards
Coding standardsCoding standards
Coding standards
 
WordCamp Asheville 2017 - So You Wanna Dev? Join the Team!
WordCamp Asheville 2017 - So You Wanna Dev? Join the Team!WordCamp Asheville 2017 - So You Wanna Dev? Join the Team!
WordCamp Asheville 2017 - So You Wanna Dev? Join the Team!
 
Code review best practice
Code review best practiceCode review best practice
Code review best practice
 
Code Craftsmanship Checklist
Code Craftsmanship ChecklistCode Craftsmanship Checklist
Code Craftsmanship Checklist
 
Unit iv
Unit ivUnit iv
Unit iv
 
WordCamp Nashville: Clean Code for WordPress
WordCamp Nashville: Clean Code for WordPressWordCamp Nashville: Clean Code for WordPress
WordCamp Nashville: Clean Code for WordPress
 
Effective Programming In Scala
Effective Programming In ScalaEffective Programming In Scala
Effective Programming In Scala
 
Weekly Session with the local .NET Developer Community
Weekly Session with the local .NET  Developer CommunityWeekly Session with the local .NET  Developer Community
Weekly Session with the local .NET Developer Community
 
8 programming concepts_you_should_know_in_2017
8 programming concepts_you_should_know_in_20178 programming concepts_you_should_know_in_2017
8 programming concepts_you_should_know_in_2017
 
Working together
Working togetherWorking together
Working together
 
Coding conventions
Coding conventionsCoding conventions
Coding conventions
 
Say Hello 2 Bdd
Say Hello 2 BddSay Hello 2 Bdd
Say Hello 2 Bdd
 
Coding standard and coding guideline
Coding standard and coding guidelineCoding standard and coding guideline
Coding standard and coding guideline
 
Dependency Injection, Design Principles and Patterns
Dependency Injection, Design Principles and PatternsDependency Injection, Design Principles and Patterns
Dependency Injection, Design Principles and Patterns
 
Moving From JavaScript to TypeScript: Things Developers Should Know
Moving From JavaScript to TypeScript: Things Developers Should KnowMoving From JavaScript to TypeScript: Things Developers Should Know
Moving From JavaScript to TypeScript: Things Developers Should Know
 
Introduction to Behavior Driven Development
Introduction to Behavior Driven Development Introduction to Behavior Driven Development
Introduction to Behavior Driven Development
 
How to do code review and use analysis tool in software development
How to do code review and use analysis tool in software developmentHow to do code review and use analysis tool in software development
How to do code review and use analysis tool in software development
 
Quick Intro to Clean Coding
Quick Intro to Clean CodingQuick Intro to Clean Coding
Quick Intro to Clean Coding
 
9 Tips to write efficient and scalable code.pdf
9 Tips to write efficient and scalable code.pdf9 Tips to write efficient and scalable code.pdf
9 Tips to write efficient and scalable code.pdf
 
Software Development Standard Operating Procedure
Software Development Standard Operating Procedure Software Development Standard Operating Procedure
Software Development Standard Operating Procedure
 

Recently uploaded

Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptxLBM Solutions
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...HostedbyConfluent
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?XfilesPro
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
 

Recently uploaded (20)

Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping Elbows
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptx
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
 

WordCamp Pune 2017- WordPress Coding standards

  • 1. Coding Standards in WordPress @swapypatil Swapnil V. Patil patilswapnilv@gmail.com
  • 3. Coding conventions are a set of guidelines for a specific programming language that recommend programming style, practices, and methods for each aspect of a program written in that language. These conventions usually cover file organization, indentation, comments, declarations, statements, white space, naming conventions, programming practices, programming principles, programming rules of thumb, architectural best practices, etc. @swapypatil
  • 4. Have you ever came across something like this?
  • 5. Have you ever came across something like this? THIS ITEM IS REDUCED DUE TO MISSPELLING OF THE WORD BIRD. THANK YOU. “
  • 7. Transition headline The best applications are coded properly. This sounds like an obvious statement, but by ‘properly’, I mean that the code not only does its job well, but is also easy to add to, maintain and debug.
  • 8. Hello! I am Swapnil Patil I am here because I love the open source community. You can find me at: @swapypatil
  • 9. Transition headline When we learn a new language, we usually begin to code in a specific style. In most cases, we’ll write in a style that we want, not one that has been suggested to us. But once we start to code using a particular style, like a spoken language dialect, it will become second nature — we’ll use that style in everything we create. Such a style might include the conventions we use to name variables and functions ($userName, $username or $user_name for example), and how we comment our work. Any style should ensure that we can read our code easily.
  • 10. Transition headline A coding standards document tells developers how they must write their code. Instead of each developer coding in their own preferred style, they will write all code to the standards outlined in the document. This makes sure that a large project is coded in a consistent style — parts are not written differently by different programmers. Not only does this solution make the code easier to understand, it also ensures that any developer who looks at the code will know what to expect throughout the entire application.
  • 11. Transition headline Can you actually read the code? Is it spaced out clearly? o Do you separate blocks of code into ‘paragraphs’ so that different sections are easily defined? o Are you using indentation to show where control structures (if, else, while and other loops) begin and end, and where the code within them is? o Are your variable naming conventions consistent throughout the code and do they briefly describe that data that they’ll contain? o Are functions named in accordance with what they do?
  • 12. Transition headline If you come back to the code in a few weeks or months, will you be able to work out what’s happening without needing to look at every line?
  • 13. Transition headline How are you commenting the work?
  • 14. Transition headline How are you commenting the work?
  • 15. Transition headline Have you used complex language functions/constructs that are quicker to write but affect readability?
  • 18. Transition headline Here are two ways we might write the same code — you can see the difference between easily readable code and complex, but more quickly written code. Even if you don’t know much PHP, you probably noted that the second snippet is much tidier and easier to understand. I’ve named functions using a verb (get, display), used variable names that describe the data they contain, and used brackets to help show what the for condition is. Not only that, but I’ve also included the braces for the control structures and used indentation to show which code appears under each structure.
  • 19. Transition headline I have my own personal coding standards, because I liked the way they were written. For example, in my own standards, I put the braces for control structures on a new line:
  • 20. Transition headline But in the WordPress standards, the first brace is on the same line as the if (condition):
  • 21. “ Coding standards are great — but how do you decide which standards you want to apply, and how they will be defined? When you formulate your ideal coding style, you should think about these points:
  • 23. Thanks! Any questions? You can find me at: @swapypatil on Twitter patilswapnilv@gmail.com