667481 members! Sign up to stay informed.

Sponsored Links


Resources

Enterprise Java
Research Library

Get Java white papers, product information, case studies and webcasts

News News News Messages: 31 Messages: 31 Messages: 31 Printer friendly Printer friendly Printer friendly Post reply Post reply Post reply XML XML XML

Convert C# and VB to Java with Netbeans

Posted by: Joseph Ottinger on May 09, 2006 DIGG
Charles Ditzel has pointed out the NET2Java NetBeans plugin, which purports to convert C# and VB code to Java. It's not finished, but the project is still early in development and, given that it's an open project, we could have a fully working analogue to Microsoft's Java-to-.NET converter sometime in the future.

Mr. Ditzel is one of the more vocal Netbeans supporters out there, but it's hard to deny that Netbeans is gathering a very active plugin ecosphere. With JSR-198 (A Standard Extension API for Integrated Development Environments) being finalized, who knows? Perhaps plugins like this might be broadly portable across editors and Java would have a broadly available converter for whatever .NET apis we found useful. Any candidates? :)

Threaded replies

·  Convert C# and VB to Java with Netbeans by Joseph Ottinger on Tue May 09 14:10:34 EDT 2006
  ·  How useful is that really? by peter lin on Tue May 09 14:51:38 EDT 2006
    ·  VB to Java by George Coller on Tue May 09 15:16:59 EDT 2006
      ·  VB to Java by Steve Zara on Tue May 09 17:09:01 EDT 2006
        ·  VB to Java by Mark Nuttall on Tue May 09 22:02:00 EDT 2006
          ·  VB to Java by Steve Zara on Wed May 10 08:13:36 EDT 2006
      ·  VB to Java by Mark Nuttall on Tue May 09 22:02:51 EDT 2006
        ·  VB to Java new offering by megan c. adams on Tue Apr 07 14:18:09 EDT 2009
  ·  Nice - makes the undesirable that much more possible by Scott McCrory on Tue May 09 15:41:30 EDT 2006
    ·  are you that short sighted? by m pantla on Wed May 10 07:57:16 EDT 2006
  ·  Convert C# and VB to Java with Netbeans by Adam Spencer on Tue May 09 16:32:07 EDT 2006
    ·  Convert C# and VB to Java with Netbeans by Stan Brown on Tue May 09 16:51:01 EDT 2006
      ·  It's hard by Dalibor Topic on Tue May 09 19:35:40 EDT 2006
        ·  It's hard by peter lin on Tue May 09 21:06:22 EDT 2006
  ·  Convert C# and VB to Java with Netbeans by Bruce Wong on Tue May 09 22:41:36 EDT 2006
  ·  Convert C# and VB to Java with Netbeans by Michael McCutcheon on Tue May 09 23:20:54 EDT 2006
    ·  Convert C# and VB to Java with Netbeans by Dennis Bekkering on Wed May 10 12:20:48 EDT 2006
    ·  Convert C# and VB to Java with Netbeans by Frank Bank on Wed May 10 13:54:06 EDT 2006
      ·  Convert C# and VB to Java with Netbeans by Steve Zara on Wed May 10 14:58:33 EDT 2006
        ·  Convert C# and VB to Java with Netbeans by Frank Bank on Wed May 10 16:18:24 EDT 2006
          ·  Convert C# and VB to Java with Netbeans by Steve Zara on Wed May 10 17:23:31 EDT 2006
            ·  Convert C# and VB to Java with Netbeans by Frank Bank on Wed May 10 18:28:38 EDT 2006
              ·  Convert C# and VB to Java with Netbeans by Steve Zara on Wed May 10 20:06:10 EDT 2006
                ·  Convert C# and VB to Java with Netbeans by Frank Bank on Wed May 10 22:02:33 EDT 2006
                  ·  Convert C# and VB to Java with Netbeans by Steve Zara on Thu May 11 03:15:01 EDT 2006
                    ·  Convert C# and VB to Java with Netbeans by Frank Bank on Thu May 11 04:25:50 EDT 2006
                      ·  Convert C# and VB to Java with Netbeans by Steve Zara on Thu May 11 06:47:02 EDT 2006
      ·  Convert C# and VB to Java with Netbeans by Race Condition on Wed May 10 17:36:34 EDT 2006
        ·  Convert C# and VB to Java with Netbeans by Frank Bank on Wed May 10 18:29:33 EDT 2006
  ·  Feasible for such convertion by Renjian Zhou on Fri May 12 08:17:04 EDT 2006
  ·  Re: Convert C# and VB to Java with Netbeans by Mark Nuttall on Thu May 18 08:29:17 EDT 2006
  ·  Common Runtime for Java AND .Net by paul browne on Sat May 20 08:44:24 EDT 2006
  Message #208251 Post reply Post reply Post reply Go to top Go to top Go to top

