Opinions wanted: Use .NET instead of JRE?

Printer Friendly Version Attach Files

wdavatar?user=leiger
leiger
09 Sep 2010 11:32. Edited 2 times. (Edit, Permalink)

Using C# instead of Java, I can do a lot more but it will be restricted only to Windows operating systems for now — I've heard that there are efforts underway to develop a .NET framework on other systems as well but I don't think any of those projects are complete yet, or they may have been cancelled altogether. I need to look into it a bit more.

The .NET framework works in a similar way to Java's JRE. For Java applications to work, you need to install the JRE and the application uses the JRE to run.

For C# applications to work, you need to install the .NET Framework, and applications use the .NET Framework to run. The difference is that while Java apps run on JRE and use it as a virtual machine… with C# applications are compiled directly to native code and .NET is not a virtual machine at all. That means that applications are a lot faster.

The other benefit is that I think C#'s ability to read web pages is much better than Java's. STE can't even read CSS2 at the moment, so CSS3 is completely out of the question. For a web development tool, that's unacceptable.

Included page "inc:signature" does not exist (create it now)

wdavatar?user=bcammo
bcammo

09 Sep 2010 12:40. Edited 0 times. (Edit, Permalink)
Obviously not having it support mac os x would be a blow to me, but I just had a quick look and came across this that you might be interested in. Or you might already know about?

Having a faster app, and support for CSS2 & CSS3 certainly sounds appealing. Would it be much effort to change from Java to .NET? Or would you have to start from scratch?

Well it's food for thought…

Included page "inc:signature" does not exist (create it now)

wdavatar?user=leiger
leiger

10 Sep 2010 15:16. Edited 0 times. (Edit, Permalink)
I have heard of a few attempts but was yet to research it. The link you gave to the Mono Project looks like exactly what is needed to get C# apps running on Mac OS X, so I think that solves the cross-platform problem.

Unfortunately yes, I will have to start almost from scratch.

But I have been working on making STE as modular and as object-oriented as possible, so I will be able to use the existing Java code and port some of the features to C#. Things that took me several days to write in Java only need to be modified to work in C#, and that should mean I spend only a few more hours on it.

For example, the code used for all of the toolbar buttons took me several hours to write in Java, because I was intent on making sure there was absolutely no redundancy at all in the code. That means that one piece of code controls most of the toolbar buttons, and converting that one piece of code into C# will mean I can add those buttons to a C# app almost immediately.

It's very similar to using an [[include …]] in Wikidot - the values of variables that are passed into the included page changes what the include does… and is better than having a separate page to include for every different thing that you want to do.

Also, there are GUI development tools that allow drag-and-drop of components, but I decided from the start that I would not use those and everything is 100% hand-written. Not only does this mean that I understand completely how everything works, but it means that if I was to use a GUI designer this time around for C# development would move a lot quicker than it did when I was using Java. I haven't decided yet if I want to write C# completely by hand or not.

Included page "inc:signature" does not exist (create it now)

wdavatar?user=leiger
leiger

10 Sep 2010 16:12. Edited 4 times. (Edit, Permalink)
Please download Mono and test if you can run this on Mac OS X: STE-CSharp-TestUsingMono.exe.

From what I've read I think that is the file you need. Wikidot has detected the file when I uploaded it, so I'm hoping this means that it will work. Wikidot says this:

PE32 executable for MS Windows (GUI) Intel 80386 32-bit Mono/.Net assembly

I will be downloading Mono for Linux later and will see if I can get it working… but right now I need sleep ;-)

This is a screenshot of it working on the .NET Framework on Windows 7, for comparison with whatever you see when you run it: STE-CSharp-TestUsingMono_Windows7.png. There is a Mono implementation for Windows users as well so I will test it on there too when I have a chance.

Included page "inc:signature" does not exist (create it now)

wdavatar?user=leiger
leiger

10 Sep 2010 16:26. Edited 0 times. (Edit, Permalink)
I will finish the current version of STE that I was working on a few months ago before making a final decision on this. I have completely fixed up the settings dialog and there are several other major improvements, so it'd be a waste if I didn't release it.

Then I might focus instead on some other more specialised projects that use the Wikidot API that I've been wanting to do for a while now. Those applications would be written in C# from the very beginning, if the Mono tests show that C# is a viable option.

Included page "inc:signature" does not exist (create it now)

wdavatar?user=
(user deleted)

10 Sep 2010 17:37. Edited 0 times. (Edit, Permalink)
That sounds good. I suggest writing a small, simple app in C# that uses the API and let Bryce be your beta tester to make sure it'll work for him and other Mac users (who apparently spent way too much on their hardware!)

Included page "inc:signature" does not exist (create it now)

wdavatar?user=tsangk
tsangk

11 Sep 2010 00:16. Edited 0 times. (Edit, Permalink)
I wish I had the ability and effort to learn some "proper" programming :(

Included page "inc:signature" does not exist (create it now)

wdavatar?user=bcammo
bcammo

11 Sep 2010 09:20. Edited 0 times. (Edit, Permalink)
I just downloaded Mono and tried to run the application (from the command line), but I got the following error:

Bryce:~ bryce$ mono /Users/bryce/Desktop/test-ste.exe
WARNING: The runtime version supported by this application is unavailable.
Using default runtime: v1.1.4322

** (/Users/bryce/Desktop/test-ste.exe:26268): WARNING **: Missing method System.Windows.Forms.Application::SetCompatibleTextRenderingDefault(bool) in assembly /Library/Frameworks/Mono.framework/Versions/2.6.7/lib/mono/gac/System.Windows.Forms/1.0.5000.0__b77a5c561934e089/System.Windows.Forms.dll, referenced in assembly /Users/bryce/Desktop/test-ste.exe

Unhandled Exception: System.MissingMethodException: Method not found: 'System.Windows.Forms.Application.SetCompatibleTextRenderingDefault'.
Bryce:~ bryce$

I have absolutely no idea what this means or what to do with it… I am so far out of my depth! Hopefully you can interpret this into something more meaningful.

Bryce

Included page "inc:signature" does not exist (create it now)

wdavatar?user=leiger
leiger

11 Sep 2010 15:11. Edited 0 times. (Edit, Permalink)
Thanks for the error report, I'll have to find out what the problem is and see if I can get it fixed. Will create another app for you to test soon after I've made some changes.

The one you tested was just created with the Visual Studio drag-and-drop editor, so it must be adding some code that Mono doesn't like. Will probably end up doing it all by hand then to make sure I know what code is being used… it might be slower and more complicated to do, but I enjoy the harder stuff more anyway ;-)

Included page "inc:signature" does not exist (create it now)

wdavatar?user=leiger
leiger

11 Sep 2010 15:12. Edited 0 times. (Edit, Permalink)

tsangk wrote:

I wish I had the ability and effort to learn some "proper" programming :(


I will have to start posting on the Learn Java website again soon. Bear with me, as I've been a bit busy lately.

Included page "inc:signature" does not exist (create it now)

Post Reply

Add reply on "Opinions wanted: Use .NET instead of JRE?"

Printer Friendly Version Attach Files

CSS Theme, Images and Code on this website are © Shane Smith 2010-2012. All forum posts by users and documentation licensed under Creative Commons BY-NC-SA 3.0 License.