SlideShare uma empresa Scribd logo
1 de 20
Why are you coding like this?
Self Introduction
Oriented By: YOEUNG Vibol
Working at Webridge Technologies
Skype: vibol.yoeung
Email: yoeung.vibol@gmail.com

Why we care about code?

What we need to care?

What can help?

How to format html&css code

How to format php code

Techniques to write code

Question and Answer
Agenda
Why we care about code?
l
Easy to read
l
Easy to maintenance
l
Enjoy coding
l
Standard and professional
l
…....
What we need to care?
l
Naming convention
l
Indention
l
Tab
l
Split line
l
Enjoy coding
l
Trailing white space
What can help?
l
IDE
l
Sublime text
l
Eclipse
l
Netbean
l
…......
l
Yourself
l
Code reviewer
How to formate html&css code?
Bad code!!!
How to formate html&css code?
Good code!!!
How to formate html&css code?
Bad code!!!
How to formate html&css code?
Good code!!!
How to formate php code?
l Class names MUST be declared in
Upper Camel Case
l Class constants MUST be declared in all
upper case with underscore separators.
l Method names MUST be declared in
camelCase
l Code MUST use 4 spaces for indenting,
not tabs.
How to formate php code?
l lines SHOULD be 80 characters or less
l New line for Open & close braces for
class method
l The PHP constants true, false, and null
MUST be in lower case.
l Add comment for all method
l Always open with <?php and close
with ?>
How to format php code?
Sample
Technique to write code
Yoga conditions
Use Yoga conditions
•
Right side variable, left side constant or literal.
•
Prevents assignment
•
Prevents logic error
Technique to write code
Count in for loop
Technique to write code
Single quote VS double quote
Technique to write code
Boolean VS integer
Technique to write code
Type juggling
“PHP does not support type definition …
type is determined by context...”
Question(s) and Answer(s)
References
https://google.github.io/styleguide/htmlcssguide.xml
http://www.php-fig.org/psr/psr-1/
http://www.php-fig.org/psr/psr-2/

Mais conteúdo relacionado

Destaque

Vinda da Família Real ao Brasil
Vinda da Família Real ao BrasilVinda da Família Real ao Brasil
Vinda da Família Real ao BrasilRayan Gomes
 
Revoca concessione sai_8_-_documento_-consorzio_ato_delib_121
Revoca concessione sai_8_-_documento_-consorzio_ato_delib_121Revoca concessione sai_8_-_documento_-consorzio_ato_delib_121
Revoca concessione sai_8_-_documento_-consorzio_ato_delib_121Stefano Battiato
 
From ExactSource- Rules Regatding Admission of Expert Witness Testimony
From ExactSource- Rules Regatding Admission of Expert Witness TestimonyFrom ExactSource- Rules Regatding Admission of Expert Witness Testimony
From ExactSource- Rules Regatding Admission of Expert Witness TestimonyChuck Detling
 
Dona guidinha do poço
Dona guidinha do poçoDona guidinha do poço
Dona guidinha do poçoRayan Gomes
 
Ejercicios
EjerciciosEjercicios
EjerciciosCECY50
 
Etica y cultura politica
Etica y cultura politicaEtica y cultura politica
Etica y cultura politicaDanielpardo28
 
Building englishville together
Building englishville togetherBuilding englishville together
Building englishville togethermarcschulz
 
House snail leads_the_list_of_strange_buildings
House snail leads_the_list_of_strange_buildingsHouse snail leads_the_list_of_strange_buildings
House snail leads_the_list_of_strange_buildingsMariaChobanova
 

Destaque (16)

Vinda da Família Real ao Brasil
Vinda da Família Real ao BrasilVinda da Família Real ao Brasil
Vinda da Família Real ao Brasil
 
Miguel Maestripieri video 5 amigos
Miguel Maestripieri video 5 amigosMiguel Maestripieri video 5 amigos
Miguel Maestripieri video 5 amigos
 
