SlideShare a Scribd company logo
1 of 18
Download to read offline
Why You’re a Bad PHP
Programmer
Presented by: Aubrey
You Don’t Plan Before You Start Coding
“Before you write a single line of code,
you should have a solid plan of attack.”
➔  Write an outline in comments first
➔  Plan out an entire application using
this..
➔  If there comes a feature that requires
a functionality tweak, just change the
comment
You Don’t Comment Anything
“Five seconds at a time will add up in a
big way.”
➔  The single worst problem with most
code is that it’s poorly commented or
not commented at all
Code without comment
Code with comment
You Sacrifice Clarity for Brevity
“Good examples of sacrificing clarity for
brevity include unclear variable names
and dropping the curly braces.”
➔  Example of sacrificing clarity for
brevity include short, unclear variable
names (such as $a) and dropping the
curly braces
You Sacrifice Clarity for Brevity
➔  Adding curly braces adds a few lines,
but it clarifies the statement
immensely
You Don’t Follow a Coding Standard
“Choose a standard and stick to it.”
➔  Choose a standard (e.g. PSR - 1, PSR - 2) and stick to it
➔  When it comes to programming, think of it like a spoken language. Grammar and
punctuation exist for a reason: so we can clearly understand each other when we
write things down
➔  Following a standard means people understand what you’re trying to say
You Duplicate Code
“You're doing it wrong.”
➔  Look at every single piece of your app as something that will need to change at
some point
➔  If you have to update more than one file, it’s time to re evaluate how you write code
Don’t Repeat Yourself (DRY) -- "Every piece of knowledge must have a single, unambiguous,
authoritative representation within a system."
You Don’t Follow a Development Pattern
“You should always have a structure when you code.”
➔  You should know how to classify components and where they should go
➔  By following a logical development pattern, many decisions become automatic, and
someone coming to your code doesn’t have to guess much when looking for a
certain functionality in your codebase
You are Too Clever for Your Own Good
“The simplest solution is usually the most appropriate”
➔  Resist the urge to force a complex solution into a space where a simple one is
sufficient
➔  Avoid overcomplicating things
➔  Don’t think your way is better just because it’s your way
You’re a Wang
“Avoid actively making your code hard to understand at all costs.”
You’re a Wang
“Avoid actively making your code hard to understand at all costs.”
Dude, What are you Talking About?
“If you stop learning, then the projects you work on are stuck in whatever time period
you decided to settle.”
➔  You lack continued learning and forward progress
Technology isn’t changing because the community at a large is bored and we decide
to redecorate; most new technologies emerge to more efficiently and easily solve
existing problems.
You’re Trying to Do it All Yourself
“Find out which of these programmers have a similar approach and let them fill you in
on the big news.”
➔  Take time to find out a programmer that has a similar approach and style
You’re Not Out of Your Comfort Zone
“I simply mean to suggest that you'll feel more fulfilled as a programmer and see your
talents progress more and more if you choose to always be looking to the next level
of programming.”
➔  Find new challenges within projects
➔  Try not to settle in and convince yourself you’ve learned everything you’re going to
learn
➔  Try out a new concept that you’re not quite comfortable with
You’re Not Sharing
“Always discuss your code with your fellow programmers.”
➔  Write a tutorial or release an open-source project
➔  Hangout on a community forum and offer help to the newcomers
e.g. StackOverflow.com
Usually, if you post a solution that could be optimized, other experienced
programmers are going to hop in and offer tweaks.
You Don’t Have Any Side Projects
➔  Start a new project that uses the technique you’ve learned
Questions?
Source
➔  http://code.tutsplus.com/tutorials/why-youre-a-bad-php-
programmer--net-18384

More Related Content

What's hot

2013 09-11 java zone - extreme programming live
2013 09-11 java zone - extreme programming live2013 09-11 java zone - extreme programming live
2013 09-11 java zone - extreme programming live
Johannes Brodwall
 
JAZOON'13 - Sven Peters - How to do Kick-Ass Software Development
JAZOON'13 - Sven Peters - How to do Kick-Ass Software DevelopmentJAZOON'13 - Sven Peters - How to do Kick-Ass Software Development
JAZOON'13 - Sven Peters - How to do Kick-Ass Software Development
jazoon13
 

What's hot (20)

Teamleader testcon 2019
Teamleader testcon 2019Teamleader testcon 2019
Teamleader testcon 2019
 
Agile xp crash_course_2010_05_21
Agile xp crash_course_2010_05_21Agile xp crash_course_2010_05_21
Agile xp crash_course_2010_05_21
 