How useful is that really?

Posted by: peter lin on May 09, 2006 in response to Message #208247
I can understand the desire to translate C# to Java, but would people really want to translate VB to Java. I would think having a skilled developer port it over makes more sense. There are all sorts of things one might do in VB that would be terrible in Java, so can a translation program beautify bad code?

peter

  Message #208253 Post reply Post reply Post reply Go to top Go to top Go to top

VB to Java

Posted by: George Coller on May 09, 2006 in response to Message #208251
Is this VB 6 or VB.NET? I'm assuming VB.NET since it is much more C#/Java like.

VB 6 is an entirely different animal.

I'm guessing that it is just purely code that gets converted. I'd be really impressed if an entire VB app got converted correctly to Java/Swing.

  Message #208258 Post reply Post reply Post reply Go to top Go to top Go to top

Nice - makes the undesirable that much more possible

Posted by: Scott McCrory on May 09, 2006 in response to Message #208247
Yay, so now it is easier to convert unlayered, tightly coupled and mostly procedural VB code into unlayered, tightly coupled and mostly procedural Java code. I'll get right on that...

  Message #208264 Post reply Post reply Post reply Go to top Go to top Go to top

Convert C# and VB to Java with Netbeans

Posted by: Adam Spencer on May 09, 2006 in response to Message #208247
Woudln't it be more useful to create a compiler that can take C# and produce bytecode out of it so that it can just run on the VM directly?

  Message #208266 Post reply Post reply Post reply Go to top Go to top Go to top

Convert C# and VB to Java with Netbeans

Posted by: Stan Brown on May 09, 2006 in response to Message #208264
Your clever, just like the guy who created IKVM. I only wonder how hard it would be to do this.

  Message #208268 Post reply Post reply Post reply Go to top Go to top Go to top

VB to Java

Posted by: Steve Zara on May 09, 2006 in response to Message #208253
Is this VB 6 or VB.NET? I'm assuming VB.NET since it is much more C#/Java like.VB 6 is an entirely different animal. I'm guessing that it is just purely code that gets converted. I'd be really impressed if an entire VB app got converted correctly to Java/Swing.

There is a product which claims to do this for pre-.NET versions of VB: http://www.diamondedge.com/products/Convert-VB-to-Java.html

  Message #208281 Post reply Post reply Post reply Go to top Go to top Go to top

It's hard

Posted by: Dalibor Topic on May 09, 2006 in response to Message #208266
Mainsoft's Grasshopper product provides that for specific areas (ASP.NET -> J2EE).

In general, it's hard to do since CIL is (roughly) a superset of the JVML, allowing for things like "unsafe" code accessing memory through pointer references, etc. which do not map nicely at all to what one can do with JVML.

cheers,
dalibor topic

  Message #208283 Post reply Post reply Post reply Go to top Go to top Go to top

It's hard

Posted by: peter lin on May 09, 2006 in response to Message #208281
Mainsoft's Grasshopper product provides that for specific areas (ASP.NET -> J2EE).

In general, it's hard to do since CIL is (roughly) a superset of the JVML, allowing for things like "unsafe" code accessing memory through pointer references, etc. which do not map nicely at all to what one can do with JVML.

cheers,dalibor topic

I haven't kept up with the latest changes in .NET 2.0, but assuming one doesn't use things like delegates or unsafe code, most of it should map fairly well for .NET 1.0. With .NET 2.0, it's probably better to manually port the code. I've ported stuff from Java to .NET 1.0 and 1.1 in the past and it is straight forward easy.

peter

  Message #208285 Post reply Post reply Post reply Go to top Go to top Go to top

VB to Java

