Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Suitmedia PHP Coding Style
Search
Edwin Lunando
September 28, 2014
Technology
340
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Suitmedia PHP Coding Style
The PHP coding guideline for Suitmedia developer
Edwin Lunando
September 28, 2014
Transcript
11 slides
PHP Coding Style
[email protected]
[email protected]
Why? Everyone can easily read your codes just like reading
their own codes
Spaces is Better than Tabs 4 spaces per indent All
Editors have the same indent width Prettier code on Git
No ?> In The End of File Only for file
with all PHP codes Avoid additional new lines in generated document
One Statement Per Line Easier to see changes with side-by-side
diff
Multiple Line Argument Lists One argument per line Use when
have long argument lists
Position of Opening and Closing Braces Class and Function declaration
in new line Control Structures in the same line
Explicit Declaration of Visibility public or protected or private or
abstract or static or final
Camel Case for Method wowSuchMethod, muchCamel, soCase
Friendly Variable Names With Underscore Avoid $j, $i, $asd, $abc,
$temp Use $join_table, $counter_product, $temp_collection
Thank You source: www.php-fig.org
More Decks by Edwin Lunando
See All by Edwin Lunando
Python di Industri
edwinlunando
0
71
HTTP 2 - Geekcamp
edwinlunando
1
170
Python ID Meetup Oktober 2015
edwinlunando
0
120
Python ID Meetup Agustus 2015
edwinlunando
0
420
Python ID Meetup Juni 2015
edwinlunando
0
65
Python ID Meetup April 2015
edwinlunando
0
120
Python 101 Workshop
edwinlunando
0
450
Python ID Meetup February 2015
edwinlunando
0
280
Intro to django-naomi
edwinlunando
0
620
Other Decks in Technology
See All in Technology
成長するID管理基盤における運用もコストも犠牲にしないオブザーバビリティ向上の実践 / Improving Observability for a Growing Identity Platform Without Adding Operational Burden or Cost
kaminashi
1
150
一口馬主の募集馬をAIで診断してみた
yoshimura_datam
0
120
NutanixへのSSHアクセスの今後について
shadowhat
0
190
フロントエンドのテストカバレッジは 100%強制がいい
bengo4com
7
4k
競馬予想をAIでやってみた話
yoshimura_datam
0
160
エンタープライズIAMについて - ID・権限をどう統制するか
oidfj
1
360
40以上のマイクロサービスを支えるKubernetes JITアクセス — 160以上の恒久RoleBindingを削減
jumpe1
0
110
想定外の利用がプロダクトの価値を広げる
lycorptech_jp
PRO
0
140
「それ、AIでよくない?」- AI時代の技術発信はオワコンなのか?
estie
1
110
設計手法を「道具」として使いこなすために
a_suenami
7
1.8k
信頼性を犠牲にせず、PR マージからデプロイまで人の介入を完全にゼロにするまでの道のり
knwoop
4
2.2k
その修正で本当に速くなったのか? k6とOpenTelemetryで確かめる性能改善 / Performance review with k6 and OpenTelemetry
ymotongpoo
3
490
Featured
See All Featured
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
659
62k
Java REST API Framework Comparison - PWX 2021
mraible
34
9.8k
Design of three-dimensional binary manipulators for pick-and-place task avoiding obstacles (IECON2024)
konakalab
0
680
YesSQL, Process and Tooling at Scale
rocio
174
15k
The Spectacular Lies of Maps
axbom
PRO
1
1.2k
Digital Projects Gone Horribly Wrong (And the UX Pros Who Still Save the Day) - Dean Schuster
uxyall
2
4.1k
How to Grow Your eCommerce with AI & Automation
katarinadahlin
PRO
2
360
30 Presentation Tips
portentint
PRO
1
480
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
47
8.4k
DBのスキルで生き残る技術 - AI時代におけるテーブル設計の勘所
soudai
PRO
68
61k
Leadership Guide Workshop - DevTernity 2021
reverentgeek
1
440
How to train your dragon (web standard)
notwaldorf
96
6.9k