Algorithms and OOD (CSC 207 2014F) : EBoards
Primary: [Front Door] [Schedule] - [Academic Honesty] [Disabilities] [Email] - [Learning Outcomes] [FAQ] [Teaching & Learning] [Grading] [Rubric] - [Calendar]
Current: [Assignment] [EBoard] [Lab] [Outline] [Reading]
Sections: [Assignments] [EBoards] [Examples] [Handouts] [Labs] [Outlines] [Readings]
Reference: [Student-Curated Resources] [Java 8 API] [Java 8 Tutorials] [Code Conventions]
Related Courses: [CSC 152 2006S (Rebelsky)] [CSC 207 2014S (Rebelsky)] [CSC 207 2014F (Walker)] [CSC 207 2011S (Weinman)]
Misc: [Submit Questions] - [SamR] [Glimmer Labs] [CS@Grinnell] [Grinnell] - [Issue Tracker (Course)] [Issue Tracker (Textbook)]
What's on the quiz?
No, wrong class.
Do you write good recommendation letters for people who ask you to cover a particular topic at review sessions and then don't show up?
Um ... what do you think?
Can you critique random code?
for (int i = 0; i < items.size(); i++)
items.size()could be expensive. I'd use
int len = items.size();
for (int i = 0; i < len; i++)
And if I were thinking more in Java than in C, and wasn't mutating the
ArrayList, I'd use
for (Item item : items)
Here's another one
LinkedList<Item> items = this.items;
It looks like you're just trying to save five characters while typing. And Java doesn't require you to write
this.items; you can writeitems. (Sam != Java, but Sam doesn't like your strategy either.)
See our updated code at http://www.cs.grinnell.edu/~rebelsky/Courses/CSC207/2014F/git/zoe6/src/com/farevee/shopping/NewCart.java
Thanks ZW.