Amanda Cinnamon - Treat Your Code Like the Valuable Software It Is
Amanda Cinnamon - Treat Your Code Like the Valuable Software It IsAmanda Cinnamon - Treat Your Code Like the Valuable Software It Is
Amanda Cinnamon - Treat Your Code Like the Valuable Software It Is
 
Scala Days Chicago 2017: Building a Company on Scala
Scala Days Chicago 2017: Building a Company on ScalaScala Days Chicago 2017: Building a Company on Scala
Scala Days Chicago 2017: Building a Company on Scala
 
Intro to devops - Begin with End in Mind
Intro to devops - Begin with End in MindIntro to devops - Begin with End in Mind
Intro to devops - Begin with End in Mind
 
Is Groovy better for testing than Java?
Is Groovy better for testing than Java?Is Groovy better for testing than Java?
Is Groovy better for testing than Java?
 
Random thoughts and dev practices / advices to build a great product
Random thoughts and dev practices / advices to build a great productRandom thoughts and dev practices / advices to build a great product
Random thoughts and dev practices / advices to build a great product
 
Code Review Matters and Manners
Code Review Matters and MannersCode Review Matters and Manners
Code Review Matters and Manners
 
DevOps Anti-Patterns
DevOps Anti-PatternsDevOps Anti-Patterns
DevOps Anti-Patterns
 
Agille Testing Meetup 1
Agille Testing Meetup 1Agille Testing Meetup 1
Agille Testing Meetup 1
 
2013 09-11 java zone - extreme programming live
2013 09-11 java zone - extreme programming live2013 09-11 java zone - extreme programming live
2013 09-11 java zone - extreme programming live
 
Striving for zero bugs
Striving for zero bugsStriving for zero bugs
Striving for zero bugs
 
Technical Mentoring, What works and not
Technical Mentoring, What works and notTechnical Mentoring, What works and not
Technical Mentoring, What works and not
 
#SydPHP - Pull Requests - The Good, The Bad & The Ugly
#SydPHP - Pull Requests - The Good, The Bad & The Ugly#SydPHP - Pull Requests - The Good, The Bad & The Ugly
#SydPHP - Pull Requests - The Good, The Bad & The Ugly
 
TestWorksConf: Experience exploratory testing
TestWorksConf: Experience exploratory testingTestWorksConf: Experience exploratory testing
TestWorksConf: Experience exploratory testing
 
How I help others to level up technical practices
How I help others to level up technical practicesHow I help others to level up technical practices
How I help others to level up technical practices
 
JAZOON'13 - Sven Peters - How to do Kick-Ass Software Development
JAZOON'13 - Sven Peters - How to do Kick-Ass Software DevelopmentJAZOON'13 - Sven Peters - How to do Kick-Ass Software Development
JAZOON'13 - Sven Peters - How to do Kick-Ass Software Development
 
Agile Software Development for Non-Developers
Agile Software Development for Non-DevelopersAgile Software Development for Non-Developers
Agile Software Development for Non-Developers
 
corporateJavascript
corporateJavascriptcorporateJavascript
corporateJavascript
 
Charts, PDFs, and PHP
Charts, PDFs, and PHPCharts, PDFs, and PHP
Charts, PDFs, and PHP
 

Viewers also liked

τευχος 3
τευχος 3τευχος 3
τευχος 3
litsageor
 

Viewers also liked (10)

MVC Web Application
MVC Web ApplicationMVC Web Application
MVC Web Application
 
τευχος 3
τευχος 3τευχος 3
τευχος 3
 
Software Testing
Software TestingSoftware Testing
Software Testing
 
Redis Set Go
Redis Set GoRedis Set Go
Redis Set Go
 
1 100 rumput
1 100 rumput1 100 rumput
1 100 rumput
 
Mysql Optimization
Mysql OptimizationMysql Optimization
Mysql Optimization
 
A Review of the Top 10 Dentists in Puyallup, WA
A Review of the Top 10 Dentists in Puyallup, WAA Review of the Top 10 Dentists in Puyallup, WA
A Review of the Top 10 Dentists in Puyallup, WA
 
AfNetworking vs. Native + Caching
AfNetworking vs. Native + CachingAfNetworking vs. Native + Caching
AfNetworking vs. Native + Caching
 
Glucose Plant,Ring Dryer,Evaporation Plant,Turnkey Projects
Glucose Plant,Ring Dryer,Evaporation Plant,Turnkey ProjectsGlucose Plant,Ring Dryer,Evaporation Plant,Turnkey Projects
Glucose Plant,Ring Dryer,Evaporation Plant,Turnkey Projects
 
Code Review for iOS
Code Review for iOSCode Review for iOS
Code Review for iOS
 

