JAVA vs C#

Status
Not open for further replies.

Mazer

Seniorius Lurkius
3
I am planning on learning a new language and am trying to decide between Java and c#. I was wondering what opinions were as to which would be the better choice. I am currently a vb/asp developer and have been exposed to the basics of Java and C++ at school.I am curious about future prospects of the languages as well as how easy they will be to pick up coming from a vb background. Any input is appreciated.

thanks :)
 

alxx

Ars Praefectus
5,141
Subscriptor++
Java, c ,c++ , fortran and even cobol will be around for a while.
(Even seen how well the remaining cobol guys get paid, very well).

Might be worth your while picking a cross platform language
rather than staying with just a windows base.

Once you learned one lanaguge its easier to pick up others.

Every one has a favourite langauge and will usually recommend that one.

I personally would leave c# until it has matured a bit more.
You would be better off getting up to scratch with vb.net
considering the differences between it and vb 6.

I'd say learn java , its not that different from vb
(very similar to c and c++ - loops etc are identical )
For java
java.sun.com join the Java developers connection its free
download the jdk and docs
and be sure to download a copy of the tutorial
Get a copy of Forte4j (or netbeans) - ide

Thinking in Java by Bruce Eckel
download a free copy www.bruceeckel.com

read and ask questions on the java newsgroups

For c++

1. Read the faqs.
They give pointers to books, compilers(free), and web tutorials.

http://snurse-l.org/acllc-c++/faq alt.comp.lang.learn.c-c++

http://www.eskimo.com/~scs/C-faq/top.html comp.lang.c

http://www.parashift.com/c++-faq-lite/ comp.lang.c++


2.Get a compiler(no need to buy one see faqs for the links)


3. Get a couple of good books. At least 1 beginners book and a
reference book. Work through the books and the problems they give you.
See the links in the faqs for book reviews or reviews on www.accu.org

Unofficial comp.lang.c booklist
http://users.powernet.co.uk/eton/clc/cbooks.html

C++ faq recommendations
http://marshall-cline.home.att.net/cpp-faq-lite/how-to-learn-cpp.html

4. Write programs

5. Write more programs

Before posting a question you should see if has already been
answered. Google archives usenet posts in a database
http://groups.google.com
http://groups.google.com/advanced_group_search

For c++

tutorial
http://www.arachnoid.com/cpptutor/index.html

Web tutorial links, books, etc
http://www.kfa-juelich.de/zam/cxx/extern.html under learning C++ section

http://www.research.att.com/~bs/C++.html

Free downloadable book(2 vols)
Thinking in C++ by Bruce Eckel http://www.bruceeckel.com

C++ in Action - Industrial Strength Programming Techniques
by Bartosz Milewski
http://www.relisoft.com/book/

Also www.steveheller.com online books

Good information here
http://www.comeaucomputing.com/techtalk

Also try the world lecture hall do a search for c or c++
beginners courses or intro to computer science or programming 101
http://www.utexas.edu/world/lecture/


Alex

alt.comp.lang.learn.c-c++
http://snurse-l.org/acllc-c++/faq

comp.lang.c
http://www.eskimo.com/~scs/C-faq/top.html

comp.lang.c++
http://www.parashift.com/c++-faq-lite/

Welcome to comp.lang.c++
http://members.xoom.com/jshiva/welcome.txt

al's c and c++ links page
http://www.geocities.com/alxx9672/learnc.html
 

dhopton

Ars Tribunus Militum
2,009
The differances between the two at a basic language level are insignificant - it's when you get into the advanced stuff thats differant, also the Class libs have some rather glaring differances after the simple text output.

If you are a VB/ASP programmer, then you should stick with c# - it's tilted towards microsofts way of thinking. For microsoft based solutions, the future is C#. If you are looking to move outside the microsoft area, then java is much your only choice interms of "big" languages.

I, of course, reccommened that you say with in the fold, and embark on that new and exciting adventure that is .net & c#/vb.net/j#/MC++/pascal.net/mercury.net etc etc etc :)
 
jemfinch-mode : enabled

if you really want to learn something cool, try one of the ML languages. OCaml being one of the more prevalent ones.

jemfinch-mode : disabled

in addition to that, learn a good non-functional, like C, C++, C#, or Java. If you really want to just get your feet wet and stick to mostly VB like languages, try Python. Stay away from Perl though. More to come...

-Wallace
 

bjrady

Seniorius Lurkius
31
After reading lots of Microsoft info pages (mostly propaganda), Usenet postings, and some news articles, I discovered something about C# that anyone considering using it should know.

C#'s runtime library is called the CLI or Common Library Infrastructure. This is the basis for C#'s (and indeed, .NET's) platform independence. Much like Java's J2SE, programs written using this library _should_ be completely agnostic of the operating system running under the virtual machine.

The CLR (Common Language Runtime )is a Windows implementation of the CLI. However, from what I have been able to find, this differs from the various JavaVM implementations in that the CLR contains WINDOWS SPECIFIC functionality! So a program written for the CLR may or may NOT run on other implementations of the CLI (the proposed Linux implementation, for example)

Microsoft has submitted the CLI for review by standards bodies, but considering that each implementation of the CLI can have different functionality, it doesn't matter. Microsoft has simply created a new way to make Windows programs, and not a unified platform that will run programs on any type of machine. Of course, they're not telling anyone this, and personally, I think they're making an effort to make .NET as vauge as confusing as possible in an attempt to make sure nobody notices it's the same old platform specific stuff MS has been putting out for years.

However...I could be wrong. Information about exactly what .NET IS and IS NOT is hard to come by, and if anyone has found an offical Microsoft statement about any of this, I'd like to read it.
 

kenada

Ars Legatus Legionis
17,589
Subscriptor
Originally posted by bjrady:
The CLR (Common Language Runtime )is a Windows implementation of the CLI. However, from what I have been able to find, this differs from the various JavaVM implementations in that the CLR contains WINDOWS SPECIFIC functionality! So a program written for the CLR may or may NOT run on other implementations of the CLI (the proposed Linux implementation, for example)
While there are some things that are certainly influenced by the way things are done in Windows, I've seen no indication that they would be impossible to implement on other platforms.

