1 / 14

CS242

CS242. Mike Woodley mwoodley@uiuc.edu Office: 2101 Siebel 244-1971 Home: 531-8237. What is this course all about?. Improve your coding habits Write lots of straightforward code Embellish on assignments Interpret assignment Present your own code Look at the code of others. Your Code.

ima-king
Download Presentation

CS242

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. CS242 Mike Woodley mwoodley@uiuc.edu Office: 2101 Siebel 244-1971 Home: 531-8237

  2. What is this course all about? • Improve your coding habits • Write lots of straightforward code • Embellish on assignments • Interpret assignment • Present your own code • Look at the code of others

  3. Your Code • It’s OK to • get help on your code • get code from the Internet • get code from a book

  4. BUT… WRITE YOUR OWN CODE!!! Give credit where credit is due both in class and in your source code comments.

  5. Grading TA evaluates: • Attendance • Participation • Completing assignments • Making improvements • Presenting code • Investigating code of others

  6. “Clever” Solutions • Are cool • Don’t really help your grade • Unless you make a presentation out of it • The presentation is clear • It benefits the class • More interested in clear code

  7. Discussion Sections • Peer code review • MARS – each student plays each role in each discussion section • Moderator • Author • Reviewer • Scribe

  8. Lectures • Coding Style/Habits • Optimization • Practical How-To • Details about current assignment

  9. Assignments • Assignments should be approached as applications not MPs. • User input – no hard coded filenames, for instance. • Defensive – elegantly handle bad input • Consider user’s experience

  10. Coding Style Layout Comments Variable naming Function naming Functions (methods)

  11. main() • Simply an outline of the main functionality of the application • Should not have large code blocks in loops or conditionals • raster.c • Come conventions • Variables • Functions • Comments

  12. Routines(functions, methods, subroutines) • Do one thing • Do that one thing well • Have no hidden consequences (read chapter 7)

  13. 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, you can change everything

  14. Optimizing the Raster Processor • Optimization priority • Algorithm • Eliminate unnecessary conditionals • Lower level optimizations (chapters 25, 26)

More Related