Posted by: Mark Nuttall on May 09, 2006 in response to Message #208268
Is this VB 6 or VB.NET? I'm assuming VB.NET since it is much more C#/Java like.VB 6 is an entirely different animal. I'm guessing that it is just purely code that gets converted. I'd be really impressed if an entire VB app got converted correctly to Java/Swing.
There is a product which claims to do this for pre-.NET versions of VB: http://www.diamondedge.com/products/Convert-VB-to-Java.html
I've used it. Not too bad, but the resulting code suffers from the same issues as writing a Java app from scratch like one would in VB.

The problem really is VB (not the conversion tool) and the things it allows you to do. Like late binding, default properties, DAO/RDO/ADO, With statements, using Form instead of new Form. And if you've done usercontrols... .

Try converting VB6 app to VB.Net. Many of the same issues. A dll project is not too bad, but if a project has forms, it doesn't work so well.

  Message #208286 Post reply Post reply Post reply Go to top Go to top Go to top

VB to Java

Posted by: Mark Nuttall on May 09, 2006 in response to Message #208253
Is this VB 6 or VB.NET? I'm assuming VB.NET since it is much more C#/Java like.VB 6 is an entirely different animal. I'm guessing that it is just purely code that gets converted. I'd be really impressed if an entire VB app got converted correctly to Java/Swing.
I would believe it is VB.Net since it is called "NET2Java".

  Message #208289 Post reply Post reply Post reply Go to top Go to top Go to top

Convert C# and VB to Java with Netbeans

Posted by: Bruce Wong on May 09, 2006 in response to Message #208247
Isn't that great! Microsoft has got the Java converter since many many programmer years ago. The Java Jedi strikes back! :)

  Message #208292 Post reply Post reply Post reply Go to top Go to top Go to top

Convert C# and VB to Java with Netbeans

Posted by: Michael McCutcheon on May 09, 2006 in response to Message #208247
This can only be a good thing.

I've been 'forced' to migrate from Java to C# where I work.

After working with C# for a while now, I can honestly say that Java is a better language.

C# is full of useless 'features' that only encourage bad coding.

Operater overloading
Exclusively Unchecked Exceptions
Completly disorganized source file structure
Region tags that only encourage messy code
Pointers
etc.

To me Java is better because it *doesn't* have 'features' like those.

I applaud the developers of this converter and long for the day when NetBeans will come standard with a C# to Java converter the same way that Visual Studio comes with a converter.

Sun needs to get organized behind this.

This will give amunition to those of us who are trying to go back to Java.

  Message #208299 Post reply Post reply Post reply Go to top Go to top Go to top

are you that short sighted?

Posted by: m pantla on May 10, 2006 in response to Message #208258
But it does buy you some sort of platform independance so that you can get your VB & C# code off the microsoft platform...

It is still up to you to make that code nicer - but you can take your time doing that...

  Message #208302 Post reply Post reply Post reply Go to top Go to top Go to top

VB to Java

Posted by: Steve Zara on May 10, 2006 in response to Message #208285
Not too bad, but the resulting code suffers from the same issues as writing a Java app from scratch like one would in VB. The problem really is VB (not the conversion tool) and the things it allows you to do. Like late binding, default properties, DAO/RDO/ADO, With statements, using Form instead of new Form. And if you've done usercontrols... . Try converting VB6 app to VB.Net. Many of the same issues. A dll project is not too bad, but if a project has forms, it doesn't work so well.

I think it is even worse than if you simply coded a Java app like VB, because of the number of weird hacks needed to get around what VB (pre .Net) allows you to do. However, in terms of porting, it is at least a start.

  Message #208331 Post reply Post reply Post reply Go to top Go to top Go to top

Convert C# and VB to Java with Netbeans

Posted by: Dennis Bekkering on May 10, 2006 in response to Message #208292
This can only be a good thing.I've been 'forced' to migrate from Java to C# where I work.After working with C# for a while now, I can honestly say that Java is a better language.C# is full of useless 'features' that only encourage bad coding.Operater overloadingExclusively Unchecked ExceptionsCompletly disorganized source file structureRegion tags that only encourage messy codePointersetc.To me Java is better because it *doesn't* have 'features' like those.I applaud the developers of this converter and long for the day when NetBeans will come standard with a C# to Java converter the same way that Visual Studio comes with a converter.Sun needs to get organized behind this.This will give amunition to those of us who are trying to go back to Java.
Then I think a java to C# converter would be more usefull, you can always write java and have simple and solid code. I would be very happy with a java to c# converter on the source level, we can all port our frameworks seay to .NET. Oofcourse SUN and other JAVA dependend companies would not be to happy about that.