Revoca concessione sai_8_-_documento_-consorzio_ato_delib_121
Revoca concessione sai_8_-_documento_-consorzio_ato_delib_121Revoca concessione sai_8_-_documento_-consorzio_ato_delib_121
Revoca concessione sai_8_-_documento_-consorzio_ato_delib_121
 
Man
ManMan
Man
 
From ExactSource- Rules Regatding Admission of Expert Witness Testimony
From ExactSource- Rules Regatding Admission of Expert Witness TestimonyFrom ExactSource- Rules Regatding Admission of Expert Witness Testimony
From ExactSource- Rules Regatding Admission of Expert Witness Testimony
 
Dona guidinha do poço
Dona guidinha do poçoDona guidinha do poço
Dona guidinha do poço
 
MySQL vs. MonetDB
MySQL vs. MonetDBMySQL vs. MonetDB
MySQL vs. MonetDB
 
Ensayo historia iv
Ensayo historia ivEnsayo historia iv
Ensayo historia iv
 
Vitaminas
VitaminasVitaminas
Vitaminas
 
Ejercicios
EjerciciosEjercicios
Ejercicios
 
Etica profissional
Etica profissionalEtica profissional
Etica profissional
 
Etica y cultura politica
Etica y cultura politicaEtica y cultura politica
Etica y cultura politica
 
Pamukkale
PamukkalePamukkale
Pamukkale
 
Plovdiv
PlovdivPlovdiv
Plovdiv
 
Building englishville together
Building englishville togetherBuilding englishville together
Building englishville together
 
House snail leads_the_list_of_strange_buildings
House snail leads_the_list_of_strange_buildingsHouse snail leads_the_list_of_strange_buildings
House snail leads_the_list_of_strange_buildings
 

Semelhante a Why are you coding like this?

Good code, Bad Code
Good code, Bad CodeGood code, Bad Code
Good code, Bad Codejosedasilva
 
高品質軟體的基本動作 101 + 102 for NUU
高品質軟體的基本動作 101 + 102 for NUU高品質軟體的基本動作 101 + 102 for NUU
高品質軟體的基本動作 101 + 102 for NUUSu Jan
 
Code quality as a built-in process
Code quality as a built-in processCode quality as a built-in process
Code quality as a built-in processElad Maimon
 
TDD - Cultivating a Beginner's Mind
TDD -  Cultivating a Beginner's MindTDD -  Cultivating a Beginner's Mind
TDD - Cultivating a Beginner's MindShai Yallin
 
Whats Preventing Me To Write Nearly Accurate Code.Key
Whats Preventing Me To Write Nearly Accurate Code.KeyWhats Preventing Me To Write Nearly Accurate Code.Key
Whats Preventing Me To Write Nearly Accurate Code.Keynhm taveer hossain khan
 
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
 
Introduction to software craftsmanship
Introduction to software craftsmanshipIntroduction to software craftsmanship
Introduction to software craftsmanshipAlexandru Bolboaca
 
what bout ExpressionEngine
what bout ExpressionEnginewhat bout ExpressionEngine
what bout ExpressionEnginesand_man
 
WordPress Coding Standards & WP Hooks
WordPress Coding Standards & WP HooksWordPress Coding Standards & WP Hooks
WordPress Coding Standards & WP HooksEunus Hosen
 
API Centric Development in PHP
API Centric Development in PHPAPI Centric Development in PHP
API Centric Development in PHPJoe Stagner
 
What is code - Part 1
What is code - Part 1What is code - Part 1
What is code - Part 1Nandeep Mali
 
高品質軟體的基本動作 101 for NTHU
高品質軟體的基本動作 101 for NTHU高品質軟體的基本動作 101 for NTHU
高品質軟體的基本動作 101 for NTHUSu Jan
 
TDC 2020 - Implementing a Mini-Language
TDC 2020 - Implementing a Mini-LanguageTDC 2020 - Implementing a Mini-Language
TDC 2020 - Implementing a Mini-LanguageLuciano Sabença
 
