Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Why Java sucks
Index -> Java
Goto page Previous  1, 2, 3, 4, 5 ... 14, 15, 16  Next
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
rizzix




PostPosted: Thu Oct 13, 2005 1:08 pm   Post subject: (No subject)

continuations in java can be handled through design... as an example check out the Dalma project

hence there's no need for a special syntax... etc.
Sponsor
Sponsor
Sponsor
sponsor
wtd




PostPosted: Thu Oct 13, 2005 1:12 pm   Post subject: (No subject)

Well, my view is that it should be exposed at the language level, rather than the library level. Having to deal with Yet Another API just doesn't encourage the use of continuations the same way a simple "yield" keyword does. Smile
rizzix




PostPosted: Thu Oct 13, 2005 1:18 pm   Post subject: (No subject)

oh but it will if the JCP (java community process) accepts it into the Standard API. But for that to happen they need to propose to add it into the API.. as did Beanshell.org.
wtd




PostPosted: Thu Oct 13, 2005 1:32 pm   Post subject: (No subject)

Will it be implemented as smoothly as it is in something like Python or Ruby, where programmers make great use of continuations... likely without ever realizing it? Smile

Imagine if reading a file were as easy as...

Java:
for (String line : fileHandle.readLines())
{
   // ...
}


...and this didn't involve the method simply returning a collection. After all, if the file is large enough, that collection could take up absurd amounts of memory. A continuation based approach would allow the file to be read one line at a time. Sounds crazy, doesn't it?

Python:
for line in file_handle:
   ...
wtd




PostPosted: Thu Oct 13, 2005 8:41 pm   Post subject: (No subject)

Revisiting anonymous inner classes, I'd like to mention something, and in all fairness there may be some (I suspect it would be awkward) means of accomplishing it with the current language.

I've oft wondered how Java would handle the situation where you would want to use an anonymous inner class, but also want to inherit from a class. Or perhaps you want to implement more than one interface.

I wonder because O'Caml makes this relatively easy, at least as of 3.08.
wtd




PostPosted: Fri Oct 14, 2005 3:40 am   Post subject: (No subject)

On the subject of simplicity in Java...

Why not simplify conditionals and loops by requiring curly braces?

Java:
for (int i = 0; i < 10; i++)
   if (i % 2 == 0)
      System.out.println(i);


Becomes illegal. Replace it with:

Java:
for (int i = 0; i < 10; i++)
{
   if (i % 2 == 0)
   {
      System.out.println(i);
   }
}


This would fit more consistently with the syntax for try...catch...finally constructs.
rizzix




PostPosted: Fri Oct 14, 2005 10:36 am   Post subject: (No subject)

on the other hand i think it's even better if try-catch-final (and method definitions) permitted a single statement..
wtd




PostPosted: Sat Oct 15, 2005 7:25 pm   Post subject: (No subject)

rizzix wrote:
on the other hand i think it's even better if try-catch-final (and method definitions) permitted a single statement..


That'd be reasonable, but seemingly contradictory to your desire to keepthe language simple. Wink

If you were to have methods with a single statement/expression... would you still require a "return"?

code:
int foo() return 42;


code:
int foo() 42;


Hmmm...

code:
Arrays.sort(objArray, new Comparator<SomeClass>()
   public int compare(SomeClass o1, SomeClass o2)     
      return o1.someGetter().compareTo(o2.someGetter())
)


Smile
Sponsor
Sponsor
Sponsor
sponsor
rizzix




PostPosted: Sat Oct 15, 2005 7:35 pm   Post subject: (No subject)

ic..
Ultra Jugulator




PostPosted: Mon Oct 24, 2005 10:13 pm   Post subject: (No subject)

Well, it's my first year studying CompSci and Java is what I am learning. There are things that I am noticing in this programming language that makes me feel not really using it. The more I advance and learn from it, the more details I find. Confused

But it's like everything else, you obtain advantages and disadvantages.
I haven't seen perfect programming language yet. 8)

Besides, would any of you recommend any other better programming language? Question
1of42




PostPosted: Mon Oct 24, 2005 10:40 pm   Post subject: (No subject)

Psh, if you give him the chance, wtd will do nothing but recommend other programming languages.
[Gandalf]




PostPosted: Mon Oct 24, 2005 10:44 pm   Post subject: (No subject)

Now, I'm going to have to use some quotes here... first, I take this quote from wtd (as I remember it): "The more programming languages you learn, the more you realize they all suck."

Some languages that might be recommended to you are:
O'Caml, Ruby, Haskell, Perl, Python...

Another quote (from somewhere): "The more you learn, the more you realize you don't know."

*edit* Also, please make your avatar smaller so that it does not interfere with the frames of the forums.
wtd




PostPosted: Mon Oct 24, 2005 10:50 pm   Post subject: (No subject)

Ultra Jugulator wrote:
But it's like everything else, you obtain advantages and disadvantages.
I haven't seen perfect programming language yet. 8)


Keep in mind that "Java" is three things. It's a virtual machine, a library, and a language. I'm addressing failings in the language component.

Ultra Jugulator wrote:
Besides, would any of you recommend any other better programming language? Question


Keeping in mind that a language recommended in place of Java should be functionally comparable, the list of options I would raise is somewhat limited. I would tend to require that replacements be capable of object-oriented programming in something other than a hack-ish fashion.

If static typing is vitally important, I would wholeheartedly recommend O'Caml. It's a fantastic language and address most of these shortcomings with the Java language.

Also in the static typing field, I'd recommend D and Dylan as superior programming languages, though their tools could use some serious help.

C# suffers from many of the problems which plague Java, but also improves on several points... especially C# 3.0. Just watch out for Microsoft lock-in. You may wish to use the open source C# tools, even if that means being slightly behind the Microsoft tools in terms of support for cutting edge C# features. (Martin: am I completely biased against Microsoft? Smile )

Eiffel is a fantastic statically-typed object-oriented programming language.

If dynamic typing is ok, I'd highly recommend Ruby. Aside from that I'd advance Python and gladly say both are superior languages to Java.
Ultra Jugulator




PostPosted: Tue Oct 25, 2005 2:56 pm   Post subject: (No subject)

Thanks for the info, guys.

Very Happy
rizzix




PostPosted: Tue Oct 25, 2005 5:03 pm   Post subject: (No subject)

oh btw i should also mention these shortcommings are really not so big a deal.. you can program just as well with them as you would without them..
Display posts from previous:   
   Index -> Java
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 4 of 16  [ 228 Posts ]
Goto page Previous  1, 2, 3, 4, 5 ... 14, 15, 16  Next
Jump to:   


Style:  
Search: