Today's assignment was FizzBuzz.
The Experience
It took a total of eleven minutes from the time I launched Eclipse to the time I was satisfied that the program produced the right output.
The single biggest step was checking the output (and I didn't check all of it). As a category, figuring out how to do things in Eclipse took the most time. I spent some time walking slowly through the wizards for starting a project and class, reading it all to figure out what information I was supposed to give it.
Then I spent a big chunk of time figuring out how to run a program from inside Eclipse to test it. Once I got it to run, I could run it again by clicking the "run" button or the Run -> Run.. menu item, but the first time I had to try a couple different things before Eclipse realized that my class was a program.
The time for actually writing the code was probably shortened by the fact that we wrote out the program on paper in class yesterday.
The Code
This is with Eclipse's default indentation. I gathered from class that we will use a different One True Way, but we haven't learned it yet.
public class FizzBuzz {
public static void main(String[] args) {
for (int i=1; i<101; i++) {
if (i % 5 == 0 && i % 3 == 0) {
System.out.println("FizzBuzz");
} else if (i % 3 == 0) {
System.out.println("Fizz");
} else if (i % 5 == 0) {
System.out.println("Buzz");
} else {
System.out.println(i);
}
}
}
} The Lesson
Anything we learn, we're going to learn the Java way.
I'm a little worried that this class will turn into "Java for Enterprise Development" with actual software engineering taking a back seat.
I still have my undergraduate software engineering textbook. Chapter sixteen covers object oriented design, including a brief introduction to Java.
2 comments:
I understand your concern. However, my belief is that "language independent software engineering" is almost always fairly vacuous. Put another way, practical software engineering techniques are almost always specific to some particular technology/language.
For example, there are even differences in software engineering best practices between CVS and SVN, which are otherwise extremely similar technologies. The UML diagram one would build for a system designed in Java is quite different from the one you would build for a system designed in Lisp. Etc.
We won't be going into EJB or other "enterprise" monstrosities this semester. I made that mistake in 613 a few years ago and won't go there again.
reynarsson http://www.netknowledgenow.com/members/Omeprazole.aspx http://www.netknowledgenow.com/members/Vacuum-Cleaners.aspx http://www.netknowledgenow.com/members/Annuity-Calculator.aspx http://www.netknowledgenow.com/members/Bariatric-Surgery.aspx http://www.netknowledgenow.com/members/Electric-Blankets.aspx
Post a Comment