Writing clean code in C# and .NET
Writing clean code in C# and .NETWriting clean code in C# and .NET
Writing clean code in C# and .NETDror Helper
 
Pertemuan 1 - Introduction to Frontend Engineer.pdf
Pertemuan 1 - Introduction to Frontend Engineer.pdfPertemuan 1 - Introduction to Frontend Engineer.pdf
Pertemuan 1 - Introduction to Frontend Engineer.pdfRaffiPratama3
 

Semelhante a Why are you coding like this? (20)

Good code, Bad Code
Good code, Bad CodeGood code, Bad Code
Good code, Bad Code
 
CLEAN WEB
CLEAN WEBCLEAN WEB
CLEAN WEB
 
高品質軟體的基本動作 101 + 102 for NUU
高品質軟體的基本動作 101 + 102 for NUU高品質軟體的基本動作 101 + 102 for NUU
高品質軟體的基本動作 101 + 102 for NUU
 
Code quality as a built-in process
Code quality as a built-in processCode quality as a built-in process
Code quality as a built-in process
 
TDD - Cultivating a Beginner's Mind
TDD -  Cultivating a Beginner's MindTDD -  Cultivating a Beginner's Mind
TDD - Cultivating a Beginner's Mind
 
Make a better with clean code
Make a better with clean codeMake a better with clean code
Make a better with clean code
 
Whats Preventing Me To Write Nearly Accurate Code.Key
Whats Preventing Me To Write Nearly Accurate Code.KeyWhats Preventing Me To Write Nearly Accurate Code.Key
Whats Preventing Me To Write Nearly Accurate Code.Key
 
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
 
Introduction to software craftsmanship
Introduction to software craftsmanshipIntroduction to software craftsmanship
Introduction to software craftsmanship
 
what bout ExpressionEngine
what bout ExpressionEnginewhat bout ExpressionEngine
what bout ExpressionEngine
 
WordPress Coding Standards & WP Hooks
WordPress Coding Standards & WP HooksWordPress Coding Standards & WP Hooks
WordPress Coding Standards & WP Hooks
 
API Centric Development in PHP
API Centric Development in PHPAPI Centric Development in PHP
API Centric Development in PHP
 
What is code - Part 1
What is code - Part 1What is code - Part 1
What is code - Part 1
 
Refactoring legacy code
Refactoring legacy codeRefactoring legacy code
Refactoring legacy code
 
Clean Code Style
Clean Code StyleClean Code Style
Clean Code Style
 
高品質軟體的基本動作 101 for NTHU
高品質軟體的基本動作 101 for NTHU高品質軟體的基本動作 101 for NTHU
高品質軟體的基本動作 101 for NTHU
 
TDC 2020 - Implementing a Mini-Language
TDC 2020 - Implementing a Mini-LanguageTDC 2020 - Implementing a Mini-Language
TDC 2020 - Implementing a Mini-Language
 
Web ninja
Web ninjaWeb ninja
Web ninja
 
Writing clean code in C# and .NET
Writing clean code in C# and .NETWriting clean code in C# and .NET
Writing clean code in C# and .NET
 
Pertemuan 1 - Introduction to Frontend Engineer.pdf
Pertemuan 1 - Introduction to Frontend Engineer.pdfPertemuan 1 - Introduction to Frontend Engineer.pdf
Pertemuan 1 - Introduction to Frontend Engineer.pdf
 

Último

"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxLoriGlavin3
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningLars Bell
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embeddingZilliz
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersRaghuram Pandurangan
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionDilum Bandara
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
What is Artificial Intelligence?????????
What is Artificial Intelligence?????????What is Artificial Intelligence?????????
What is Artificial Intelligence?????????blackmambaettijean
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESmohitsingh558521
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxLoriGlavin3
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 

Último (20)

"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embedding
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information Developers
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An Introduction
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
What is Artificial Intelligence?????????
What is Artificial Intelligence?????????What is Artificial Intelligence?????????
What is Artificial Intelligence?????????
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 

Why are you coding like this?