Similar to Why You're A Bad PHP Programmer

Agile Methodologies And Extreme Programming - Svetlin Nakov
Agile Methodologies And Extreme Programming - Svetlin NakovAgile Methodologies And Extreme Programming - Svetlin Nakov
Agile Methodologies And Extreme Programming - Svetlin Nakov
Svetlin Nakov
 
Finding balance of DDD while your application grows
Finding balance of DDD while your application growsFinding balance of DDD while your application grows
Finding balance of DDD while your application grows
Carolina Karklis
 

Similar to Why You're A Bad PHP Programmer (20)

CPP16 - Object Design
CPP16 - Object DesignCPP16 - Object Design
CPP16 - Object Design
 
Cinci ug-january2011-anti-patterns
Cinci ug-january2011-anti-patternsCinci ug-january2011-anti-patterns
Cinci ug-january2011-anti-patterns
 
What schools should be teaching IT students
What schools should be teaching IT studentsWhat schools should be teaching IT students
What schools should be teaching IT students
 
Agile Software Development
Agile Software DevelopmentAgile Software Development
Agile Software Development
 
Designer vs Developer
Designer vs DeveloperDesigner vs Developer
Designer vs Developer
 
Code reviews
Code reviewsCode reviews
Code reviews
 
Software Design Notes
Software Design NotesSoftware Design Notes
Software Design Notes
 
Overcoming the Fear of Contributing to Open Source
Overcoming the Fear of Contributing to Open SourceOvercoming the Fear of Contributing to Open Source
Overcoming the Fear of Contributing to Open Source
 
It's XP Stupid (2019)
It's XP Stupid (2019)It's XP Stupid (2019)
It's XP Stupid (2019)
 
It's XP, Stupid
It's XP, StupidIt's XP, Stupid
It's XP, Stupid
 
Technical Writing Overview: WTD Nigeria
Technical Writing Overview: WTD NigeriaTechnical Writing Overview: WTD Nigeria
Technical Writing Overview: WTD Nigeria
 
Agile Methodologies And Extreme Programming - Svetlin Nakov
Agile Methodologies And Extreme Programming - Svetlin NakovAgile Methodologies And Extreme Programming - Svetlin Nakov
Agile Methodologies And Extreme Programming - Svetlin Nakov
 
Generic or specific? Making sensible software design decisions
 Generic or specific? Making sensible software design decisions  Generic or specific? Making sensible software design decisions
Generic or specific? Making sensible software design decisions
 
Generic or specific? Making sensible software design decisions
Generic or specific? Making sensible software design decisions Generic or specific? Making sensible software design decisions
Generic or specific? Making sensible software design decisions
 
From VB Script to PowerShell
From VB Script to PowerShellFrom VB Script to PowerShell
From VB Script to PowerShell
 
JUG CH December 2022 - Generic or specific?
JUG CH December 2022 - Generic or specific?JUG CH December 2022 - Generic or specific?
JUG CH December 2022 - Generic or specific?
 
Untangling spring week8
Untangling spring week8Untangling spring week8
Untangling spring week8
 
Finding balance of DDD while your application grows
Finding balance of DDD while your application growsFinding balance of DDD while your application grows
Finding balance of DDD while your application grows
 
Generic or specific? Making sensible software design decisions
Generic or specific? Making sensible software design decisionsGeneric or specific? Making sensible software design decisions
Generic or specific? Making sensible software design decisions
 
How to code
How to codeHow to code
How to code
 

More from KLabCyscorpions-TechBlog (7)

Object Calisthenics in Objective-C
Object Calisthenics in Objective-CObject Calisthenics in Objective-C
Object Calisthenics in Objective-C
 
Auto Layout on Xcode 5
Auto Layout on Xcode 5Auto Layout on Xcode 5
Auto Layout on Xcode 5
 
Object Calisthenics
Object CalisthenicsObject Calisthenics
Object Calisthenics
 
Redis Beyond
Redis BeyondRedis Beyond
Redis Beyond
 
X-Debug in Php Storm
X-Debug in Php StormX-Debug in Php Storm
X-Debug in Php Storm
 
Php + MySql Optimization
Php + MySql OptimizationPhp + MySql Optimization
Php + MySql Optimization
 
Bash
BashBash
Bash
 

Recently uploaded

Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptx
negromaestrong
 
Making and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfMaking and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdf
Chris Hunter
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
kauryashika82
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
QucHHunhnh
 

Recently uploaded (20)

Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibit
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot Graph
 
