A summary of the events while coding is as follows: (timestamped)
- Started at 9:20:35 pm.
I'm not a Java coder. I'm more used to C/C++. Luckily C and Java are very similar. Unfortunately, there are a few syntactical changes between the two. The main issue with me was researching how to write the main function (which I'm pretty sure I got wrong during the in-class exercise).
I know, I could have used the Eclipse IDE to fill in this line for me, but I already feel like a bad enough cheater for being given the "class FizzBuzz" line for free.
So I open up Google and find out what the syntax for the main function is.
- Finished researching syntax at 9:22:11 pm.
The coding begins. For the most part, syntax highlighting is the same as when I would edit source files in Notepad++ (which I like very much). The only part I do NOT like is that it automatically fills in a ending brace whenever you open one. I'm just accustomed to typing in the closing brace immediately after typing the opening brace.
On another note, I think you can get away with writing the program without any braces at all, maybe. But when I open a brace, I usually do it because I expect to have more than one line. Also, I think not putting the braces can increase the difficulty in reading the code, since then the reader must look for the implicit braces.
- Finished first coding iteration at 9:23:33 pm.
Will it work? It takes a few seconds to find the save (e.g. compile) button, as well as the run command (buried in a few menus... good thing I ran through the tutorial!). So the output appears and I proofread it.
It looks fine.
- Finished (after verification) at 9:24:18 pm.
Total time: 3 minutes, 43 seconds.
Other comments: Opening the Eclipse editor takes a while. If you want to account for that, add another 1-2 minutes to my time. I started from an already open Eclipse.
I think my time is too suspiciously fast, but maybe thats because I've had the problem statement for a while (e.g. ever since it was mentioned in class on Monday), and I have had a lot of time to think about it. If I were to do it impromptu, I'm pretty sure I would not do it this quickly.
Also, I did acknowledge that Java syntax isn't exactly one of the things I can recall offhand, and I'm still pretty surprised that didn't take up too much time.
Insights into software engineering/this class: Adding the factor of time does have an effect on how nice (or not nice) the final code works. Also, having to create a project from scratch can be something people don't do very often, which makes it more difficult to do when you actually have to write something from scratch.
Also, getting used to a new IDE does take time, which sounds like a line I heard, along the lines of "employees on a project only really start being useful after 3 months". (don't quote me on that, it's not the exact line)
- Andrew
Source listing: (in all the glory of bad indentation and line spacing - finishing quickly is a priority in this assignment, and I know tabs look ugly)
public class FizzBuzz {
public static void main (String[] args) {
for(int i=1; i <= 100; i++) {
if (i % 15 == 0) {
System.out.println("FizzBuzz");
}
else if (i % 5 == 0) {
System.out.println("Buzz");
}
else if (i % 3 == 0) {
System.out.println("Fizz");
}
else
System.out.println(i);
}
}
}
No comments:
Post a Comment