Skip to main content

Add useful things to the API to help beginners.

14 replies [Last post]
epesh
Offline
Joined: 2003-06-19

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".

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
carmello
Offline
Joined: 2003-09-10

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.

kobit
Offline
Joined: 2003-06-13

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

patrikbeno
Offline
Joined: 2004-10-11

guys, this is funny section. don't enter until you've drunk enough ;-)

monika_krug
Offline
Joined: 2004-10-14

> Horrible ;-)
> I suggest that compiler automatically optimizes such
> code by fixing accidental '<=' in the condition. If
> sources are writable, compiler should automatically
> fix them. It may optionally leave explanatory comment
> like
>
> // You didn't mean that do you? If so, try it again
> and use switch -XXnewbie-fixes:off
>
> ;-) What do you think?

Great idea. Should be the minimal requirement for JDK 6.0 ;-)

Monika.

smbell
Offline
Joined: 2003-10-12

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.

sumitkishore
Offline
Joined: 2003-06-10

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.

patrikbeno
Offline
Joined: 2004-10-11

Horrible ;-)
I suggest that compiler automatically optimizes such code by fixing accidental '<=' in the condition. If sources are writable, compiler should automatically fix them. It may optionally leave explanatory comment like

// You didn't mean that do you? If so, try it again and use switch -XXnewbie-fixes:off

;-) What do you think?

vikstar
Offline
Joined: 2004-04-23

Good idea, it would also automatically fix stuff like:[code]boolean a = false;
boolean b = true;
if (a = b) {
System.out.println("a and b were equal");
}[/code]or[code]public class Light {
private boolean on = false;
public void toggle() {
on = !on;
}
public boolean isOn() {
return !isOff();
}
public boolean isOff() {
return !isOn();
}
}[/code]

vikstar
Offline
Joined: 2004-04-23

Add the class: YetAnotherStupidBeginnerError extends Error.
[code]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();
}
}
}[/code]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.

monika_krug
Offline
Joined: 2004-10-14

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.

patrikbeno
Offline
Joined: 2004-10-11

-1
These kind of things belong to demos and tutorials, not to platform. This forum is not about demos and tutorials, I believe.

brucechapman
Offline
Joined: 2004-03-18

He was joking Patrick :)

patrikbeno
Offline
Joined: 2004-10-11

I realized that after his another post ;-) (Taking this just too serious :-))

monika_krug
Offline
Joined: 2004-10-14

He might have spent too much time on forums.java.sun.com and have meant this seriously ;-) .

Monika.