vanja cvetković - poincare.matf.bg.ac.rspoincare.matf.bg.ac.rs/~vladaf/courses/matf...

28
Raspored i stil koda Vanja Cvetković

Upload: others

Post on 01-Feb-2020

2 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Vanja Cvetković - poincare.matf.bg.ac.rspoincare.matf.bg.ac.rs/~vladaf/Courses/Matf RS2/Prezentacije/CC 31... · — / £ Use the insertion sort technirÄue to sort the "data" array

Raspored i stil koda Vanja Cvetković

Page 2: Vanja Cvetković - poincare.matf.bg.ac.rspoincare.matf.bg.ac.rs/~vladaf/Courses/Matf RS2/Prezentacije/CC 31... · — / £ Use the insertion sort technirÄue to sort the "data" array
Page 3: Vanja Cvetković - poincare.matf.bg.ac.rspoincare.matf.bg.ac.rs/~vladaf/Courses/Matf RS2/Prezentacije/CC 31... · — / £ Use the insertion sort technirÄue to sort the "data" array
Page 4: Vanja Cvetković - poincare.matf.bg.ac.rspoincare.matf.bg.ac.rs/~vladaf/Courses/Matf RS2/Prezentacije/CC 31... · — / £ Use the insertion sort technirÄue to sort the "data" array

Osnovna teorema formatiranja

“Dobar vizualni raspored pokazuje logičku strukturu

programa.”

Page 5: Vanja Cvetković - poincare.matf.bg.ac.rspoincare.matf.bg.ac.rs/~vladaf/Courses/Matf RS2/Prezentacije/CC 31... · — / £ Use the insertion sort technirÄue to sort the "data" array
Page 6: Vanja Cvetković - poincare.matf.bg.ac.rspoincare.matf.bg.ac.rs/~vladaf/Courses/Matf RS2/Prezentacije/CC 31... · — / £ Use the insertion sort technirÄue to sort the "data" array
Page 7: Vanja Cvetković - poincare.matf.bg.ac.rspoincare.matf.bg.ac.rs/~vladaf/Courses/Matf RS2/Prezentacije/CC 31... · — / £ Use the insertion sort technirÄue to sort the "data" array
Page 8: Vanja Cvetković - poincare.matf.bg.ac.rspoincare.matf.bg.ac.rs/~vladaf/Courses/Matf RS2/Prezentacije/CC 31... · — / £ Use the insertion sort technirÄue to sort the "data" array

Ciljevi dobrog rasporeda

● Tačno predstaviti logičku strukturu koda

● Konzistentno predstaviti logičku strukturu koda

● Unaprediti čitljivost

● Izdržati modifikacije

Page 9: Vanja Cvetković - poincare.matf.bg.ac.rspoincare.matf.bg.ac.rs/~vladaf/Courses/Matf RS2/Prezentacije/CC 31... · — / £ Use the insertion sort technirÄue to sort the "data" array

Alati za uređenje rasporeda

● Beline

– Razmaci

– Tabulatori

– Prazni redovi

● Zagrade

Page 10: Vanja Cvetković - poincare.matf.bg.ac.rspoincare.matf.bg.ac.rs/~vladaf/Courses/Matf RS2/Prezentacije/CC 31... · — / £ Use the insertion sort technirÄue to sort the "data" array

Stilovi raspoređivanja koda

● Čisti blokovi

● Emuliranje čistih blokova

● Korišćenje begin-end

● parova

● Raspoređivanje po

● krajnjoj liniji