There's a discussion of this on mono-list. The conclusion drawn was some things don't have a direct analog in Linux but and cannot be mapped directly to existing library calls but can still be implemented through other means.
 

Handor

Ars Tribunus Militum
2,513
Probably the most extensive comparison I've seen.

The types associated with the (MS) CLR is a superset of those submitted for standardization. However, these can be (and are being) implemented on Windows by at least one group. You can expect that after the first round of standardization, the development path will take on two roles: for C#, we'll probably see something like generics support and other language niceties getting nailed down. For the CLR itself, we'll probably see mostly a whole ton of class libraries being standardized. As was the case with Java, I'm sure the class library for the second round will be vastly larger than the first.

Anyway, the class library is not the CLR. The CLR just runs classes, which is different. So while you might have fewer classes to play with, the runtime itself is not Windows-bound at all.
 
Just to clarify some facts on C# and .NET. While it's true executable are written in a common runtime language .Net doesnt use a virtual machine like java (strictly speaking). The IL wont run in a virutal environment per se that abstract everything it's will just be interpreted/translated/optimized at runtime that's why this not a real virtual machine. Another thing is that code can use tools provided by the runtime environment (like garbage collection) but it doesnt have to, you can very well do without it (not that you would want though ;-) ).


On wheter the CLR is platform specific. IL by itself is platform independant, what it asks the OS to do might not be OS independant. Any application can very easily be written to be platform independant, but then you have to make choices not to use anything specific to a Microsoft OS.
If you know what you are using and why it's ***very*** easy to avoid beeing stuck on a MS platform if/when another .NET OS support is released. For example you avoid trying to pull/put data into the registry or you avoir using the Windows XP Messaging 3 software. The std librairies provided with the .NET framework allow you to use these feature that's why people confuse it with the ability of the CLR/IL to be portable across multiple platforms but it's a completly independant matter. ;) Btw in VS.Net it's very easy to see that you are using platform specific assemblies because the name of their namespace either begin with Win32 or you have to include them manually as references.


To be on topic too with the thread. I would pick C# anyday. I programmed in Java for 2 years, writting EJB, JSP and all that. Java is a great language, but it has some flaws as the first managed object oriented language. I have been working 8 hours a day for the last 6 month using C# and I can say it's a a more mature language, generally speaking even though it has flaws due to it's youth.

What I mean is that when you write C# you clearly feel the conceptors of the language have used Java, found the most annoying things about it and got rid of it. But on the other hand it's the first version of a new language so it has a few problems. Nothing major or very annoying though.

The standard library of classes and API are a lot cleaner too. Just look at the implementation of Dates/Calendar and all this big mess in Java and you will wish it was like C#. Same thing for Streams and generic File I/O. The way to handle XML too is a lot more integrated in the language and not an added piece. Validating a document, creating a XML schema, everything is clearly thought through and not a kind of hack like it sometime seems using Java. Webservices are a great great great idea too and are so easy to use it make distributed app a charm. Ohhh and I forgot... the way all objects serialize to XML make me drool :)

I still love Java and I am using it to run my personal website because I have written a generic platform to handle a website/users/cache/versionning and all that sh*t using EJBs/servlets/jsp. No other language at the time would have allowed me to do such an efficient work.

Sorry for the long post.

GloP

[This message was edited by GloP2 on November 28, 2001 at 05:36.]

[This message was edited by GloP2 on November 28, 2001 at 05:37.]
 

bjrady

Seniorius Lurkius
31
Maybe this is just a philosophic difference, but I see this quasi-platform independece .NET has as very half-assed.

Remember what Mr. Miagi said: "Karate yes, or Karate no....Karate ehhhh....SQUISH! like grape"

Because of the platform specific functionality accessable in .NET, any application that uses that functionality will simply be another platform specific application. And why even use a virtual machine (or whatever MS wants to call it) at all, if you're writing a platform specific app?? Just compile it!

A far better approach is to add the functionality that developers want, regardless of what the different platforms can do, and if the functionality doesn't exist on any particular platform, just emulate it in the VM. That way you can take advantage of new, useful functionality, and keep your performance good, while still maintaining complete, unconditional, platform independence.

Microsoft, above all other design goals, holds functionality and the one and only priority. They don't care about performance, security, interoperatibility, or anything else for that matter. This is yet another case of MS trying to be all things to all people when it's far better to do one thing (cross platform application development) and do it well.
 
Originally posted by bjrady:
Because of the platform specific functionality accessable in .NET,
What, like the platform-specific functionality accessible (albeit considerably less easily) with JNI?

And the vendor-specific components available from IBM, BEA, etc.?

Java isn't an island either. I'll grant that it's a more fiddly to berak out of Java than it is .NET, but I can only see this as a point in .NET's favour; both offer the ability to use underlying OS capabilitise, only one does so in anything other than a half-arsed manner.

any application that uses that functionality will simply be another platform specific application. And why even use a virtual machine (or whatever MS wants to call it) at all, if you're writing a platform specific app?? Just compile it!
Ditto Java.

A far better approach is to add the functionality that developers want, regardless of what the different platforms can do, and if the functionality doesn't exist on any particular platform, just emulate it in the VM. That way you can take advantage of new, useful functionality, and keep your performance good, while still maintaining complete, unconditional, platform independence.
I imagine this will happen. The ECMA-mandated class library is sure to grow. Meanwhile, there's nothing to prevent the other classes being implemented on other platforms.

Microsoft, above all other design goals, holds functionality and the one and only priority. They don't care about performance, security, interoperatibility, or anything else for that matter.
If they didn't want security, they wouldn't bother with putting the thing in a sandbox. If they didn't want interoperability, they wouldn't bother with COM, SOAP, IP, Kerberos, etc..

This is yet another case of MS trying to be all things to all people when it's far better to do one thing (cross platform application development) and do it well.
Not at the expense of being a good application development environment.
 

bjrady

Seniorius Lurkius
31
Originally posted by PeterB:

What, like the platform-specific functionality accessible (albeit considerably less easily) with JNI?

JNI is a hack for people who want to use Java for everything and don't understand it's purpose. If you have to compile Java code then you've either got a serious design flaw or you shouldn't be using Java...or both. Microsoft is including, even advocating, this 'feature' because it's a backdoor for locking developers to a specific platform (Windows).

Originally posted by PeterB:

I imagine this will happen. The ECMA-mandated class library is sure to grow. Meanwhile, there's nothing to prevent the other classes being implemented on other platforms.

Microsoft is always going to devote 99% of it's resources to making Windows, and only Windows, more functional. Look at Microsoft's Java VM! They were 'embracing and extending' it with total disregard to cross-platform support, and the didn't even own the Java spec! Imagine what they'll do with .NET!

Originally posted by PeterB:

If they didn't want security, they wouldn't bother with putting the thing in a sandbox. If they didn't want interoperability, they wouldn't bother with COM, SOAP, IP, Kerberos, etc..

Without getting on a rant about the usefulness (or lack thereof) of COM, let me just say that the only reason any of those technologies were implemented my MS is because, without them, their products would be obsolete. My point is that Microsoft has functionality as THE primary design goal...that does not mean that thier products have NO interoperability or security, just the bare minimium (Outlook, for example!)

Originally posted by PeterB:

Not at the expense of being a good application development environment.

Well I leave that up to the readers to decide, but in my opinion, Microsoft is trying to do everything...and in typical Microsoft style, is doing it poorly.

Microsoft's assertion that .NET is a cross-platform development environment is complete FUD. They're taking this 'middle of the road' approach and allowing platform specific functionality because they know that 90% of the market is Windows, and 90% of the developers out there are going to program for Windows and Windows alone. That means that 90% of the .NET apps out there are going to be Windows specific, where as Java apps will always be platform agnostic.

The conclusion I have come to is this: If you want cross-platform support, use Java. If you don't, then don't. Java (like .NET) is a tool, not a religion, but it's important to know what it can and can't do.
 
Originally posted by bjrady:
JNI is a hack for people who want to use Java for everything and don't understand it's purpose. If you have to compile Java code then you've either got a serious design flaw or you shouldn't be using Java...or both. Microsoft is including, even advocating, this 'feature' because it's a backdoor for locking developers to a specific platform (Windows).
JNI can be useful for all sorts of things. You might have an application that needs one particular bit to go fast. You might wish to re-use legacy code. Neither of these indicates a "design flaw". Just an acknowledgement that Java isn't brilliant at everything.

Microsoft is always going to devote 99% of it's resources to making Windows, and only Windows, more functional.
Er. How, pray tell, does that prevent someoen else from implementing the non-ECMA classes?

Look at Microsoft's Java VM! They were 'embracing and extending' it with total disregard to cross-platform support, and the didn't even own the Java spec! Imagine what they'll do with .NET!
Given that they don't own the C# (or CLI) specs, it's not really in a position different to that of Java.

Without getting on a rant about the usefulness (or lack thereof) of COM,
Please do, it sounds interesting.

let me just say that the only reason any of those technologies were implemented my MS is because, without them, their products would be obsolete.
So?

The point is, they added such functionality to achieve security, interoperability, and so on. They worked on standards such as COM, SOAP, XML, C#, CLI, because it provides functionality -- functionality including interoperability and security.

My point is that Microsoft has functionality as THE primary design goal...that does not mean that thier products have NO interoperability or security, just the bare minimium (Outlook, for example!)
Interoperability and security *are* functionality. They might not have as much functionality in that area as you want. They're certainly gaining more in those areas, and I'm sure this will continue.

Well I leave that up to the readers to decide, but in my opinion, Microsoft is trying to do everything...and in typical Microsoft style, is doing it poorly.

Microsoft's assertion that .NET is a cross-platform development environment is complete FUD.
How so? Because no-one offers CLI on other platforms? Well, don't worry about that, because they will. They are working on exactly that.

They're taking this 'middle of the road' approach and allowing platform specific functionality because they know that 90% of the market is Windows, and 90% of the developers out there are going to program for Windows and Windows alone. That means that 90% of the .NET apps out there are going to be Windows specific,
That is an illogical conclusion. It might be that 90% of them will be developed with Windows in mind, but it does not mean that 90% of them will rely on Windows-only features.

Further, the situation might be that the applications rely on Windows features *but* become much easier to port to other platforms with a CLI implementation. They might need, say, per-platform windowing libraries, but their guts might be cross-platform -- where once they wouldn't have been. Even this is a useful step towards platform independence. It significantly reduces the cost of porting.

where as Java apps will always be platform agnostic.
Except that Java apps won't always be platform agnostic. They can readily be tied to a particular platform, or a particular vendor. If you want to write cross-platform .NET apps, you can do so. If you want to write easily-portable .NET apps, you can do so. The ability is there to a far greater extent than it is with plain ol' Win32.

The conclusion I have come to is this: If you want cross-platform support, use Java. If you don't, then don't. Java (like .NET) is a tool, not a religion, but it's important to know what it can and can't do.
The difference is, if you want to use Java as your primary tool, it makes it much harder to break out than if you want to use .NET as your primary tool.
 

Handor

Ars Tribunus Militum
2,513
Microsoft's assertion that .NET is a cross-platform development environment is complete FUD. They're taking this 'middle of the road' approach and allowing platform specific functionality because they know that 90% of the market is Windows, and 90% of the developers out there are going to program for Windows and Windows alone. That means that 90% of the .NET apps out there are going to be Windows specific, where as Java apps will always be platform agnostic.

FUD? Do you even know what this means? I demand you explain, if you can, how saying .Net is cross-platform is FUD.

Edit: That came off harsh. Sorry. Misuse of the term 'FUD' is one of my pet peeves, because it apparently applies to any action of MS, which means that it's lost whatever useful meaning it once had. In this case, it's a misuse, for example.

[This message was edited by Handor on November 28, 2001 at 13:30.]
 

EgalitarianBovine

Ars Tribunus Angusticlavius
8,086
Microsoft may be hedging on the fact that it would be hard to implement the MS-specific classes elsewhere. I mean, consider the situation now: as long as the win32 API is cloned elsewhere (as in Wine), programs using the win32 api are "portable". Unfortunately, cloning he idiosyncracies of an API are not that easy, the most notable example being the difficulties in getting Wine to implement a decent win32 library set.

