For your particular example, the api has been better since Java 5.
import java.util.Scanner;
import java.io.*;
public class ScannerTest {
public static void main(String[] args) throws FileNotFoundException {
Scanner in = new Scanner(new File("some_file"));
while (in.hasNextLine()) {
System.out.println(in.nextLine());
}
}
}
> You don't learn Java these days, you just learn eclipse. Much of the magic is happening in auto complete.
I code in vim with eclim. There is nothing to be gained by manually writing the code for getter setter, or find-replace an identifier, or write placeholders for n methods of an interface...
> I am not sure who picks up a book to learn java these days.
Also, what good would eclipse do to someone who doesn't know what to write? Consider my example above. Unless you know how to read a file, how can eclipse generate the code for you?
Or consider generics. How will eclipse help you understand what does <T extends Comparable<? super T>> mean? Eclipse is an aide. Unless you understand the language well, it doesn't help.
> I code in vim with eclim. There is nothing to be gained by manually writing the code for getter setter, or find-replace an identifier, or write placeholders for n methods of an interface...
None of which is necessary in better languages. I believe that was the parent's point.
It isn't necessary in any language, but it sure is useful.
I don't know what you mean by better languages, but I program comfortably in variety of languages(Ruby, Python, C, C++, Java, Clojure, Lua, Racket, go, JS, perl...) and haven't found a single language in which context aware auto-complete, assisted re-factoring, looking up inline documentation etc isn't useful.
"Generating get/set and abstract method bodies is only necessary in Java"
On smalltalk instance variables are private, so if you want get/set it's value you need a getter/setter.
You can argument that this is bad oo design, but it's not java exclusive.
Some of the bad Java is because of missing abstractions, most of it is because of badly designed api.
http://paulbuchheit.blogspot.in/2007/05/amazingly-bad-apis.h...
For your particular example, the api has been better since Java 5.
> You don't learn Java these days, you just learn eclipse. Much of the magic is happening in auto complete.I code in vim with eclim. There is nothing to be gained by manually writing the code for getter setter, or find-replace an identifier, or write placeholders for n methods of an interface...
> I am not sure who picks up a book to learn java these days.
It was some time ago(about 8 years ago), but I learned Java from a book(multiple books; I liked Core Java best http://www.amazon.com/Core-Java-Volume-I-Fundamentals-Editio...)
Also, what good would eclipse do to someone who doesn't know what to write? Consider my example above. Unless you know how to read a file, how can eclipse generate the code for you?
Or consider generics. How will eclipse help you understand what does <T extends Comparable<? super T>> mean? Eclipse is an aide. Unless you understand the language well, it doesn't help.