Another thing is that I agree with you and even want to take it a little further. I was sick of JAVA and everything around it for a while and thought that .NET would bring relieve, oh boy was i punished when the moment was there when i had to do some proffesional .NET. The .NET tools suck and they are not any faster also. Eclipse is so much more developer driven, smarter and intiutive. I think that applies for netbeans and intelliJ too (didn't do that much with it so i dont really know). I think it is like marriage, after 7 years you'v seen it and start to look at others but when you try some you discover that it is not that bad what you had. And you know what she actually worked on herself and became even more attractive then she was before, I fell in love again with her. The next next release she promised me to have full hot code swap, fields, methods the works. When that moment arrives i am sure that i will never leave her anymore. Because then she will be the only one with a compiler that has all the advantages of a dynamic language.

  Message #208343 Post reply Post reply Post reply Go to top Go to top Go to top

Convert C# and VB to Java with Netbeans

Posted by: Frank Bank on May 10, 2006 in response to Message #208292
C# is full of useless 'features' that only encourage bad coding.

It looks like Sun's dumbing down effort was perfect for you.

  Message #208349 Post reply Post reply Post reply Go to top Go to top Go to top

Convert C# and VB to Java with Netbeans

Posted by: Steve Zara on May 10, 2006 in response to Message #208343
C# is full of useless 'features' that only encourage bad coding.
It looks like Sun's dumbing down effort was perfect for you.

Java was designed with a considerable amount of experience of what can go badly wrong in terms of language previous design, and avoiding those issues. That features like operator overloading can sometimes encourage bad coding is well-known, and nothing to do with Java being 'dumbed down'. Java, for better or worse, was designed to be a practical language for real robust development. I see a real issue with proposed additions to C# and VB.NET in that they could end up with everything any developer could ever want, but as a result could easily lead (like earlier VB versions) to unmaintable code.

  Message #208358 Post reply Post reply Post reply Go to top Go to top Go to top

Convert C# and VB to Java with Netbeans

Posted by: Frank Bank on May 10, 2006 in response to Message #208349
Java was designed with a considerable amount of experience of what can go badly wrong in terms of language previous design, and avoiding those issues. That features like operator overloading can sometimes encourage bad coding is well-known, and nothing to do with Java being 'dumbed down'. Java, for better or worse, was designed to be a practical language for real robust development. I see a real issue with proposed additions to C# and VB.NET in that they could end up with everything any developer could ever want, but as a result could easily lead (like earlier VB versions) to unmaintable code.

Yes, because we know that there is no maintainable code written in C++, C#, Ruby, or any other language with operator overloading. Java can be just as unmaintainable as any other language - depending on who is writing the code. But if you enjoy the dumbing down, then all the power to you.

  Message #208368 Post reply Post reply Post reply Go to top Go to top Go to top

Convert C# and VB to Java with Netbeans

Posted by: Steve Zara on May 10, 2006 in response to Message #208358
Yes, because we know that there is no maintainable code written in C++, C#, Ruby, or any other language with operator overloading.

Which is, of course, not what I said.
Java can be just as unmaintainable as any other language - depending on who is writing the code.

No. The point of removing features that can easily allow unmaintainable code to be produced means simply that less unmaintainable code is produced, and it depends less on who is writing the code. To put it bluntly, poor programmers can do less damage with Java, and clever hackers can produce less obscure code.

Having frequently seen the effects of both over a long career as a developer, I am content with most of the choices made in the design of Java.

  Message #208370 Post reply Post reply Post reply Go to top Go to top Go to top

Convert C# and VB to Java with Netbeans

Posted by: Race Condition on May 10, 2006 in response to Message #208343
C# is full of useless 'features' that only encourage bad coding.
It looks like Sun's dumbing down effort was perfect for you.

You having a bad day Frank?

  Message #208374 Post reply Post reply Post reply Go to top Go to top Go to top

Convert C# and VB to Java with Netbeans

Posted by: Frank Bank on May 10, 2006 in response to Message #208368
Which is, of course, not what I said.

What you said was...

<blokquote> I see a real issue with proposed additions to C# and VB.NET in that they could end up with everything any developer could ever want, but as a result could easily lead (like earlier VB versions) to unmaintable code.
Languages don't produce unmaintainable code, programmers do.
No. The point of removing features that can easily allow unmaintainable code to be produced means simply that less unmaintainable code is produced, and it depends less on who is writing the code. To put it bluntly, poor programmers can do less damage with Java, and clever hackers can produce less obscure code.

Once again, you're blaming the language and not the brain dead programmers that produce unmaintainable code. Wouldn't you rather have the option of operator overloading and decide on a company-wide, or per-project policy basis? Or maybe
we should have int a = 1; int b = 2; c = a.add(b); That would be consistent. But instead we have that "nice" syntax for things like BigInteger and StringBuilder.

The other poster pointed out "unsafe" code. In C#, using native code is completely trivial. It basically comes down to writing a declarations for the native code functions you want to use. Of course, you need to use "unsafe" code. Now Sun thinks that nothing lies out the Java universe so you wind up with crap like JNI.
Having frequently seen the effects of both over a long career as a developer, I am content with most of the choices made in the design of Java.

So you expect Sun to protect bad developers from themselves?

  Message #208375 Post reply Post reply Post reply Go to top Go to top Go to top

Convert C# and VB to Java with Netbeans

Posted by: Frank Bank on May 10, 2006 in response to Message #208370
You having a bad day Frank?

It was a great day. I didn't have to write any Java code.

  Message #208378 Post reply Post reply Post reply Go to top Go to top Go to top

Convert C# and VB to Java with Netbeans

Posted by: Steve Zara on May 10, 2006 in response to Message #208374
Which is, of course, not what I said.
What you said was...<blokquote> I see a real issue with proposed additions to C# and VB.NET in that they could end up with everything any developer could ever want, but as a result could easily lead (like earlier VB versions) to unmaintable code.
Languages don't produce unmaintainable code, programmers do.
Indeed programmers do. Which is why it is a really great idea to have languages that help prevent that.
No. The point of removing features that can easily allow unmaintainable code to be produced means simply that less unmaintainable code is produced, and it depends less on who is writing the code. To put it bluntly, poor programmers can do less damage with Java, and clever hackers can produce less obscure code.
Once again, you're blaming the language and not the brain dead programmers that produce unmaintainable code.

Yes, because aren't we all 'brain dead' occasionally? Well, freely I admit I am. I make mistakes in coding - often embarassing ones. I need a language to protect me from my mistakes, but maybe that is just me.
Wouldn't you rather have the option of operator overloading and decide on a company-wide, or per-project policy basis?

But you can. You can use a language other than Java (I very occasionally use JRuby or Groovy in such situations). What Java protects you from is developers choosing to use such features whenever they feel like it.
But instead we have that "nice" syntax for things like BigInteger and StringBuilder.

Ah, well that is one of aspects of Java design I dislike. I think it would make sense to have operators for java.math.* classes, for example. Not having this makes coding financial logic with BigDecimal a mess. But, that is not the same as the ability to apply operator overloading anywhere - I want the use of math operators in the language extended, not operator overloading.
The other poster pointed out "unsafe" code. In C#, using native code is completely trivial. It basically comes down to writing a declarations for the native code functions you want to use. Of course, you need to use "unsafe" code. Now Sun thinks that nothing lies out the Java universe so you wind up with crap like JNI.

Sorry, but I disagree. I really don't think that using native code should be trivial in a language designed for safety and easily portability. If you want portability, you want to only rarely wander outside the Java universe.
Having frequently seen the effects of both over a long career as a developer, I am content with most of the choices made in the design of Java.
So you expect Sun to protect bad developers from themselves?

I don't expect it, but I'm very glad they do.

  Message #208386 Post reply Post reply Post reply Go to top Go to top Go to top

Convert C# and VB to Java with Netbeans

Posted by: Frank Bank on May 10, 2006 in response to Message #208378
Languages don't produce unmaintainable code, programmers do.
Indeed programmers do. Which is why it is a really great idea to have languages that help prevent that.

Except a language won't help prevent that.
Yes, because aren't we all 'brain dead' occasionally? Well, freely I admit I am. I make mistakes in coding - often embarassing ones. I need a language to protect me from my mistakes, but maybe that is just me.

I'll buy that for something like manual memory management, but not in the case of operator overloading where a simple code review should immediately reveal a misuse. Years ago, a co-worker of mine told me about this gal that used to name her variables after her pets. It should be one of those "Houston, we have a problem" and time for a little talk moments.
But you can. You can use a language other than Java (I very occasionally use JRuby or Groovy in such situations). What Java protects you from is developers choosing to use such features whenever they feel like it.

Now I'm real confused, if it's not OK for Java, then why is it OK for Groovy or JRuby or...? But even Java will allow programmers to string together syntax that compiles and does what it's supposed to do, but looks like an entry in a obfuscation contest.
Ah, well that is one of aspects of Java design I dislike. I think it would make sense to have operators for java.math.* classes, for example. Not having this makes coding financial logic with BigDecimal a mess. But, that is not the same as the ability to apply operator overloading anywhere - I want the use of math operators in the language extended, not operator overloading.

And so java.math.* classes now get special status like String and the numeric primitives? How is that supposed to work?
Sorry, but I disagree. I really don't think that using native code should be trivial in a language designed for safety and easily portability. If you want portability, you want to only rarely wander outside the Java universe.

I never understood that mentality that Sun has pushed so hard. I live in the real world where I want to reuse code and not in some sandbox where I'm actively discouraged from leaving.

  Message #208414 Post reply Post reply Post reply Go to top Go to top Go to top

Convert C# and VB to Java with Netbeans

Posted by: Steve Zara on May 11, 2006 in response to Message #208386
Except a language won't help prevent that.

Sure it will. By not having features that have been well established as assisting unmaintainable code to be written.
Yes, because aren't we all 'brain dead' occasionally? Well, freely I admit I am. I make mistakes in coding - often embarassing ones. I need a language to protect me from my mistakes, but maybe that is just me.
I'll buy that for something like manual memory management, but not in the case of operator overloading where a simple code review should immediately reveal a misuse.

That is not the point. The point is avoid misuse, not to have to look out for it. Ths point is that the meaning of Java code should be clear without having to look up what someone has decided '+' means.

<blockqiote>
But you can. You can use a language other than Java (I very occasionally use JRuby or Groovy in such situations). What Java protects you from is developers choosing to use such features whenever they feel like it.
Now I'm real confused, if it's not OK for Java, then why is it OK for Groovy or JRuby or...?
I don't understand why this is confusing. Sometimes you want to play about with a language that isn't safe. But a general purpose language like Java should be as safe as possible.
But even Java will allow programmers to string together syntax that compiles and does what it's supposed to do, but looks like an entry in a obfuscation contest.
Ah, well that is one of aspects of Java design I dislike. I think it would make sense to have operators for java.math.* classes, for example. Not having this makes coding financial logic with BigDecimal a mess. But, that is not the same as the ability to apply operator overloading anywhere - I want the use of math operators in the language extended, not operator overloading.
And so java.math.* classes now get special status like String and the numeric primitives? How is that supposed to work?

It isn't special status. Math operators should work as expected between math objects. If anything has special status it is String, but I guess people were used to the use of '+' for concatenation in languages like Pascal.
I never understood that mentality that Sun has pushed so hard.

So it seems :)