So how will .NET change things from what they are now? Instead of native language programs being nonportable because of using the proprietary win32 api, they'll be byte-compiled programs that aren't portable because of the win32 api. One of the big points about java (and the whole pure java concept) is that the API lets you move across platforms. As long as you don't use JNI tied to something specifically not available all platforms, you know your stuff will be portable.

PeterB's mentioned "Vendor specific" libraries are kind of a red herring. Of course if you write your code to depend on a certain API provided by vendor specific classes, your code will be vendor specific. But that doesn't break any platform compatibility. If the vendor specific classes are pure java, then they too, can be moved to whatever platform you want to migrate to.

-EB
 

bjrady

Seniorius Lurkius
31
Originally posted by Handor:

FUD? Do you even know what this means? I demand you explain, if you can, how saying .Net is cross-platform is FUD.

[This message was edited by Handor on November 28, 2001 at 13:30.]

Fear, Uncertanty and Doubt.

Specifically, Microsoft in an effort to kill Java (and anything else that gets in thier way), they are making .NET 'appear' to be cross platform, by claiming that technologies like Java are immature because they cannot directly access platform specific features. The reason that is FUD, is because directly accessing platform specific features is a BAD thing (not a good thing) when you try to write cross-platform software

But you're right though...FUD is not the right term to use there...it's more like vaporware (another heavily used and much misunderstood term). But when you're writing forum posts on your lunch break you don't exactly have a lot of time to proofread =). So please forgive my misuse.

However, the premise still holds true. .NET is NOT a serious cross-platform development system, regardless of what MS says.

Microsoft is a 'Yes it can' company. A good example of this is Adobe. Go to Comdex or Siggraph, and go talk to one of the Adobots that run the demos in their booth. There's a fun game you can play with them. Try to get them to tell you that their products CAN'T do something. I've done this a few times and no matter what you ask, they'll come up with some half-assed answer as to how "Oh yes, Adobe FooBar 3.0 can do that!" when it's obvious that it can't, and they're just giving you a bull$hit answer so they don't lose face.

Microsoft hates it admit it can't do something, or isn't the best at something. So instead of admiting they can't do it, they just say it's not worth doing....which isn't exactly FUD, but it's close.
 

bjrady

Seniorius Lurkius
31
Originally posted by PeterB:

JNI can be useful for all sorts of things. You might have an application that needs one particular bit to go fast. You might wish to re-use legacy code. Neither of these indicates a "design flaw". Just an acknowledgement that Java isn't brilliant at everything.

Exactly my point. Java ISN'T the golden hammer. That's why using JNI is pointless (and a hack). If performance is a priority, don't use Java, if you have legacy code, why are you porting to Java in the first place? Is it really that necessary? .NET ins't the golden hammer either, but Microsoft is saying that it is. The reality is that there's no such thing as a tool that does EVERYTHING...that why there are lots of different ones out there.

Originally posted by PeterB:

Er. How, pray tell, does that prevent someoen else from implementing the non-ECMA classes?

I think the post above about the Win32 explains it well. As long as Microsoft controls the guts, you'll never know exactly what it's doing because it's all closed source.

Originally posted by PeterB:

Given that they don't own the C# (or CLI) specs, it's not really in a position different to that of Java.

What we're talking about here is the CLR...the Windows implemention of the CLI (as I understand it to be)...not the CLI. The CLI alone would create a decent cross-platform system. The whole problem is that Microsoft is 'embracing and extending' the CLI to add in Windows Specific functionality (the result being the CLR). This misses the whole point of a cross-platform development system in that one of the implementations of the basic spec (the CLR) has features that other implementations may not (or indeed, cannot) have.

Originally posted by PeterB:

Quote: "let me just say that the only reason any of those technologies were implemented my MS is because, without them, their products would be obsolete."
So?

The point is, they added such functionality to achieve security, interoperability, and so on. They worked on standards such as COM, SOAP, XML, C#, CLI, because it provides functionality -- functionality including interoperability and security.

Microsoft only did it because they had to, not because they care about making secure or interoperable products. In other words, they only add what the market specifically asks for, and as such they do not innovate in those areas. This may help them maintain their monopoly, but it does not create quality software and it is not a healthy, long term view (but then again, when you're a monopoly, why should you care about the long term?).

Originally posted by PeterB:

Interoperability and security *are* functionality. They might not have as much functionality in that area as you want. They're certainly gaining more in those areas, and I'm sure this will continue.

Security is often in direct conflict with functionality. Again, Microsoft Outlook is the prime example. They wanted to have ActiveX controls in their e-mail client because it's more Gee-Whizary, and they didn't care about the fact that there is an inherient security risk in implementing that. Functionality over Security. Microsoft will make that decision the same way every time.

As far as interoperability goes, yes it a feature, but it's a feature that Microsoft will not implement in a standard way, because they're monopolistic and don't need to use other products in order to be competitive. Microsoft doesn't think it needs to play well with Linux, and maybe rightly so considering the distribution of market share, but either way, they don't care about working with other products.

Originally posted by PeterB:

How so? Because no-one offers CLI on other platforms? Well, don't worry about that, because they will. They are working on exactly that.

Who is working on that? Certianly not Microsoft. And nobody else is going to be able to because 1) Microsoft will create new functionality faster than any other company could implement it on another system, and 2) Microsoft will hide (at all costs) the inner workings of the Windows Specific functionality so that the API will never be truly open. For example, a function like:

CInteralMicrosftStructure* GetWindowProp();

could easily be implemented in the CLR, because it's windows specific and not bound the the specifications of the CLI, but nobody outside of Microsoft has the documentation on what CInteralMicrosftStructure is or what it does! And if you have to reverse engineer every one of those GOTCHA's you'll never get anything done.

Originally posted by PeterB:

That is an illogical conclusion. It might be that 90% of them will be developed with Windows in mind, but it does not mean that 90% of them will rely on Windows-only features.

Good point, it's not 90%. However it is naive to assume that those features will not be used. I don't know the exact number of developers that will use them, but in reality it doesn't matter. The functionality should be the same across ALL implementations so that you don't have to worry about whether or not your 'platform agnostic' program is really platform agnostic.

