sobota 30. októbra 2010
sobota 23. októbra 2010
piatok 22. októbra 2010
štvrtok 21. októbra 2010
Optimalizácia kódu
M. A. Jackson:
"We follow two rules in the matter of optimizations":
Rule 1. Don't do it.
Rule 2 (for experts only). Don't do it yet - that is, not until you have a perfectly clear and unoptimized solution."
citát z roku 1975...
D. E. Knuth:
"We should forget about small efficiencies, say about 97% of the time: premature optimization is the root of all evil."
interval.cz: Ako na optimalizaciu kódu
"We follow two rules in the matter of optimizations":
Rule 1. Don't do it.
Rule 2 (for experts only). Don't do it yet - that is, not until you have a perfectly clear and unoptimized solution."
citát z roku 1975...
D. E. Knuth:
"We should forget about small efficiencies, say about 97% of the time: premature optimization is the root of all evil."
interval.cz: Ako na optimalizaciu kódu
streda 20. októbra 2010
Dead code
Ďalšia "perla" programátora, ktorá sa nám dostala do rúk...
Long actual=null;
//... kod ktory nemodifikoval premennu actual....
if(actual!=null)
{
putL2Map(retVal, map, actual);
}
utorok 19. októbra 2010
Brutal force crack
try {
try {
vypocitaj();
}
catch(Exception e) {
// skusime este raz
vypocitaj();
}
}
catch(Exception ex) {
System.out.println("Chyba!");
}
new Blog(Boolean, "uspech", true);
Prečo vznikla táto inštancia blogu.
boolean uspech = true;
if(xyData.isR()) {
uspech = xyData.saveRT();
}
if(!uspech) {
return false;
}
// zapametanie dat pre R
uspech = true;
if(RData.isR()) {
uspech = RData.saveRT();
}
if(!uspech) {
return false;
}
// zapametanie dat pre g
if(gData.isG()) {
gData.saveG();
}
// idem zacat, pokial nemam vybrate vsetky, nepokracuj
if(zacat && !validate()) {
return false;
}
Prihlásiť na odber:
Komentáre (Atom)

