[SARAN] standar PSR + fitur baru PHP

Oleh jowy 10 6 pada Sabtu, 30 Agu 2014, 19:17:47


Kembali ke forum umum


Petunjuk Diskusi
Silahkan masuk untuk berdiskusi



Klo bisa di include kan sekalian standard PSR dalam course. Dan tambahkan course baru untuk belajar fitur fitur baru dalam PHP versi 5.3 keatas
1 jempol




ganis
198
839
· 9 tahun, 7 bulan yang lalu · 0 jempol

Halo @jowy, salam kenal!

Hm, standar PSR apa ya? >_< idenya bagus, karena namanya coder itu seharusnya selalu update, fitur2 barunya yg seperti apa ya?

jowy
10
6
penanya
· 9 tahun, 7 bulan yang lalu · 0 jempol

standard naming convention di PHP coba dilihat lihat di http://www.php-fig.org/

jowy
10
6
penanya
· 9 tahun, 7 bulan yang lalu · 0 jempol

fitur fitur baru di php : namespace, traits, generators, closure, internal webserver, short syntax array

vchezt
208
11
· 9 tahun, 7 bulan yang lalu · 0 jempol

PSR:
P = PHP
S = STANDAR
R = REQUEST http://petermoulding.com/php/psr

vchezt
208
11
· 9 tahun, 7 bulan yang lalu · 0 jempol

PSR:
P = PHP
S = STANDAR
R = REQUEST http://petermoulding.com/php/psr

vchezt
208
11
· 9 tahun, 7 bulan yang lalu · 0 jempol

dan PSR itu di deklarasikan oleh  Framework Interop Group tujuannya untuk kesamman dalam pembuatan framework agar liblary satu sama lainnya antar framework anggotanya bisa saling berhubungan atau di pake bareng alias suitable sesuai setandar mereka yang sudah jadi anggotanya... itu sih hasil saya google dan melihat sana-sini

jowy
10
6
penanya
· 9 tahun, 7 bulan yang lalu · 0 jempol

bener yang saya maksir PSR yang dari Framework Interop Group. Dengan belajar dan mematuhi standar tsb kalo mau ganti framework ga begitu susah

vchezt
208
11
· 9 tahun, 7 bulan yang lalu · 0 jempol

jadi kaya "the new wolrd order" yah, aturannya sampai ke detai style pengkodean, dan dunia php framework pun dikuasi oleh satu kelompok :D

vchezt
208
11
· 9 tahun, 7 bulan yang lalu · 0 jempol

PSR-1:
1. Ensure that PSR-0 is enforced
2. Class names are written using StudlyCase
3. Constants are defined in UPPERCASE_WITH_UNDERSCORE separators
4. Function names are defined in camelCase
5. Do not use shorthand PHP tags
6. Use UTF-8 encoding
7. Make sure that output, access the the database, and other such code are separated from the made code

PSR-2:
1. Code should use four spaces for indenting (rather than tabs)
2. Lines should be 80 characters or less (with a software limit at 120 characters)
3. Opening braces must go on the next line after the function definition
4. Closing braces must go on the next line after the function body
5. Control structure keywords must have one space after them; method and function calls must not
6. …and so on

jowy
10
6
penanya
· 9 tahun, 7 bulan yang lalu · 0 jempol

iya :D biar ada aturannya developer lain juga bisa ngerti. Sama kayak java ada naming conventionnya