Also, the underlying platform should be able to evolve and change independent of the application that's running on it. If you tie the application directly to the platform, every time the platform changes, if you want to use the latest features, you have to change the application too. When you abstract through a virtual machine, that's not necessary...the VM can use the new features without the application ever knowing about it.


Originally posted by PeterB:

Further, the situation might be that the applications rely on Windows features *but* become much easier to port to other platforms with a CLI implementation. They might need, say, per-platform windowing libraries, but their guts might be cross-platform -- where once they wouldn't have been. Even this is a useful step towards platform independence. It significantly reduces the cost of porting.

Another good point, but you can achieve the same thing with a good Object Oriented design in a platform specfic language like Visual C++ (see, I don't hate ALL MS products...just the bad ones =). The only case I really see this being useful is when high performance and high portability are both critically important in a project (Like a 3D web brower, for instance). Otherwise you'd just be better off using a more straightforward method.

Originally posted by PeterB:
Except that Java apps won't always be platform agnostic. They can readily be tied to a particular platform, or a particular vendor. If you want to write cross-platform .NET apps, you can do so.

Ah, but you can't. Not without sacrificing all the functionality that's built into Windows. This gets back to the point I was making earlier about 90% of the market and 90% of the developers. Microsoft is always going to put all their effort into adding new stuff to the CLR, because CLR functionality IS Windows functionality, and that is their core business. No other company on the planet is going to be able to keep up with them, especially considering how facist MS is about thier source code. So the choice will be Windows specific, or severly limited in functionality...which is an obvious choice for most developers.

Originally posted by PeterB:

The difference is, if you want to use Java as your primary tool, it makes it much harder to break out than if you want to use .NET as your primary tool.

How is being tied to Microsoft products going to make it easier to change development tools? Microsoft has a history (as I've said before) of not playing well with other companies because they want to maintain their monopoly. SUN, IBM, and other companies outside the Microsoft 'family' have to be interoperable because if they're not, they won't be competitive. Case in point, There's a JVM for WindowsXP written by SUN, and supported by SUN. When is Microsoft going to write a CLI implementation for Solaris? Never...
 

bash666

Ars Legatus Legionis
24,417
Exactly my point. Java ISN'T the golden hammer. That's why using JNI is pointless (and a hack). If performance is a priority, don't use Java, if you have legacy code, why are you porting to Java in the first place? Is it really that necessary? .NET ins't the golden hammer either, but Microsoft is saying that it is. The reality is that there's no such thing as a tool that does EVERYTHING...that why there are lots of different ones out there.

But if everythign save one small peice of code works fine in java, why not have the ability to mix in your algorithm(in asm or what ever) with a mostly Java front end. When done well this is hardly a hack, and is a rather elegant solution which can give a consistent experience everywhere while runnign fast.

-Kevin
 

bjrady

Seniorius Lurkius
31
Originally posted by bash666:

But if everythign save one small peice of code works fine in java, why not have the ability to mix in your algorithm(in asm or what ever) with a mostly Java front end. When done well this is hardly a hack, and is a rather elegant solution which can give a consistent experience everywhere while runnign fast.

-Kevin

Well I suppose that depends on your definition of a hack, because I would call that a hack. I can't think of a single thing that would be so trivial as to require a few lines of code, and yet be so important that you had to break cross-platform compatibility in order to do it. Of course, if you didn't care about being cross-platform, it wouldn't matter, but you had also better take a look at why you're using something like Java or C# to write your app in the first place.

The only thing I CAN think of that would warrant this is if you were accessing hardware from a web servlet in order to provide data capture or diagnostic info over the web. Java is one of the best (if not the best) language/platform for web development and breaking the model in order to do data capture would be a hack...but it would be a necessary (and perfectly excusable) hack because Java is so good for web based apps that it would be preferable to doing it in a non-hack way in C++ (although using C++ to write a web app would be pretty damn ugly anyway...but I digress)

Like I said, it all depends on what you want to do. If you want a cross-platform App, don't use C#, don't use the JNI, use pure Java.
 

bash666

Ars Legatus Legionis
24,417
Well I suppose that depends on your definition of a hack, because I would call that a hack. I can't think of a single thing that would be so trivial as to require a few lines of code, and yet be so important that you had to break cross-platform compatibility in order to do it. Of course, if you didn't care about being cross-platform, it wouldn't matter, but you had also better take a look at why you're using something like Java or C# to write your app in the first place.

Suppose you are writing a program that does a lot of matrix algrbra(for what ever reason). If you stick with pure java you're gonna hurt. However, if you can mix in the numerics of ATLAS and BLAS with a java GUI, data reader, etc, then you now have a fast viable alternative that is, for the most part, very portable as ATLAS and BLAS are available on almost every platform.

-Kevin
 
Who is working on that? Certianly not Microsoft. And nobody else is going to be able to because 1) Microsoft will create new functionality faster than any other company could implement it on another system, and 2) Microsoft will hide (at all costs) the inner workings of the Windows Specific functionality so that the API will never be truly open.
When is Microsoft going to write a CLI implementation for Solaris? Never...


Dont talk about what you dont know. Microsoft might surprise you. You can probably say "I dont see MS working on that for X,Y,Z reasons" and acknoledge the fact that you are only predicting what you would do if you were Gates. But it seems you are not at the head of a multi bilions dollars monopolistic company so dont throw in facts like you know what you are talking about. If you are not bill gates in disguise you probably have no idea whatsoever of what MS is going to do next. **This** is FUD.

Especially about .NET portability across multiple platforms and OS. Once again MS might surprise you....

GloP.
 
Originally posted by EgalitarianBovine:
Microsoft may be hedging on the fact that it would be hard to implement the MS-specific classes elsewhere. I mean, consider the situation now: as long as the win32 API is cloned elsewhere (as in Wine), programs using the win32 api are "portable". Unfortunately, cloning he idiosyncracies of an API are not that easy, the most notable example being the difficulties in getting Wine to implement a decent win32 library set.
I imagine that's as much to do with the breadth of what they have to do as it is anything else. The same doesn't hold true of .NET, with the bulk of the classes that would, in Win32, be proprietary, being standard. It greatly restricts (and simplifies; the interfaces are much cleaner) those areas that are MS-only.

