Clean Code


} // try catch (IOException e) { System.err.println("Error:" + e.getMessage()); } //catch



Download 3,58 Mb.
Pdf ko'rish
bet85/384
Sana05.04.2022
Hajmi3,58 Mb.
#530298
1   ...   81   82   83   84   85   86   87   88   ...   384
Bog'liq
Clean Code

} // try
catch (IOException e) {
System.err.println("Error:" + e.getMessage());
} //catch
} //main
}
Listing 4-6 (continued)
wc.java


69
Bad Comments
else {
this.pngBytes = null;
}
return this.pngBytes;
Why are those two lines of code commented? Are they important? Were they left as
reminders for some imminent change? Or are they just cruft that someone commented-out
years ago and has simply not bothered to clean up.
There was a time, back in the sixties, when commenting-out code might have been
useful. But we’ve had good source code control systems for a very long time now. Those
systems will remember the code for us. We don’t have to comment it out any more. Just
delete the code. We won’t lose it. Promise.
HTML Comments
HTML in source code comments is an abomination, as you can tell by reading the code
below. It makes the comments hard to read in the one place where they should be easy to
read—the editor/IDE. If comments are going to be extracted by some tool (like Javadoc) to
appear in a Web page, then it should be the responsibility of that tool, and not the program-
mer, to adorn the comments with appropriate HTML.
/**
* Task to run fit tests. 
* This task runs fitnesse tests and publishes the results.
*
*
* Usage:
* <taskdef name="execute-fitnesse-tests" 
* classname="fitnesse.ant.ExecuteFitnesseTestsTask" 
* classpathref="classpath" />
* OR
* <taskdef classpathref="classpath" 
* resource="tasks.properties" />
*
* <execute-fitnesse-tests 
* suitepage="FitNesse.SuiteAcceptanceTests" 
* fitnesseport="8082" 
* resultsdir="${results.dir}" 
* resultshtmlpage="fit-results.html" 
* classpathref="classpath" />
*
*/

Download 3,58 Mb.

Do'stlaringiz bilan baham:
1   ...   81   82   83   84   85   86   87   88   ...   384




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©hozir.org 2024
ma'muriyatiga murojaat qiling

kiriting | ro'yxatdan o'tish
    Bosh sahifa
юртда тантана
Боғда битган
Бугун юртда
Эшитганлар жилманглар
Эшитмадим деманглар
битган бодомлар
Yangiariq tumani
qitish marakazi
Raqamli texnologiyalar
ilishida muhokamadan
tasdiqqa tavsiya
tavsiya etilgan
iqtisodiyot kafedrasi
steiermarkischen landesregierung
asarlaringizni yuboring
o'zingizning asarlaringizni
Iltimos faqat
faqat o'zingizning
steierm rkischen
landesregierung fachabteilung
rkischen landesregierung
hamshira loyihasi
loyihasi mavsum
faolyatining oqibatlari
asosiy adabiyotlar
fakulteti ahborot
ahborot havfsizligi
havfsizligi kafedrasi
fanidan bo’yicha
fakulteti iqtisodiyot
boshqaruv fakulteti
chiqarishda boshqaruv
ishlab chiqarishda
iqtisodiyot fakultet
multiservis tarmoqlari
fanidan asosiy
Uzbek fanidan
mavzulari potok
asosidagi multiservis
'aliyyil a'ziym
billahil 'aliyyil
illaa billahil
quvvata illaa
falah' deganida
Kompyuter savodxonligi
bo’yicha mustaqil
'alal falah'
Hayya 'alal
'alas soloh
Hayya 'alas
mavsum boyicha


yuklab olish