mike woodley [email protected] office: 2101 siebel 244-1971 m 10-12 and 1-3 tu-th 10-12, 1-3...
TRANSCRIPT
CS242 Staff
TAs:
Carl-Erick Svennson
Vivek Kale
Studio Aides:Charlie Meyer, Jim Wordelman, Dan Hill, Jason Chen, Jerome Bell, Rafael Fernandez, Nathan Bosch
What is this course all about? Write lots of straightforward code Improve your coding habits Interpret and embellish on assignments Present your code to disc. sec. Examine the code of others
Straightforward Code
Clever is fun but not necessary Assignments generally do not involve
tricky algorithms or difficult problems to solve, instead they are designed to require a lot of code
Readable
Assignments Will be released or announced on Mondays Due Wednesday at 8am of the following week Generally will take at least 3 weeks
Must compileMust executeRequired functionality will be indicated in
assignmentMust be commented
Every week – review the code of one of your classmates assigned to you by your TA or studio aide
Every week – make improvements based on previous week’s comments
Your Grade You can only get points in discussion section Must present code from the subversion database Your points are accumulated for participation
Each assignment will have “style” criteria that you need to target
You will have improvements from your previous week’s work on which you will gain or lose points
You are graded against yourself, not compared to others You will preview the code of one other person in your
section each week for points We drop your lowest score
Missing Discussion
Drop lowest grade Find another section to attend
Notify your moderatorPermission from another moderatorMake sure your grade gets posted by YOUR
moderator
Improved Coding Habits
Commenting Naming variables, methods, files, etc Writing good routines, methods,
functions Organizing your code Using your resources Writing readable code Avoiding bad smells
Embellish on Assignments These are not to be seen as MPs I don’t like to hear them called MPs
If you refer to “MP1”, I probably won’t know what you’re referring to.
Call it the first week of the DEM or BMP assignment Write an application Think about your end user and about another person re-
using your code. If you write your code as you would an MP - “I’ll never have
to see this again” You will not do as well in scoring You’ll have a harder time when subsequent assignments
are given
Interpret Assignments
You may interpret assignments when they’re unclear
If you have an interest in approaching the problem in a new way, you may do so with permission from your TA or moderator
Changes must be of general interest to the rest of your discussion section
Present Your Own Code
You must present code to your discussion section
It must compile It must not have obvious bugs Make clear, logical presentations
WRITE YOUR OWN CODE!!!
The purpose of this class is for you to get an opportunity to write lots of code.
Give credit where credit is due both in class and in your source code comments.
Plagiarism results in penalties
Software comparisons will be made against the code of your fellow students.
Plagiarism is…
claiming another’s work as your own.
This includes errors of omission.
“I forgot” is not an excuse.
Expect full penalties.
Plagiarism
Do not put your name on code you did not write. This even counts for “automated” credits.
Credit anyone that DID write some of your code both in the comments and in presentation.
Do not use “creative interpretation” of the rules.
If you did not write it yourself, you can not claim it as your own. Putting your name on it is claiming it as your own.
Review Code of Others
You will be assigned to review another student’s code each week
You will need to lead some of the discussion of their code
Learn about their codeWhat did they do that was unique?What did they do that was unexpected?What is unclear in their code?
Etiquette
Do not be overly critical or cruel Make helpful comments and
suggestions Each person has their own strengths
and weaknesses Each person has a different level of
experience
Presentation Do’s and Don’ts Show code starting with an overview (unless asked to do otherwise)
What are the pertinent files, classes, etc?How do they relate to one another?
Don’t jump around code Don’t scroll around quickly Talk about one piece of code, tell how it
relates to:Last piece of codeApplication as a wholeNext piece of code you examine
Keep Track of Suggestions and Comments Your TAs and fellow students will make
suggestions and comments You will keep track of them for each session You will have to show your collection at the
end of the semester If no comments or suggestions are made by
your TA or fellow students, you will make your own resolutions for improvement for that week’s assignment and record it
Grading
TA (moderator) evaluates: Attendance Participation Completing assignments Making improvements Presenting code Investigating code of others
“Clever” Solutions
Are cool Don’t really help your grade
Unless you make a presentation out of itThe presentation is clearIt benefits the class
More interested in clear code
Discussion Sections
Peer code review MARS – each student plays each role in
each discussion sectionModeratorAuthorReviewerScribe
Assignments
Assignments should be approached as applications not MPs – think of a user’s experience not just your own.
User input – no hard coded filenames, no magic numbers
Defensive – elegantly handle bad input
main() Simply an outline of the main
functionality of the application Should not have large code blocks,
loops or conditionals raster.c
Code conventions○ Variables○ Functions○ Comments
The “Right Way” There isn’t one perfect way to code I advocate an approach I don’t want to get into “religious wars”
about formatting, commenting, naming, …
When you go to work, whatever your boss says is right
When you’re the boss, whatever you say is right
One “Law”
Does it work?
Ultimately the machine and how your application gets used are the judge.
In this class, we’ll actually be looking at how pretty the gears in your machine look
Suggestion When approaching something
completely new:Write “experiments” – code that you work
with to get something to workThrow away your experimental code and
write new code – DON’T try to adapt your experiments to complete the assignment
Make sure that a function you write does what you intend it to do
TEST AS YOU GO
Like Studying an Instrument… This course is like studying an
instrumentExercises are not written to be performed
but rather to build skillPracticeSometimes things will be exaggerated – like
writing small routines
Assignments The first 3 assignments this semester will
be assignments in:0: Your choice
○ Jan 281: C/C++
○ Feb 4, 11, 182: Java or C#
○ Feb 25, Mar 4, Mar 11
Take this time to install whatever you might need and familiarize yourself including IDEs
Assignment 0 – Due this week Select your discussion section Check in some code to subversion that
you have written for any purposeMust be at least 400 linesDue 8am Wednesday, Jan. 28
Attend discussion section and present your code in a code review
Yes, it counts on your final grade
Assignment 1 – Due Feb 4, 8am Read elevation data from a DEM file Scale the data to fit into 1 byte per elevation Write out the data as a BMP Write out a text metadata file about the original
data Latitude, longitude Rows, columns Lowest, highest elevation
Extra credit: Interpolate the data at an arbitrary dimension covering the
same area
BMP files
We will be using 8-bits per pixel Uncompressed You will be provided with a blank header
and which fields you’ll need to fill