PROCESS RECORDING FORMAT.docx
PROCESS      RECORDING        FORMAT.docxPROCESS      RECORDING        FORMAT.docx
PROCESS RECORDING FORMAT.docx
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.
 
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptxINDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
 
Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptx
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdf
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17
 
Asian American Pacific Islander Month DDSD 2024.pptx
Asian American Pacific Islander Month DDSD 2024.pptxAsian American Pacific Islander Month DDSD 2024.pptx
Asian American Pacific Islander Month DDSD 2024.pptx
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...
 
Making and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfMaking and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdf
 
Role Of Transgenic Animal In Target Validation-1.pptx
Role Of Transgenic Animal In Target Validation-1.pptxRole Of Transgenic Animal In Target Validation-1.pptx
Role Of Transgenic Animal In Target Validation-1.pptx
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
 
psychiatric nursing HISTORY COLLECTION .docx
psychiatric  nursing HISTORY  COLLECTION  .docxpsychiatric  nursing HISTORY  COLLECTION  .docx
psychiatric nursing HISTORY COLLECTION .docx
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docx
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptx
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 

Why You're A Bad PHP Programmer

  • 1. Why You’re a Bad PHP Programmer Presented by: Aubrey
  • 2. You Don’t Plan Before You Start Coding “Before you write a single line of code, you should have a solid plan of attack.” ➔  Write an outline in comments first ➔  Plan out an entire application using this.. ➔  If there comes a feature that requires a functionality tweak, just change the comment
  • 3. You Don’t Comment Anything “Five seconds at a time will add up in a big way.” ➔  The single worst problem with most code is that it’s poorly commented or not commented at all Code without comment Code with comment
  • 4. You Sacrifice Clarity for Brevity “Good examples of sacrificing clarity for brevity include unclear variable names and dropping the curly braces.” ➔  Example of sacrificing clarity for brevity include short, unclear variable names (such as $a) and dropping the curly braces
  • 5. You Sacrifice Clarity for Brevity ➔  Adding curly braces adds a few lines, but it clarifies the statement immensely
  • 6. You Don’t Follow a Coding Standard “Choose a standard and stick to it.” ➔  Choose a standard (e.g. PSR - 1, PSR - 2) and stick to it ➔  When it comes to programming, think of it like a spoken language. Grammar and punctuation exist for a reason: so we can clearly understand each other when we write things down ➔  Following a standard means people understand what you’re trying to say
  • 7. You Duplicate Code “You're doing it wrong.” ➔  Look at every single piece of your app as something that will need to change at some point ➔  If you have to update more than one file, it’s time to re evaluate how you write code Don’t Repeat Yourself (DRY) -- "Every piece of knowledge must have a single, unambiguous, authoritative representation within a system."
  • 8. You Don’t Follow a Development Pattern “You should always have a structure when you code.” ➔  You should know how to classify components and where they should go ➔  By following a logical development pattern, many decisions become automatic, and someone coming to your code doesn’t have to guess much when looking for a certain functionality in your codebase
  • 9. You are Too Clever for Your Own Good “The simplest solution is usually the most appropriate” ➔  Resist the urge to force a complex solution into a space where a simple one is sufficient ➔  Avoid overcomplicating things ➔  Don’t think your way is better just because it’s your way
  • 10. You’re a Wang “Avoid actively making your code hard to understand at all costs.”
  • 11. You’re a Wang “Avoid actively making your code hard to understand at all costs.”
  • 12. Dude, What are you Talking About? “If you stop learning, then the projects you work on are stuck in whatever time period you decided to settle.” ➔  You lack continued learning and forward progress Technology isn’t changing because the community at a large is bored and we decide to redecorate; most new technologies emerge to more efficiently and easily solve existing problems.
  • 13. You’re Trying to Do it All Yourself “Find out which of these programmers have a similar approach and let them fill you in on the big news.” ➔  Take time to find out a programmer that has a similar approach and style
  • 14. You’re Not Out of Your Comfort Zone “I simply mean to suggest that you'll feel more fulfilled as a programmer and see your talents progress more and more if you choose to always be looking to the next level of programming.” ➔  Find new challenges within projects ➔  Try not to settle in and convince yourself you’ve learned everything you’re going to learn ➔  Try out a new concept that you’re not quite comfortable with
  • 15. You’re Not Sharing “Always discuss your code with your fellow programmers.” ➔  Write a tutorial or release an open-source project ➔  Hangout on a community forum and offer help to the newcomers e.g. StackOverflow.com Usually, if you post a solution that could be optimized, other experienced programmers are going to hop in and offer tweaks.
  • 16. You Don’t Have Any Side Projects ➔  Start a new project that uses the technique you’ve learned