Monday, January 17, 2011

Assigned reading; Non-static features & Lab 2 open thread

 Assigned reading: Textbook pages 324-328 (Javadoc).

Discuss non-static features and Lab 2 in this thread.  Lab 2 has been posted on the course calendar.

31 comments:

  1. Thanks for the assigned reading.

    It would be great if you could also assign exercises from the book (or even made-up ones) and then post answers on the course website. I'm sure a lot of students would benefit from it. (And you don't even have to check everyone's solution!)

    Would something like that be possible?

    ReplyDelete
  2. Do we have to implement the entire BankAccount API? Have we learned how to include things like throwing exceptions etc.?

    Thanks

    ReplyDelete
  3. @Prof. Ekford and classmates,
    The provided javadoc's @return tag shows monospaced fonts for Boolean values. I have managed to achieve the same result with surround the boolean value with <code></code> in my @return. Is there a better way to do this, or should javadoc be able to pick up the booleans automatically?

    Thanks in advance.

    ReplyDelete
  4. Should I practice every exercise questions ?

    ReplyDelete
  5. Is it possible to see the result of the javadoc documents submitted? Is there something similar to API that shows the javadoc of the program ?

    ReplyDelete
  6. Re practice questions: The more practice, the better. I'll see if I have time to post some solutions.

    Yuen: I don't know. The code tags are a good work around.

    ReplyDelete
  7. In the BankAccount1 API, what should the return for the .toString() method be? The API states "Returns a string version of this bank account", however the constructor includes only a balance value. As such, should the return simply be the balance? In the more general case of a statement such as "Returns a string version of this Object" how do we know what return is actually expected for a given object, unless it is explicitly stated?

    ReplyDelete
  8. Furthermore, as the "BankAccount1" constructor stores only a value for the balance. How do we implement the .getNumberOfAccounts() method?

    ReplyDelete
  9. The .equals() method doesn't actually override the inherited version of the method. Should we implement .equals() to override the inherited version or just implement the one in the given API?

    ReplyDelete
  10. Dennis: For toString, I would return "BankAccount1:balance="+balance

    For number of accounts, use a private static int to store the number of accounts created (initial value of zero). Increment it in the constructor whenever a new account is created. I'll go over it in class next time.

    ReplyDelete
  11. @Dennis

    You have to create a private int counter and increment it every time the constructor is invoked.

    ReplyDelete
  12. Anonymous 9:08: I just put a note on the course webpage (I can't change the actual API) -- you should do it the way we presented in class.

    ReplyDelete
  13. Hello,


    When submitting java classes based on APIs that you give us, is it critically expected that all methods, fields and constructors are in the exact same order as the original API lists them or is it enough to get the javadoc comments to work as expected?

    ReplyDelete
  14. a question about lab 2: so for the deposit method. we have "returns true if the deposit is successful , false otherwise."

    so in which cases other than the passed amount to deposit being negative would the outcome be false?

    ReplyDelete
  15. public void withdraw(double amount)
    {
    this.balance = this.balance - amount;
    }

    for the first line i get the following error:
    Exception in thread "main" java.lang.Error: Unresolved compilation problems:
    void is an invalid type for the variable withdraw
    Syntax error on token "(", ; expected
    Duplicate local variable amount
    Syntax error on token ")", ; expected

    ReplyDelete
  16. Anonymous 6:07 PM:

    I'm guessing you did something wrong in another part of your code because the compiler thinks that your trying to declare a variable named withdraw, but clearly you want it to be a method so make sure the rest of your code is correct.

    ReplyDelete
  17. A few comments on the lab:

    1) Please talk to the TA's and establish a consistent editor that yourself (prof. Eckford), the TA's and the class are going to be using for the remainder of the course. The majority of the class and the TA's are currently using eclipse. I am using J-edit because that is what I used last semester. And you sir are using nano. It is difficult to learn about API creation when different editors provide different features wrt this, and I am unsure what will be available for us come test time.

    2) The student to TA ratio is innappropriate. Too many students in the class, most of whom did pass CSE 1020, enter the labs with different levels of preperation, and have a wide variety of questions. Those who are not prepared suck up the TA's time, while individuals who come with particular issues do not get the necessary attention to address those issues. Yourself (prof. Eckford) and the TA's clearly work extremely hard, but it is impossible for 3 TA's to accomidate all the students in the labs.

    3) The use of computers during the labs in unregulated. Thus students from other courses may use the computer labs at this time. I saw students registered in the lab not get a computer terminal to work at. This may be due to individuals in the wrong lab section, or the fact that, when we use both linux computer labs, students from other classes do not have a space to practice their programming in. As such, they use our lab time (which I believe is fair, and leads me to my next point).

    4) Two lab rooms is completely innappropriate. Currently we are split apart into one large room and one small room. The TA's are unable to run back and forth between the rooms, and are often stuck in the larger lab. Furthermore, this leads to no linux computers available for non-CSE1030 students to practice their programming. That is a serious issue because it leads to issues as addressed in point 3). Furthermore, the TA running the lab "lecture" can only lecture in one room. Considering she established a remote terminal to each student's screen, it is just downright absurd for a portion of the lab section to not have the same opportunity to learn as the rest of the students.

    I appoligize if I have been rude or innappropriate at any point during this post. However, it is extremely frustrating that both CSE1020 and CSE1030 lab components are just downright awful. I attended another Canadian post secondary institution where our first year computer science labs had 12 people to 1 instructor. This was a class of over 200 students and every lab section had approximately this ratio. The instructor did a 1/2 hour tutorial followed by 1 hr of help. In my opinion, this was an effective ratio and methodology to fascilitate learning. It also allowed the TA to develope a working relationship with the students whereby they were able to assess the individuals strengths and weaknesses, and provide effective aid as a result.

    I thank you very much for taking the time to read this, and I hope some changes come of this. Otherwise I will be signing in and leaving every one of my labs to make space for those who chose not to do their work.

    ReplyDelete
  18. Hello, I'm the TA from wednesday, I'll try to answer some of your question

    1. I believe nano and Jedit are just standard editor, so they are basically the same. Eclipse can give you slightly "faster" coding time due to some auto completion specific to Java and the fact you can compile and run your program in same window. But that's all. You may use whatever editor you're comfortable with, and all editors available during lab will be available during exam too.

    2. no comment, out of my control ;(
    FYI, the guy helping with Wednesday lab is not TA, he's a student that volunteering to help since he already done with the exercise (thanks a lot ^^, sorry I don't know your name)

    3. you have the right to kick out student that not taking 1030 during our lab hour. If they doesn't want to give up the workstation, you can ask the lab monitor on duty (they have more power lol)

    4. we actually have 3 labs booked, so the windows machines are available for use as well, but yeah 3 rooms instead of 2 is just more impossible to handle.

    And about the short tutorial, I actually already asked the student who wishes to hear the tutorial to move to 1006 and those who already feel confident with the exercise can go ahead start working on it on 1004. After I gave the tutorial at 1006, I move to 1004 and ask if anyone want me to repeat the tutorial there, but nobody raises their hand, so I just go around and answer their question.

    ReplyDelete
  19. Cont.

    @Joanna: You're welcome! My name is Yuen, I guess I really should've introduced myself earlier. I'm just glad that I could be of a use. My lecture was actually cancelled last time so I able to make it to the lab. (I usually can't) I will try to help out whenever possible, but I doubt that my lecture will be cancelled that often. :(

    In addition, I think you and the other TA, still did a great job, especially the condition you were in. I will speak out of turn here and say the strategic now approach would be encouraging students to help each other. As I've said before, I'm not smarter than anyone else, and I'm sure that everyone would have at least one person near them that knows what they're doing. It's just a matter of stepping out of your comfort zone and meeting new friends.

    Thanks for letting me help, and thank you, and the other TA for helping us. :)


    ---
    Again, I can't even type to save my life, please excuse any typos or grammatic errors. :)

    ReplyDelete
  20. Oh oops, the second part got posted first! Silly Blogger server.

    The first part:
    @Anonymous 6:07 PM: You forgot a semi-colon the end of the line before the deposit method.

    @Anonymous 5:53 AM: Thanks for writing such a long comment/suggestion. (But I'm shocked. You posted that at 5:53 AM? Do you have red bull flowing through your veins? ;))

    All silliness aside, there are interesting points you've brought up. Like Joanna, I will also reply to each of your point.

    [...]It is difficult to learn about API creation when different editors provide different feature[...]
    Please refer to the assigned readings. (Here's the link http://www.cse.yorku.ca/~buildIt/notes/1/main.pdf)
    Section 1.5 should give you all you need to know about javadoc. If you're having trouble deciding on an editor, Prof. E. had written a guide (here http://cse1030w1011.blogspot.com/2011/01/lab-1-feedback.html).
    I'm not assuming that you haven't done the reading, but I believe they are sufficient. If there is anything specific you want to ask about, I'll be glad to help. :)

    [...] It is impossible for 3 TA's to accomidate all the students in the labs. [...] 12 people to 1 instructor. [...]
    The issue about the amount of TAs had already be addressed in a previous blogpost. As Joanna had mentioned before, there's actually 2 TA's for the lab.

    I'm just a student volunteer, who was willing to sacrifice 2 hours of his time so everyone could be kept on track. I am not smarter than any of you, and I know that I'm not the only person who understands the material.

    Of course I don't expect anyone else to stick around 2 hours answer questions for everyone, but I'm sure if you asked your next door neighbors, your friend across the room, someone's ought to know what they're doing. I think this is how the lab was meant to be structured.

    Please don't take this the wrong way, but I will say something bold here. We (the students) are actually better at teaching this course (obviously after we learned it in the lecture) than Prof. E., and the TAs. Because it's been so long since they've learned the materials we're learning now. It is still fresh for us, and we will know the what to watch for, and the tips and tricks.

    With that, I do encourage fellow students to ask another student, before asking the TAs. Chances are, they've just gone through a problem you're having now.

    I assume the TAs there are for only when the entire room is clueless, then someone could ask the TA for something technical, and wasn't covered in class (or in the readings).

    In addition, it's impressive that your previous institute had a 12 to 1 ratio. But if you blow that up to say, 240 students in the lab, for simplicity's sake, there will be 20 TA's running around... Just in my head, I find that sight hilarious. Hehe.

    I'll end my with reply with this: I'm sorry that you didn't have as good as a lab experience as I, and some of the other student did. I'm not sure which lab you were in (windows or linux), but the windows lab is for people who knows what they're doing (as the TA announced at the beginning of the lab), which might be why you received less help. Make sure you come to the lab early next time so you can get a seat in the linux lab! :)

    ReplyDelete
  21. Anonymous 5:53: Thanks for the comment. This is what the forum is for. To address some of your points:

    1. Agreed. I strongly encourage everyone to use the command line, until you know what "helpful" IDEs like Eclipse are doing. Also, the command line is very easy to learn. However, let's say this: from now on, if you don't use Eclipse or the command line, you're on your own. You will definitely have access to both during the labtests.

    2. I'm currently rearranging the TA hours so as to get more TAs in front of the labs. No way are we going to get it down to 12:1, though.

    3. That is absolutely not acceptable and should not happen. If it happens, please point it out to the TA or lab monitor, and those people will be asked to leave. I want gawkers and idiots out of my lab.

    4. Not avoidable. The largest lab section has an enrollment of 75, and we don't have a 75-seat lab. I've asked the TAs to organize the class so that the people who need most help sit in 1006, and the others sit in 1004 (as Joanna mentioned). A broader point is that, even if we had a 75-seat lab, that's not a good lab experience; I was surprised that they decided to schedule it that way. I'll bring this up within the department but it won't change for this semester.



    4.

    ReplyDelete
  22. =)

    Do I have to submit my Lab exercises during the lab period? I want finish reading Chapter 5 before submitting.

    For Lab2: What is BANK_NAME used for?

    Do I have to write if statements for the Preconditions?

    Thanks.

    ReplyDelete
  23. I posted the previous anonymous post @5:53 (although I actually posted it at 8:30 AM... strange time stamp).

    Thank you to the TA, prof. Eckford and Mr. Yuen for the reply. I completely agree that the TAs worked extremely hard during both lab sessions, and Yuen, that is awesome you are helping out like that... I think your absolutely correct, our best resource is each other, and you have demonstrated that. I appreciate that everyone replied constructively to my post and, in light of what Yuen said, I dont think I will sign in and leave, as working with our peers is the best practice in this course.

    ReplyDelete
  24. According to Joanna's post earlier "nano and Jedit are just standard editor, so they are basically the same." Does this mean Jedit will also be available on the labtests?

    ReplyDelete
  25. Are you saying pages 324-328 are the only pages that we have to read in Chapter 5? Just curious.

    ReplyDelete
  26. @Anonymous
    Jedit (as well as other software) will all available during lab test and exam. The only limitation for test and exam is that you cannot connect to the internet and your home directory files. All software that you can use on normal lab will be available :)

    By "normal" editor, I mean that it doesn't give you advantage such as auto code generating as in Eclipse. You can say that nano and Jedit is similar to notepad in Windows, but Jedit has syntax highlighting to make your Java code easier to read.

    ReplyDelete
  27. Can you please clarify the previous point Joanna, is that to say Eclipse will be available with auto code generating during the examination, or that it will not be available.

    ReplyDelete
  28. @Anonymous 8:35 AM
    Auto code generating?
    Eclipse will be the same Eclipse in the labtest.
    =)

    ReplyDelete
  29. Dear Professor,

    I received my Lab2 critique today, and it said (among other things) the following:
    "You shouldn't have javadoc-style comments for private features."

    Should I use single line comment (// or /* */) for private features then?, or should I not comment on private features at all ?


    Thanks,

    ReplyDelete
  30. What is the procedure for tomorrow in case school is closed. I had another test scheduled for tomorrow which has been canceled. Is there any news for this course which I should be aware of? Thank you.

    ReplyDelete