I live in the real world where I want to reuse code and not in some sandbox where I'm actively discouraged from leaving.
And because I develop in the real world and want to re-use code, I have the opposite view.

  Message #208418 Post reply Post reply Post reply Go to top Go to top Go to top

Convert C# and VB to Java with Netbeans

Posted by: Frank Bank on May 11, 2006 in response to Message #208414
Sure it will. By not having features that have been well established as assisting unmaintainable code to be written.

Sun got to make that decision for Java, but Sun or you don't get the final word on "well established". In fact, I think most programmers would disagree.
That is not the point. The point is avoid misuse, not to have to look out for it. Ths point is that the meaning of Java code should be clear without having to look up what someone has decided '+' means.

Once again, you're missing the point. An operator is just a function (or method). Now it either makes sense or not. Java is not going to save someone from giving a method a goofball name that doesn't reflect it's intention. Besides, most programmers aren't blindly using methods when first encountered even if it seems to be obvious what it does. There is usually some context which necessitates docs.
But a general purpose language like Java should be as safe as possible.

We were talking about operator overloading in this context. So by your logic, C#, Ruby, and other languages that have operator overloading are not "safe"....Because they are general purpose languages.
It isn't special status. Math operators should work as expected between math objects. If anything has special status it is String, but I guess people were used to the use of '+' for concatenation in languages like Pascal.