So how will .NET change things from what they are now? Instead of native language programs being nonportable because of using the proprietary win32 api, they'll be byte-compiled programs that aren't portable because of the win32 api. One of the big points about java (and the whole pure java concept) is that the API lets you move across platforms. As long as you don't use JNI tied to something specifically not available all platforms, you know your stuff will be portable.
And as long as you don't use the MS-only classes in .NET (though how long they remain MS-only is anyone's guess) the same is true of that, too. Yes, it requires some discipline from the programmer. So does Java. Deal with it.

PeterB's mentioned "Vendor specific" libraries are kind of a red herring. Of course if you write your code to depend on a certain API provided by vendor specific classes, your code will be vendor specific. But that doesn't break any platform compatibility. If the vendor specific classes are pure java, then they too, can be moved to whatever platform you want to migrate to.
But often enough to be a problem, they aren't. So it is a problem, and it does break cross-platform. MS have done with CLI what IBM (et al.) do with J2EE -- they've provided their own classes above and beyond what the spec requires.
 
Originally posted by bjrady:
Exactly my point. Java ISN'T the golden hammer. That's why using JNI is pointless (and a hack).
Bollocks. Rewriting your entire program tied to a single platform and in a lower-level language simply because you had to write one class in C++ (or whatever) because it needed to ('go fast', 'use OS functionality', 'etc.') is absolutely fucking idiotic.

If performance is a priority, don't use Java,
Performance isn't a priority uniformly. You don't need to make pieces of code that aren't bottlenecks any faster. If Java is sufficient for them, there is no reason -- at all -- to write them in some faster language. If you isolate a particular part of the program as being a bottleneck, you might wish to rewrite that (if you can't simply throw hardware at it). But there is no point in rewriting the whole thing.

if you have legacy code, why are you porting to Java in the first place?
Because it's the first step in an eventual complete transition?
Because you want something that's supported, and that you can cheaply hire developers to work on?
Because it offers some/many benefits over what you're currently using?

Is it really that necessary?
It could be. It's not your place to say that it isn't.

.NET ins't the golden hammer either, but Microsoft is saying that it is. The reality is that there's no such thing as a tool that does EVERYTHING...that why there are lots of different ones out there.
I think that .NET (certainly after a release or two) will be a tool suitable for developing any user-mode code. That's a much broader scope than I think Java manages.

I think the post above about the Win32 explains it well. As long as Microsoft controls the guts, you'll never know exactly what it's doing because it's all closed source.
You don't have to know exactly what it's doing. You merely have to know that using a given class (say) draws a window on the screen.

What we're talking about here is the CLR...the Windows implemention of the CLI (as I understand it to be)...not the CLI.
And what you were also talking about was the MS implementation of Java, not the Java standard/platform itself.

The CLI alone would create a decent cross-platform system. The whole problem is that Microsoft is 'embracing and extending' the CLI to add in Windows Specific functionality (the result being the CLR). This misses the whole point of a cross-platform development system in that one of the implementations of the basic spec (the CLR) has features that other implementations may not (or indeed, cannot) have.
There is nothing, at all, that says the other implementations cannot have them. And the criticisms you make of .NET can also be levelled at Java. MS are not the only vendor to supply additional classes that go above and beyond the base specification. It hasn't been the death of Java, it won't be the death of .NET.

Microsoft only did it because they had to,
No. In no way did MS "have to" work on the SOAP spec. Perhaps you might argue that they "had to" implement it. But they did a great deal more than that.

not because they care about making secure or interoperable products. In other words, they only add what the market specifically asks for, and as such they do not innovate in those areas. This may help them maintain their monopoly, but it does not create quality software and it is not a healthy, long term view (but then again, when you're a monopoly, why should you care about the long term?).
When you're a monopoly that's all you care about. And you will suffer a short-term reduction in profits in order to maintain your monopoly.

Security is often in direct conflict with functionality. Again, Microsoft Outlook is the prime example. They wanted to have ActiveX controls in their e-mail client because it's more Gee-Whizary, and they didn't care about the fact that there is an inherient security risk in implementing that. Functionality over Security. Microsoft will make that decision the same way every time.
Nope. The problems with Outlook's ActiveX controls isn't that the functionality is directly opposed to security. It's that they've got occasional problems whereby controls are marked as being safe-for-scripting when they shouldn't be (or similar bugs whereby they can trick Outlook into thinking things are on the local computer when they should be treated as being on the Internet). There is no issue with the functionality, there are some issues with their [buggy] implementation of that functionality.

As far as interoperability goes, yes it a feature, but it's a feature that Microsoft will not implement in a standard way, because they're monopolistic and don't need to use other products in order to be competitive.
:confused:

SOAP?
COM?
X?L?
HTTP?
IP?
etc.?

Microsoft doesn't think it needs to play well with Linux, and maybe rightly so considering the distribution of market share, but either way, they don't care about working with other products.
I think their actions demonstrate quite the opposite.

Who is working on that? Certianly not Microsoft.
MS/Corel, Ximian.

And nobody else is going to be able to because 1) Microsoft will create new functionality faster than any other company could implement it on another system, and 2) Microsoft will hide (at all costs) the inner workings of the Windows Specific functionality so that the API will never be truly open. For example, a function like:
But third parties are implementing it.

CInteralMicrosftStructure* GetWindowProp();

could easily be implemented in the CLR, because it's windows specific and not bound the the specifications of the CLI, but nobody outside of Microsoft has the documentation on what CInteralMicrosftStructure is or what it does! And if you have to reverse engineer every one of those GOTCHA's you'll never get anything done.
Except, oh dear, they don't do that, and would be hard-pressed to do that, because of the way .NET adds metainformation to code.

Good point, it's not 90%. However it is naive to assume that those features will not be used.
They won't be used by those wanting cross-platform code. Until, that is, they become part of the spec.

I don't know the exact number of developers that will use them, but in reality it doesn't matter. The functionality should be the same across ALL implementations so that you don't have to worry about whether or not your 'platform agnostic' program is really platform agnostic.
So I guess you're damning Java too?

