Introduc)on*COMP*401,*Spring*2013*Lecture*1*1/10/2013*How*do*we*understand*the*world?*The*Evolu)on*of*Programming*• Simple*programs*are*programmed*simply.*– A*program*can*just*be*a*sequence*of*instruc)ons.*• Each*instruc)on*causes*a*change*in*overall*state.*• May*employ*simple*loops*and*condi)onal*execu)on*(i.e.,*if/then*statements).*The*Evolu)on*of*Programming*• As*a*program*becomes*more*complex…*– Refactor*common*sequences*of*opera)ons*into*parameterized*func)ons*or*procedures.*• Can*be*generalized*and*put*into*libraries*that*can*be*used*across*different*programs.*The*Evolu)on*of*Programming*• As*complexity*con)nues*to*grow…*– Developing*a*program*as*recipeVlike*sequence*of*instruc)ons*becomes*increasingly*difficult.*• Need*to*be*able*to*develop*and*understand*our*programming*more*like*the*way*we*understand*the*world.*– As*a*set*of*interac)ng*abstrac)ons.*• With*different*parts*of*the*program*opera)ng*at*different*levels*of*abstrac)on.*– This*is*objectVoriented*programming.*ObjectVOriented*Programming*• Programs*expressed*as*a*set*of*so[ware*“objects”.*– Each*object*is*associated*with*a*set*of*data*and*a*set*of*func)ons/procedures*that*operate*with*that*data.*• Objects*are*defined*by*their*“class”.*– Each*class*represents*an*abstrac)on.*– Abstrac)ons*o[en*layered*on*top*of*each*other*and/or*composited*into*more*complex*abstrac)ons.*– Key*challenge*is*developing*the*appropriate*abstrac)ons.*• The*opera)on*of*the*program*is*the*result*of*crea)ng*objects*and*having*them*interact*with*each*other.*Major*Themes*Of*This*Course*• Abstrac)on*• Encapsula)on*• Inheritance*• Polymorphism*• Delega)on*• Design*Pa`erns*• Asynchronous*Programming*Course*Info*• Sakai*– Turning*in*assignments*and*as*a*gradebook*• Piazza*– Course*notes,*resources,*Q&A,*and*all*of*other*course*related*communica)on.*– Should*have*received*an*invita)on*email*either*last*night*or*this*morning.*• If*not,*come*see*me*a[er*class.*– h`p://piazza.com/unc/spring2013/comp401/home*Syllabus*Review*• Who*I*am*• Who*the*TAs*are*– Office*hours*TBA*• Textbook*/*Resources*– No*required*text.*– Will*be*pos)ng*links*to*lots*of*onVline*materials*on*Piazza*course*resources*page.*Prerequisites*• This*should*not*be*your*first*introduc)on*to*programming.*– COMP*110*or*116*– High*school**– Hobbyist*/*Profession*experience*• If*you*have*never*programmed*in*Java*before*– h`p://www.oracle.com/technetwork/java/compileV136656.html*– h`p://docs.oracle.com/javase/tutorial/java/nutsandbolts/index.html*– Many*others.**• Your*goal*should*be*to*get*up*to*speed*on*basic*syntax*and*control*structures.*• We’ll*be*reviewing*some*of*these*today.*Assignments*and*Exams*• 8*programming*assignments*• 2*midterms*– Friday,*2/8*– Friday*3/22*• 1*final*exam*– Saturday,*5/4,*12:00*noon*– Loca)on*TBA*Grading*• 40%*assignments*• 10%*recita)ons*• 15%*x*2*midterms*• 20%*final*• Compu)ng*your*grade*– Each*component*mapped*to*a*4.0*scale*• 4.0*=*A,*3.0*=*B,*2.0*=*C,*1.0*=*D*– Assignments*and*recita)ons*will*be*mapped*as*follows:*• 95%*V>*4.0*• 90%*V>*3.5*• 80%*V>*2.5*• 70%*V>*1.5*• 40%*V>*0.0*– Exams*will*be*curved*Assignments*• May*restrict*the*use*of*certain*Java*libraries*and/or*features.*• May*require*the*use*of*certain*programming*techniques*or*approaches*to*the*solu)on.*• Correctness*is*but*one*criteria*for*grading.*– Elegance*and*readability*will*also*count.*• Some*of*the*assignments*will*build*on*top*of*each*other.*– This*can*make*things*difficult*if*you*don’t*get*an*assignment*working.*• You*should*keep*working*on*an*assignment*un)l*you*do*get*it*working.*• You*will*get*credit*for*the*assignment*due*next.*• If*you*catch*up,*you*will*get*up*to*50%*credit*for*assignments*that*were*originally*late.*Honor*Code*• Can*discuss*assignment*solu)ons*at*a*high*level*but*not*at*the*level*of*code.*– Code*sharing*=*chea)ng*– You*are*allowed*to*pa`ern*your*code*a[er*anything*I*post*(i.e.,*class*examples,*etc.).*• Can*help*each*other*debug,*but*again*up*to*the*point*of*sharing*or*wri)ng*code*for*another*person.*• If*it*feel*wrong,*it*is*wrong.*– If*you’re*not*sure,*ask.*Recita)ons*• Recita)ons*are*mandatory.*– A`endance*will*be*taken.*– If*you*have*a*valid*excuse,*you*must*no)fy*me*in*advance.*• If*missed*for*unforeseen*circumstances*(sickness,*etc.),*please*be*prepared*to*provide*documenta)on.*– There*will*be*graded*quizzes/exercises*during*recita)ons.*• You*are*free*to*go*to*any*of*the*4*recita)ons,*but*try*to*go*to*the*one*you*are*registered*for.*• The*midterms*will*be*held*in*recita)on.*– For*these,*you*must*go*to*the*recita)on*you*are*registered*for.*• Tomorrow’s*recita)on*is*cancelled.*Adding*T he*Course*• If*you*are*not*already*registered,*we*will*be*trying*to*accommodate*everyone.*– Assump)on*is*that*some*of*you*will*drop.*– But*if*not,*we’ll*be*)ght.*• Send*email*to*Jodie*Turnbull*– [email protected]*– Subject:*Adding*COMP*401*– Include*PID*and*choice*of*recita)on*– Please*cc*me*as*well.*OO*Programming*Languages*• Almost*all*modern*programming*languages*support*some*sort*of*objectVoriented*programming.*– Not*all*of*them*will*do*so*in*the*same*way.*• There*isn’t*just*one*way*of*being*objectVoriented.*• We’ll*be*using*Java*– Some*things*will*be*conceptual*and*will*apply*broadly*to*many*other*OO*programming*languages.*– Some*things*will*be*specific*to*the*objectVoriented*mechanisms*provided*by*Java*Installing*the*Java*SDK*• Java*SE*– Latest*version*is*7*update*10*• Some)mes*referred*to*as*1.7*– You*want*the*SDK*(not*just*the*JRE)*– Available*from*Oracle*at:*• h`p://www.oracle.com/technetwork/java/javase/*• Mac*Users*– Built*in*version*of*Java*is*1.6*• Strange*rela)onship*between*Apple*and*Oracle.*• This*should*work*for*what*we*are*going*to*do.*– Latest*version*is*available*from*Oracle*• But,*only*for*latest*opera)ng*system*(i.e.,*Mountain*Lion)*running*on*a*64Vbit*processor*Eclipse*•
View Full Document