The builtin numerics and string do have special status in the language. So how do you propose that BigInteger, Decimal, Vectors, Matrices (the rest of the math/engineering classes) or whatever get operator overloading, but it's not available for general developers?
And because I develop in the real world and want to re-use code, I have the opposite view.

Except you live in the Java sandbox, where only Java is re-used.

  Message #208436 Post reply Post reply Post reply Go to top Go to top Go to top

Convert C# and VB to Java with Netbeans

Posted by: Steve Zara on May 11, 2006 in response to Message #208418
Sure it will. By not having features that have been well established as assisting unmaintainable code to be written.
Sun got to make that decision for Java, but Sun or you don't get the final word on "well established". In fact, I think most programmers would disagree.

No, it is indeed well established that operator overloading can potentially lead to confusing code. What is up for debate is how much that matters. I think it does.
That is not the point. The point is avoid misuse, not to have to look out for it. Ths point is that the meaning of Java code should be clear without having to look up what someone has decided '+' means.
Once again, you're missing the point. An operator is just a function (or method). Now it either makes sense or not. Java is not going to save someone from giving a method a goofball name that doesn't reflect it's intention.

Just because people can give goofball names to methods is no excuse to extending that to operators.
We were talking about operator overloading in this context. So by your logic, C#, Ruby, and other languages that have operator overloading are not "safe"....Because they are general purpose languages.