Also, the underlying platform should be able to evolve and change independent of the application that's running on it. If you tie the application directly to the platform, every time the platform changes, if you want to use the latest features, you have to change the application too. When you abstract through a virtual machine, that's not necessary...the VM can use the new features without the application ever knowing about it.
The same is equally true of .NET.

Another good point, but you can achieve the same thing with a good Object Oriented design in a platform specfic language like Visual C++ (see, I don't hate ALL MS products...just the bad ones =).
Yeah, except you're lacking itty bitty things like a standard cross-platform class library (STL isn't there yet, different implementations are still too buggy, different *compilers* are still too buggy), standard cross-platform multithreading, and so on.

The only case I really see this being useful is when high performance and high portability are both critically important in a project (Like a 3D web brower, for instance). Otherwise you'd just be better off using a more straightforward method.
.NET (or Java, to IMO a lesser extent) could well be that "more straightforward" method.

Ah, but you can't. Not without sacrificing all the functionality that's built into Windows.
And you can't write cross-platform Java apps without sacrificing the functionality that a particular vendor supplise. What's your point?

This gets back to the point I was making earlier about 90% of the market and 90% of the developers. Microsoft is always going to put all their effort into adding new stuff to the CLR, because CLR functionality IS Windows functionality, and that is their core business. No other company on the planet is going to be able to keep up with them, especially considering how facist MS is about thier source code. So the choice will be Windows specific, or severly limited in functionality...which is an obvious choice for most developers.
I think the developers of Mono would take issue with your claim.

How is being tied to Microsoft products going to make it easier to change development tools?
I said, "break out of .NET" -- to use underlying Linux/FreeBSD/Win32 functionality, for instance.

Microsoft has a history (as I've said before) of not playing well with other companies because they want to maintain their monopoly. SUN, IBM, and other companies outside the Microsoft 'family' have to be interoperable because if they're not, they won't be competitive. Case in point, There's a JVM for WindowsXP written by SUN, and supported by SUN. When is Microsoft going to write a CLI implementation for Solaris? Never...
Frankly, it doesn't much matter what MS do or don't do. There is at least one third-party .NET implementation, so it really does not matter.
 

EgalitarianBovine

Ars Tribunus Angusticlavius
8,086
I imagine that's as much to do with the breadth of what they have to do as it is anything else. The same doesn't hold true of .NET, with the bulk of the classes that would, in Win32, be proprietary, being standard. It greatly restricts (and simplifies; the interfaces are much cleaner) those areas that are MS-only.

This isn't certain at all. It depends on how complex they are, and how closely they are tied to windows platform idiosyncracies. If you have to simulate half the platform to emulate an API, it's not really that easy.

And as long as you don't use the MS-only classes in .NET (though how long they remain MS-only is anyone's guess) the same is true of that, too. Yes, it requires some discipline from the programmer. So does Java. Deal with it.

This is already true. As long as you use QT, or wxWindows, and other cross platform toolkit, you won't be restricted to win32. How much has that affected portability?

And no, it doesn't just require "some discipline", it requires more discipline than with java. Java makes it harder to tie your code to any platform. It doesn't simply offer you a set of win32 classes to work with - you must go out and write your own, or specifically get a 3rd party native interface library and use that instead.

I don't see the big change with .NET and what's already there. The potential to write cross platform code already exists. How many companies forego that in favour of win32 specific code? Likewise, the potential for .NET cross platform code may exist, but how much do you actually expect this to happen? As far as I see it, it's not much of a change from the current state of things.

But often enough to be a problem, they aren't. So it is a problem, and it does break cross-platform. MS have done with CLI what IBM (et al.) do with J2EE -- they've provided their own classes above and beyond what the spec requires.

Are the extra j2ee extra classes only restricted to certain platforms? or are they pure java?

-EB
 
Originally posted by EgalitarianBovine:
This isn't certain at all. It depends on how complex they are, and how closely they are tied to windows platform idiosyncracies. If you have to simulate half the platform to emulate an API, it's not really that easy.
But you don't, and you wouldn't.

This is already true. As long as you use QT, or wxWindows, and other cross platform toolkit, you won't be restricted to win32. How much has that affected portability?
It has improved it. Allowing one to use RAD tools (like Kylix, but cheaper) to develop such code will improve it further.

And no, it doesn't just require "some discipline", it requires more discipline than with java. Java makes it harder to tie your code to any platform. It doesn't simply offer you a set of win32 classes to work with - you must go out and write your own, or specifically get a 3rd party native interface library and use that instead.
Except for vendors shipping such 3rd party stuff by default.

I don't see the big change with .NET and what's already there. The potential to write cross platform code already exists. How many companies forego that in favour of win32 specific code?
If you want to write, say, threaded code now, you don't have a lot of choice. Qt (for instance) is pricey, x-platform has no gain in and of itself. You use the native APIs because there's frankly not a lot of choice. With something like .NET you use the x-platform APIs by default -- because there'd be no point in doing anything else.

Likewise, the potential for .NET cross platform code may exist, but how much do you actually expect this to happen? As far as I see it, it's not much of a change from the current state of things.
I think it'll serve to greatly reduce the barriers to x-platform code.

Are the extra j2ee extra classes only restricted to certain platforms? or are they pure java?
Sometimes they're pure Java, sometimes they're not.
 

bjrady

Seniorius Lurkius
31
I'm going to sum up my argument in the interests of time. Respond if you wish, but this is all the time I can devote to this (Unfortunarly, becuase it's been interesting)

The key in software development is to use the right tool for the right job. If you goal is to write cross-platform applications, Java is the right tool for that job. Microsoft, with it's .NET stragegy, has proposed that including platform specific code in a cross-platform application is a good thing. It is clearly not. While it may be necessary in some situations, there are design methods you can use to overcome most issues while still preserving cross-platform compatibility.

When an application is competely insulated from the underlying operating system, it is not only cross-platform compatable, but it can instantly take advantage of new functionality in the O.S. without being re-written. If all the implementations of the sandbox are the same (as they are in Java), then all the core functionality will be present, regardless of the operating system. These advantages make 'staying in the sandbox' very worth while.