Page 11: Vanja Cvetković - poincare.matf.bg.ac.rspoincare.matf.bg.ac.rs/~vladaf/Courses/Matf RS2/Prezentacije/CC 31... · — / £ Use the insertion sort technirÄue to sort the "data" array
Page 12: Vanja Cvetković - poincare.matf.bg.ac.rspoincare.matf.bg.ac.rs/~vladaf/Courses/Matf RS2/Prezentacije/CC 31... · — / £ Use the insertion sort technirÄue to sort the "data" array
Page 13: Vanja Cvetković - poincare.matf.bg.ac.rspoincare.matf.bg.ac.rs/~vladaf/Courses/Matf RS2/Prezentacije/CC 31... · — / £ Use the insertion sort technirÄue to sort the "data" array
Page 14: Vanja Cvetković - poincare.matf.bg.ac.rspoincare.matf.bg.ac.rs/~vladaf/Courses/Matf RS2/Prezentacije/CC 31... · — / £ Use the insertion sort technirÄue to sort the "data" array
Page 15: Vanja Cvetković - poincare.matf.bg.ac.rspoincare.matf.bg.ac.rs/~vladaf/Courses/Matf RS2/Prezentacije/CC 31... · — / £ Use the insertion sort technirÄue to sort the "data" array
Page 16: Vanja Cvetković - poincare.matf.bg.ac.rspoincare.matf.bg.ac.rs/~vladaf/Courses/Matf RS2/Prezentacije/CC 31... · — / £ Use the insertion sort technirÄue to sort the "data" array
Page 17: Vanja Cvetković - poincare.matf.bg.ac.rspoincare.matf.bg.ac.rs/~vladaf/Courses/Matf RS2/Prezentacije/CC 31... · — / £ Use the insertion sort technirÄue to sort the "data" array
Page 18: Vanja Cvetković - poincare.matf.bg.ac.rspoincare.matf.bg.ac.rs/~vladaf/Courses/Matf RS2/Prezentacije/CC 31... · — / £ Use the insertion sort technirÄue to sort the "data" array

?

Page 19: Vanja Cvetković - poincare.matf.bg.ac.rspoincare.matf.bg.ac.rs/~vladaf/Courses/Matf RS2/Prezentacije/CC 31... · — / £ Use the insertion sort technirÄue to sort the "data" array
Page 20: Vanja Cvetković - poincare.matf.bg.ac.rspoincare.matf.bg.ac.rs/~vladaf/Courses/Matf RS2/Prezentacije/CC 31... · — / £ Use the insertion sort technirÄue to sort the "data" array
Page 21: Vanja Cvetković - poincare.matf.bg.ac.rspoincare.matf.bg.ac.rs/~vladaf/Courses/Matf RS2/Prezentacije/CC 31... · — / £ Use the insertion sort technirÄue to sort the "data" array
Page 22: Vanja Cvetković - poincare.matf.bg.ac.rspoincare.matf.bg.ac.rs/~vladaf/Courses/Matf RS2/Prezentacije/CC 31... · — / £ Use the insertion sort technirÄue to sort the "data" array
Page 23: Vanja Cvetković - poincare.matf.bg.ac.rspoincare.matf.bg.ac.rs/~vladaf/Courses/Matf RS2/Prezentacije/CC 31... · — / £ Use the insertion sort technirÄue to sort the "data" array

Raspoređivanje klasnih interfejsa

● Komentar na vrhu koji opisuje kako se klasa koristi

● Konstruktori i destruktori

● Javne metode

● Zaštićene meode

● Privatne metode i članice klase

Page 24: Vanja Cvetković - poincare.matf.bg.ac.rspoincare.matf.bg.ac.rs/~vladaf/Courses/Matf RS2/Prezentacije/CC 31... · — / £ Use the insertion sort technirÄue to sort the "data" array

Raspoređivanje unutar

implementacije klase

● Komentar na vrhu koji opisuje sadržinu datoteke u

kojoj se klasa nalazi

● Klasne podatke

● Javne metode

● Zaštićene metode

● Privatne metode

Page 25: Vanja Cvetković - poincare.matf.bg.ac.rspoincare.matf.bg.ac.rs/~vladaf/Courses/Matf RS2/Prezentacije/CC 31... · — / £ Use the insertion sort technirÄue to sort the "data" array
Page 26: Vanja Cvetković - poincare.matf.bg.ac.rspoincare.matf.bg.ac.rs/~vladaf/Courses/Matf RS2/Prezentacije/CC 31... · — / £ Use the insertion sort technirÄue to sort the "data" array
Page 27: Vanja Cvetković - poincare.matf.bg.ac.rspoincare.matf.bg.ac.rs/~vladaf/Courses/Matf RS2/Prezentacije/CC 31... · — / £ Use the insertion sort technirÄue to sort the "data" array

Pitanja?

Page 28: Vanja Cvetković - poincare.matf.bg.ac.rspoincare.matf.bg.ac.rs/~vladaf/Courses/Matf RS2/Prezentacije/CC 31... · — / £ Use the insertion sort technirÄue to sort the "data" array

Osnovna teorema formatiranja

“Dobar vizualni raspored pokazuje logičku strukturu

programa.”

Hvala na pažnji