Not as safe, in terms helping to encourage the production of clear code, no. You seem to keep pushing me to an extreme point of view. This is a matter of degree, not absolute safety or otherwise.
It isn't special status. Math operators should work as expected between math objects. If anything has special status it is String, but I guess people were used to the use of '+' for concatenation in languages like Pascal.
The builtin numerics and string do have special status in the language. So how do you propose that BigInteger, Decimal, Vectors, Matrices (the rest of the math/engineering classes) or whatever get operator overloading, but it's not available for general developers?

It would not be operator overloading. It would be a language extension. I would give them special status as well.
And because I develop in the real world and want to re-use code, I have the opposite view.
Except you live in the Java sandbox, where only Java is re-used.

No, I use bash, python, ruby, SQL, and even occasionally C and C++ as well (and Smalltalk about once a year!). I find Java is easily the best for code reuse.

  Message #208581 Post reply Post reply Post reply Go to top Go to top Go to top

Feasible for such convertion

Posted by: Renjian Zhou on May 12, 2006 in response to Message #208247
I think it's feasible to do convertion on C#/VB to Java, or other similar convertions.

And there are aslo a Java to JavaScript convertion:
http://j2s.sourceforge.net/

Things depend on how depth is your convertion. Reusing those libraries of C#/VB into Java may require long and deep converting, I think.

  Message #209075 Post reply Post reply Post reply Go to top Go to top Go to top

Re: Convert C# and VB to Java with Netbeans

Posted by: Mark Nuttall on May 18, 2006 in response to Message #208247
This popped up the other day.

http://www.alphaworks.ibm.com/tech/compass?open&S_TACT=105AGX59&S_CMP=GR&ca=dgr-jw01awnestedarchive

  Message #209268 Post reply Post reply Post reply Go to top Go to top Go to top

Common Runtime for Java AND .Net

Posted by: paul browne on May 20, 2006 in response to Message #208247
As mentioned by a previous comment, why not just use a common runtime for both Java and .net.

A good example, used by the JBoss Rules project , is Apache IKVM allowing the Java Rules engine to run under .Net.

Paul , FirstPartners.net

  Message #307162 Post reply Post reply Post reply Go to top Go to top Go to top

VB to Java new offering

Posted by: megan c. adams on April 07, 2009 in response to Message #208286
I've written a source to source VB.Net converter to Java that might be of interest to folks who are interested in this topic.

VBeeJ For Java has an advanced type inference mechanism that creates interfaces and stubs for any unknown types and methods. Your converted Java code compiles, including all calls into the .Net platform that are unknown on the Java platform.

VBeeJ For Java also has a plugin architecture to support .Net API's running on top of Java. So, for example, the free trial download demo generates the plugin for the .Net XML API. You can actually use the .Net XML API in Java, in any Java context, using this plugin.

link: http://www.beelucid.com/products/vbj

New content on TheServerSide.comNew content on TheServerSide.comNew content on TheServerSide.com

Dependency Injection in Java EE 6 - Part 1