However, I contend that .NET application developers will not only be ecnouraged to work outside the sandbox, but that they will be forced to through market pressue. Microsoft's CLI implementation, the CLR has functionality that no other implementation has. Although it is POSSIBLE for that functionality to be added to other CLI implementations, I don't think that any other entity has the resources to keep up with microsoft's additions the the CLR. Furthermore, microsoft will probably not be forthcoming with the source code behind the CLR, making their extra additions to the original CLI spec even harder to copy.

Microsoft will work hard to make the CLR the 'de-facto' standard for CLI implementations, but at the same time, prevent 3rd parties (through thier Intellectual Property policies) from developing a full-fledged copy of the CLR. While vendor plugins and platform specific addons are available and sometimes necessary, the core implementation should always be completely O.S. agnostic. The CLR is not, and I believe Microsoft will use it's might to make sure that anything that doesn't have the CLR 'extensions' will be unacceptable to most users, thereby making IT the core standard, and not the CLI.

The reason for microsoft's .NET strategy is clear. They want all non-windows applications to run on Windows, but they don't want Windows apppications to run on anything else. If .NET is implemented as proposed, that's exactly what they'll get.
 

Handor

Ars Tribunus Militum
2,513
Microsoft, with it's .NET stragegy, has proposed that including platform specific code in a cross-platform application is a good thing.

They've said nothing of the kind. That's the point. If you are writing a cross-platform application, they will tell you only to use the ECMA standardized class subset. If you are not writing any such solution, then you can use either platform-neutral or platform-sensitive components, because

The key in software development is to use the right tool for the right job.

What you don't seem to understand is that .Net is a framework within which you can write purely managed, entirely portable applications, mixed-mode applications, or applications which run entirely outside but occasionally want to peek inside for some nonessential reason. This means that a successful CLI environment makes it possible, as PeterB said, to implement just about anything in the .Net view- which acknowledges the need for all styles of development. It's not a golden hammer because it's not just one tool. It's not just a runtime. It's a framework for interoperation, on top of which is built a runtime, yes, but also a lot of other things. When you understand this you will understand why .Net isn't some chimera which can't decide what it wants to be. It's a world in which you can operate, and you can choose how you live.

It also, with the ECMA, happens to be a democracy.

Microsoft's CLI implementation, the CLR has functionality that no other implementation has.

Such as....? The three biggest missing areas of the CLR from the CLI are Windows Forms, ADO.Net, and ASP.Net. All three are being developed with the Mono project.

Although it is POSSIBLE for that functionality to be added to other CLI implementations, I don't think that any other entity has the resources to keep up with microsoft's additions the the CLR.

I'm not even a proponent of OSS, but I think you undersell them.

While vendor plugins and platform specific addons are available and sometimes necessary, the core implementation should always be completely O.S. agnostic. The CLR is not, and I believe Microsoft will use it's might to make sure that anything that doesn't have the CLR 'extensions' will be unacceptable to most users, thereby making IT the core standard, and not the CLI.

The CLR is indeed platform agnostic. It's uses a Virtual Execution System (VES) to run all managed code, including Microsoft's. Native code is not run within the CLR, but is communicated with from outside. That is to say, any code the CLR runs is entirely agnostic of platform; it's only that the CLR itself happens to be platfrm aware, allowing invocation of native methods outside of itself.
This is true of all CLI implementations that meet with the spec.

The reason for microsoft's .NET strategy is clear. They want all non-windows applications to run on Windows, but they don't want Windows apppications to run on anything else. If .NET is implemented as proposed, that's exactly what they'll ge

Are you aware that there are at least three entirely divorced strains of Windows actively supported and developed by MS at this time? NT, CE, and Windows for Smart Card-- forget even the DOS/3.x/9x lines of OSes.

There are lots of people, even at MS, who wish there could be a single deployent target, especially as WinCE and WinSC are on the rise. Frankly Windows (as in NT) probably gets almost as much competition from CE as it does from Linux or Apple.

Of course MS wants to push Windows. But they haven't gotten to the top and stayed there by taking a narrow view. There's way, way more to .Net than simply a reaction to Java.
 

DaisyMan

Ars Tribunus Militum
2,135
This just caught my eye.

It has improved it. Allowing one to use RAD tools (like Kylix, but cheaper) to develop such code will improve it further.
Kylix Open Edition is free. The Pro is $250. How much do you think the VS.NET package will go for?

If you want to write, say, threaded code now, you don't have a lot of choice. Qt (for instance) is pricey, x-platform has no gain in and of itself. You use the native APIs because there's frankly not a lot of choice. With something like .NET you use the x-platform APIs by default -- because there'd be no point in doing anything else.
Or use Delphi's TThread abstraction for threading, which works the same on Delphi/Kylix Windows/Linux.
 

stickboy

Ars Tribunus Angusticlavius
6,218
Subscriptor
I generally like the language syntax of Java, and C# looks about the same, but one of things that really bothers me about both is their dependence on an interpreter.

I don't care about cross-platform compatibility of the binary. What's wrong with portable code and cross-platform compilers?

A lot of times I'll want to write a small, console-mode tool that's probably less than 100 KB. A lot of times Java would be more convenient than ANSI C, but if I think it might be useful to others and want to distribute it, it seems silly to expect people to download and install the multi-megabyte JRE to run a 100K app. Ugh.

Is C# any different? If the standard C# compilers allow it to be compiled to native, executable binaries, I probably will switch to that for most of my development. If not I'll probably stick with C.
 

Handor

Ars Tribunus Militum
2,513
Stickboy: C# is not interpreted. It's basically runtime or install-time compiled. Then the native code image is cached and executed as needed. Since the IL version is still around you have access to a whole lot of nice metadata information and can do a mixed mode execution or whatever you want. But in theory, IL code always runs native.

Note that depending on the specific CLI implementation this can vary, because people can make differing design choices and compilation strategies. Note also that Java can be JITted as well.

However, C# does require the use of a multi-megabyte runtime, so it might not suit your needs unless you're targetting a group that is sure to have the Runtime.
 
Status
Not open for further replies.