So I'm getting ready to teach a class on Java programming. I'm wondering what the best way for me to have my students send me their completed homework code. My guess is that they should send me the .jar file that Netbeans creates. However, I've not been able to figure out how to load a .jar file into Netbeans so that I can take a look at it's source code.
Got any suggestions as to the best way to go about doing this?
- X 3
What they should be learning is Java, and as many here will assert, Windows Notepad is a better editor for beginning programmers, because it doesn't make them look more competent than they are and it doesn't teach them to walk on crutches.
More importantly, students shouldn't be handing in binary files. They should be handing in Java source code that you can then compile and run (or not, depending on how good a job they did). If a JAR is a requirement, then you've cut off people who had some idea of how to code a solution, but not enough of one to code clean-compiling code. It's also much more difficult to ensure that a jar actually came from the proper student instead of being lifted from someone else. A JAR does not normally contain any source code.
Finally, binary code isn't the be-all and end-all of a good programmer. Both myself and my own professors were as interested in how readable the code was and how well-commented it was. Again, a stock JAR won't contain such things.
So my recommendation is that they send you source code (presumably via email), and if it's going to consist of multiple files, put it in a ZIP file. If they don't have the basic skills to handle that, then they're not yet ready to begin programming in any language.
Tim Holloway wrote:So my recommendation is that they send you source code (presumably via email), and if it's going to consist of multiple files, put it in a ZIP file. If they don't have the basic skills to handle that, then they're not yet ready to begin programming in any language.
I completely agree with you (and gave you a cow) up to a point.
At some point, students will need to learn how to create and use packages; and at that point, they probably should learn how to use the jar and java -jar commands, and how things like CLASSPATH work; so I think it's reasonable to then require them to submit jars - and they should get extra gold stars if you can run their submitted jar from anywhere on your machine.
However, the jar should be in addition to their source code, not an alternative to it.