Reza Rahman explores the features of the proposed JSR 299, Contexts and Dependency Injection for Java EE (CDI). When approved, it promises to be a key feature of Java EE 6. (November 2, Article)

SAML: It's Not just for Web services

SAML is an XML-based standard for exchanging authentication and authorization data between security domains. The single most important problem that SAML was created to solve is the Web browser Single Sign-On problem. Many organizations are debating whether to stay with version 1.1 or move to 2.0. This article makes observations about both options. (September 28, Article)

Programming is Also Teaching Your Team

Joe Ottinger takes a look at how people learn, and applies it to the practice of programming. He notes that understanding how people learn is an essential part of working in a programming team. (September 22, Article)

Can Java EE Deliver The Asynchronous Web?

Stephen Maryka gave us an article about the Asynchronous Web and posed a number of questions that get examined like an approach to delivering Asynchronous Web capabilities through extensions to existing Java EE technologies. (July 14, Article)

JSF Flex

JavaServer Faces Flex goal is to provide users capability in creating standard Flex components, part of flexSDK which is open sourced through MPL license, as normal JSF components. This article by Ji Hoon Kim will provide an overview of creating a simple multilingual JSF page consisting of JSF Flex tags. (June 29, Article)

The Rules of SOA - A Road to a Successful SOA Implementation

In this session Jeff explores the key characteristics of successful SOA projects. He covers some of the patterns, and anti-patterns, tool sets, and strategies that he himself learned the hard way. Last, he provides a strategy and blueprint for achieving a high likelihood of success in your SOA project. (June 23, Tech Talk)

Ari Zilka Talks About Terracotta 3.1

Ari Zilka, CTO of Terracotta, Inc., talks about the new features in Terracotta 3.1, announced during JavaOne and available now. (June 15, Tech Talk)

Enterprise Application Integration, and Spring

In this Tech Talk, Josh Long explores an integration challenge using Spring Integration and walks through the implementation, employing and expanding on the basic patterns of Enterprise Application Integration to tie together components into a function integration solution, and then demonstrates how Spring Integration helps address the integration requirements. (June 15, Tech Talk)

Google Web Toolkit: An Introduction

In this Tech Talk, David Geary teaches you: The basics of Google Web Toolkit; How to implement Ajax-enabled applications in Java; Internationalization; Hooking into the browser history mechanism; Remote procedure calls. (June 4, Tech Talk)

Just Enough Early Architecture to Guide Development

Jon Kern discusses the best architecture/technical solutions and ensure that they are repeated by all developers. By tackling the architecture up-front in a serial manner, subsequent parallel development will be much more manageable and predictable. (May 28, Tech Talk)

Productive Programmer: On the Lam from the Furniture Police

This keynote describes the frustrations of modern knowledge workers in their quest to actually get some work done, and solutions for how to guard yourself against all those distractions. Neal Ford talks about environments, coding, acceleration, automation, and avoiding repetition as ways to defeat the misguided attempts to sap your ability to produce good work. (May 26, Tech Talk)

Auto-Scaling Your Existing Web Application

Gil demonstrates how new, aggressive uses of already abundant compute capacity by common applications offer competitive value for application designers. (May 21, Tech Talk)

Automating Hibernate Mapping and Queries For Java Web Development

Chris Keene introduces WaveMaker as a new way to automate the ability to generate Hibernate classes in order to more quickly bring OR mapping into an application. (May 19, Article)

Auto-Scaling Your Existing Web Application

In this session Nati Shalom demonstrates how to take a standard Java EE web application and scale it out or down dynamically without changes to the application code. Seeing as most web applications are over-provisioned to meet infrequent peak loads, this is a dramatic change because it enables growing your application as needed, when needed, without paying for unutilized resources. (May 19, Tech Talk)

Free Book: Jakarta-Struts Live

Download the entire book of Jakarta-Struts Live and learn about Struts MVC, Tiles, the Validator, DynaActionForms, plug-ins, internationalization, and more.
(Book PDF Download)

Application Server Matrix

The Application Server Matrix is a detailed listing of J2EE vendors and their application server products, with information on latest version numbers, J2EE spec support and licensing, pricing, platform support, and links to product downloads and reviews.
(Application Server Comparison Matrix)

News | Blogs | Discussions | Tech talks | Patterns | Reviews | White Papers | Downloads | Articles | Media kit | About
Java Solutions
All Content Copyright ©2007 TheServerSide Privacy Policy
Site Map