fiddler616
May 13th, 2009, 01:04 AM
I've noticed a trend in my programming class: any code the teacher produces (either as part of a presentation or as part of a file we have to add to) has stuff like this in it:
//import statements
import java.util.*;
import javax.swing.*;
//global variables
int foo, bar;
String spam, eggs;
Scanner scan = new Scanner(System.in);
public static void doStuff(int stuff)
{
//Assignment
foo = scan.nextInt();
bar = whatever(foo);
double x = 0;
double y = 300;
...
}
...
Am I crazy for being really bothered by those comments? If the code came from a student, I'd brush it off as bad code, but the teacher seems quite competent. I could maybe understand doing it the first few weeks of class, but we're at the point where if we don't know what an import statement is, we're in big trouble. Is there anything to be gained by such superficial, expository comments? Or am I on the wrong foot?
Thanks.
//import statements
import java.util.*;
import javax.swing.*;
//global variables
int foo, bar;
String spam, eggs;
Scanner scan = new Scanner(System.in);
public static void doStuff(int stuff)
{
//Assignment
foo = scan.nextInt();
bar = whatever(foo);
double x = 0;
double y = 300;
...
}
...
Am I crazy for being really bothered by those comments? If the code came from a student, I'd brush it off as bad code, but the teacher seems quite competent. I could maybe understand doing it the first few weeks of class, but we're at the point where if we don't know what an import statement is, we're in big trouble. Is there anything to be gained by such superficial, expository comments? Or am I on the wrong foot?
Thanks.