One the major problem for the beginners is the STYLE OF CODING, as it was for me as well. For some of the first few months I was stuck with the standards of different Frameworks and was following them and extracting the best of their styles. But short after I felt that, although they all are very different from each other but they have something in common, their Coding patterns.
Lets Start.
Lets Start.
- First of all Choose your favorite IDE. There are lots of PHP IDE in the markte, like NetBeans, Eclipse, PHPEdit, and lots more, Just Google :). As per my favorite I user NetBeans.
- Always user <?php ?>, to delimit PHP code, not the <? ?> shorthand.
- Use Space instead of Tabs. Use an indent of 4 spaces, with no tabs. This helps to avoid problems with diffs, patches, SVN history and annotations. Moreover Tabs behave differently in different places.
- Always write comments where ever possible, it helps your code to be more friendly for others and for you as well, when ever you read the code again. C style comments (/* */) and standard C++ comments (//) are both fine.
/*
Some comment will go here
*/
// this is also a comment - Use Meaningful, Consistent Naming Conventions. Naming this isn’t just for your own good. There’s nothing worse than trying to find your way through some other programmer’s nonsensical naming conventions. Help yourself and others by using names that make sense for your classes and functions.
- Don' create extra vaiables. Never define unnecessary variables. e.g
// bad
$description = strip_tags($_POST['description']);
echo $description;
// good
echo strip_tags($_POST['description']);
- Use UPPER case for the GLOBAL_CONSTANTS, and use "_" for word separators.
- Align the Declaration blocks for more readability. e.g.
var $mDate; var& $mrDate; var& $mrName; var $mName; $mDate = 0; $mrDate = NULL; $mrName = 0; $mName = NULL;
- Always use the proper directory structure for placing the files. The structure can be any, but must be very handy and self descriptive. i.e Classes should be placed in classes folder only, similarly for the files containing functions in functions folder or what ever name you like. The core idea is always bunch the similar files in folders.
- Last but not the least, Always Turn on Error Reporting. Error reporting in PHP is very helpful. You’ll find bugs in your code that you might not have spotted earlier, as not all bugs keep the application from working. There are different levels of strictness in the reporting that you can use, but E_ALL will show you the most errors, critical and warnings alike.
That's all for today. Thanks Guys.
burdur
ReplyDeletebursa
çanakkale
çankırı
çorum
6327R
https://bayanlarsitesi.com/
ReplyDeleteManisa
Denizli
Malatya
Çankırı
SD8OLR
Iğdır
ReplyDeleteAdana
Karabük
Diyarbakır
Antep
XB6M
https://titandijital.com.tr/
ReplyDeletemanisa parça eşya taşıma
balıkesir parça eşya taşıma
eskişehir parça eşya taşıma
ardahan parça eşya taşıma
7K6XD6
Kastamonu Lojistik
ReplyDeleteYozgat Lojistik
Çorlu Lojistik
Kırşehir Lojistik
Sinop Lojistik
YEWH1
sivas evden eve nakliyat
ReplyDeleteerzurum evden eve nakliyat
bitlis evden eve nakliyat
mardin evden eve nakliyat
rize evden eve nakliyat
456
0B08B
ReplyDeleteMersin Parça Eşya Taşıma
Bitlis Evden Eve Nakliyat
Rize Lojistik
Rize Parça Eşya Taşıma
Ordu Lojistik
1C504
ReplyDeleteEtlik Parke Ustası
Edirne Şehir İçi Nakliyat
Maraş Evden Eve Nakliyat
Çerkezköy Halı Yıkama
Ardahan Evden Eve Nakliyat
Tokat Şehir İçi Nakliyat
Elazığ Lojistik
Kastamonu Parça Eşya Taşıma
Sinop Evden Eve Nakliyat
57C03
ReplyDeleteBitget Güvenilir mi
Kırklareli Şehir İçi Nakliyat
Çerkezköy Koltuk Kaplama
Iğdır Şehirler Arası Nakliyat
Sivas Parça Eşya Taşıma
Bayburt Şehir İçi Nakliyat
Ardahan Şehirler Arası Nakliyat
Erzurum Şehir İçi Nakliyat
Ankara Lojistik
82080
ReplyDeleteRaca Coin Hangi Borsada
Afyon Lojistik
Kastamonu Şehirler Arası Nakliyat
Mersin Şehir İçi Nakliyat
Tekirdağ Boya Ustası
Bayburt Parça Eşya Taşıma
Çerkezköy Çekici
Kırşehir Lojistik
Rize Lojistik
B8B2F
ReplyDeleteİstanbul Evden Eve Nakliyat
testosterone propionat
Çorum Evden Eve Nakliyat
Tekirdağ Fayans Ustası
Kayseri Evden Eve Nakliyat
Yalova Evden Eve Nakliyat
sustanon for sale
Kocaeli Evden Eve Nakliyat
buy clenbuterol
C0474
ReplyDeleteNiğde Parça Eşya Taşıma
Bee Coin Hangi Borsada
Muş Şehirler Arası Nakliyat
Muğla Lojistik
Çankırı Şehirler Arası Nakliyat
Düzce Parça Eşya Taşıma
Aydın Şehir İçi Nakliyat
Muş Lojistik
Eryaman Boya Ustası
01DC0
ReplyDelete%20 binance referans kodu
4ECE3
ReplyDeletevan canli goruntulu sohbet siteleri
parasız görüntülü sohbet
muğla mobil sohbet siteleri
şırnak ucretsiz sohbet
edirne kadınlarla sohbet
eskişehir en iyi görüntülü sohbet uygulamaları
antep kadınlarla rastgele sohbet
tunceli canli goruntulu sohbet siteleri
kayseri ücretsiz sohbet siteleri
C8D7A
ReplyDeletehatay goruntulu sohbet
Denizli Sohbet Muhabbet
parasız görüntülü sohbet uygulamaları
bolu bedava sohbet siteleri
amasya parasız görüntülü sohbet
aydın en iyi ücretsiz sohbet uygulamaları
igdir muhabbet sohbet
ordu ücretsiz sohbet uygulamaları
malatya mobil sohbet sitesi
517C0
ReplyDeleteBinance Yaş Sınırı
Kwai Takipçi Hilesi
Shinja Coin Hangi Borsada
Bitcoin Nasıl Üretilir
Görüntülü Sohbet
Tumblr Beğeni Satın Al
Görüntülü Sohbet Parasız
Kwai Beğeni Hilesi
Discord Sunucu Üyesi Hilesi
D9DAD
ReplyDeleteonekey wallet
web arculus wallet
ledger live web
eigenlayer wallet web
web avax wallet
ellipal
wallet dcent
trust wallet
web ledger wallet
D3F6F
ReplyDeletePazar
Süloğlu
Karapınar
Torbalı
Merzifon
Zile
Erzincan
Alaçam
Şuhut
THGTDYHYTFJ
ReplyDeleteشركة كشف تسربات المياه بالجبيل
شركة تنظيف بخميس مشيط 0OHvWsVAgL
ReplyDeleteشركة تسليك مجاري بالاحساء ZXIAiIhWby
ReplyDeleteشركة صيانة افران 0nRjjVQ22F
ReplyDeleteشركة عزل اسطح بالهفوف 56Dogm3I7d
ReplyDelete