|
Replies:
14
-
Last Post:
Nov 2, 2004 6:31 AM
by: kobit
|
|
|
|
|
|
|
Add useful things to the API to help beginners.
Posted:
Oct 24, 2004 11:14 AM
|
|
|
I think Mustang should have something like java.homework, to handle common homework assignments for classes like data structures or simple Java homework.
Examples might be: "java.homework.BankTellerList" or "java.homework.CalculateAverageOfFloats" and stuff like that. That would make homework assignments much easier, and for people who couldn't do the homework, helping them would be easier too: You'd just say "see java.homework.j101.HelloWorld".
|
|
|
|
|
|
|
Re: Add useful things to the API to help beginners.
Posted:
Oct 24, 2004 12:19 PM
in response to: epesh
|
|
|
-1 These kind of things belong to demos and tutorials, not to platform. This forum is not about demos and tutorials, I believe.
|
|
|
|
|
|
|
|
Re: Add useful things to the API to help beginners.
Posted:
Oct 25, 2004 8:27 PM
in response to: patrikbeno
|
|
|
He was joking Patrick
|
|
|
|
|
|
|
|
Re: Add useful things to the API to help beginners.
Posted:
Oct 26, 2004 1:10 AM
in response to: brucechapman
|
|
|
I realized that after his another post (Taking this just too serious :-))
|
|
|
|
|
|
|
|
Re: Add useful things to the API to help beginners.
Posted:
Oct 26, 2004 1:36 AM
in response to: patrikbeno
|
|
|
He might have spent too much time on forums.java.sun.com and have meant this seriously .
Monika.
|
|
|
|
|
|
|
|
Re: Add useful things to the API to help beginners.
Posted:
Oct 26, 2004 10:34 AM
in response to: epesh
|
|
|
Add the class: YetAnotherStupidBeginnerError extends Error.
public class MyClass {
public static void main(String args[]) {
try {
for (int j = 0; j <= args.length; j++) {
System.out.println("arg " + j + " = " + args[j]);
}
} catch (YetAnotherStupidBeginnerError e) {
e.printStackTrace();
}
}
}
In this case, the YetAnotherStupidBeginnerError will be thrown when the JVM analyses the code, before it is executed and has a chance to throw an IndexOutOfBoundsException.
|
|
|
|
|
|
|
|
Re: Add useful things to the API to help beginners.
Posted:
Oct 26, 2004 11:39 AM
in response to: vikstar
|
|
|
Well that would really be a great addition to Java which would finally lead to Java's world success over .NET etc Might even prove the halting problem wrong.
Monika.
|
|
|
|
|
|
|
|
Re: Add useful things to the API to help beginners.
Posted:
Oct 26, 2004 12:03 PM
in response to: vikstar
|
|
|
Horrible  I suggest that compiler automatically optimizes such code by fixing accidental '
|
|
|
|
|
|
|
|
Re: Add useful things to the API to help beginners.
Posted:
Oct 26, 2004 8:22 PM
in response to: patrikbeno
|
|
|
Good idea, it would also automatically fix stuff like:boolean a = false;
boolean b = true;
if (a = b) {
System.out.println("a and b were equal");
}
orpublic class Light {
private boolean on = false;
public void toggle() {
on = !on;
}
public boolean isOn() {
return !isOff();
}
public boolean isOff() {
return !isOn();
}
}
|
|
|
|
|
|
|
|
Re: Add useful things to the API to help beginners.
Posted:
Oct 27, 2004 3:06 AM
in response to: patrikbeno
|
|
|
> Horrible  > I suggest that compiler automatically optimizes such > code by fixing accidental ' and use switch -XXnewbie-fixes:off > > What do you think?
Great idea. Should be the minimal requirement for JDK 6.0 
Monika.
|
|
|
|
|
|
|
|
Re: Add useful things to the API to help beginners.
Posted:
Oct 28, 2004 10:34 AM
in response to: monika_krug
|
|
|
I'm sorry, but I don't think the compiler playing with operators is a good idea at all. Even more so when it's a newbie programming. You don't learn how to code without making a few mistakes and tracking down a few bugs. I would lose my mind if I wanted something like if(a=b), the compiler decided that wasn't a good idea, and I had to find out what the compiler flag was to make the code compile as I had written.
|
|
|
|
|
|
|
|
Re: Add useful things to the API to help beginners.
Posted:
Oct 28, 2004 10:38 AM
in response to: smbell
|
|
|
Uhh ... with tools like the Inspection Gadgets plugin to IDEA, these kind of newbie errors could easily be pointed out. Or with PMD integrated, you could get compile-time warnings of newbie errors.
Sumit.
|
|
|
|
|
|
|
|
Re: Add useful things to the API to help beginners.
Posted:
Oct 28, 2004 3:53 PM
in response to: smbell
|
|
|
guys, this is funny section. don't enter until you've drunk enough
|
|
|
|
|
|
|
|
Re: Add useful things to the API to help beginners.
Posted:
Oct 29, 2004 12:22 AM
in response to: smbell
|
|
|
I totaly agree with smbell, the compiler shouldn't be a teacher. Beginners should read books/articles and write code to learn how to write code.
|
|
|
|
|
|
|
|
Re: Add useful things to the API to help beginners.
Posted:
Nov 2, 2004 6:31 AM
in response to: carmello
|
|
|
ROFL All these suggestions were just jokes!
Anyway, do you know about plans to support JDK 5.0 syntax by tools like PMD, checkstyle and so on?
I have just switched to JDK 5.0 and miss these tools a lot.
Artur
|
|
|
|
|