in reply to Re^3: Perl and C# - how I use both
in thread Perl and C# - how I use both

Is C# really better in this respect?

Yes

C# can be blazingly fast and the garbage-collector functions in a well-documented, predictable manner. Coming from Perl it worked (almost) as I would expect it to. When an object goes out of scope or has no more dangling references, it is elligible for garbage-collection.

No

This is WINDOWS we're talking about. If it were a car you purchased from Microsoft, it would come without locks on the doors, and the nice Michelin tires would only be yours for the first 60 days. Locks would cost extra and cause your car to be incapable of driving faster than 45 miles per hour. The same company that produces the locks would also be paying car thieves to break into cars while you're not looking.

Memory management is just not something I could consider Windows to be particularly good at. However, from my experience running BEA WebLogic (Java) instances on Windows and running fairly complex ASP.Net applications on Windows, I can say with confidence that the Java apps took about 5x more RAM and CPU than the .Net ones, and were more difficult to deploy, update, code and debug. The ASP.Net ones were fairly easy to manage and code, and ran much faster than the Java apps.

The ASP.Net apps became extremely slow when the ViewState contained too much stuff. Using ASP.Net MVC instead of the bizarre "event-based" ASP.Net (the default thing where you assign actions to the buttons that users click, etc) sped things up considerably.

.Net is definitely not my favorite thing in the world, but given the choice between doing the job in .Net and not doing it at all, I will choose .Net every time.

Replies are listed 'Best First'.
Re^5: Perl and C# - how I use both
by tilly (Archbishop) on Mar 10, 2009 at 20:51 UTC
    I would ask whether those differences are from the language or the framework. I won't dispute that Microsoft produced frameworks that are better than a lot of the frameworks you find in the Java world. But the little bit of experience I have says that Java coded in a sane manner performs very well and has good memory usage properties. Not that I've looked, but I haven't seen anything indicating major difference between the raw performance of .NET and the JVM. And I know the JVM today is much, much better than it used to be.

    Speaking personally when I'm forced away from Perl I'd prefer to go to Java than .NET. But that is due to disliking Microsoft, and not wanting to have any factor locking me in to any Microsoft platform.

      Speaking personally when I'm forced away from Perl I'd prefer to go to Java than .NET. But that is due to disliking Microsoft, and not wanting to have any factor locking me in to any Microsoft platform.

      Hey, keep on hackin' in the Free world.

        I was actually interested in an answer to tilly's question. What is it that makes .Net better for you than the JVM with regards to performance / memory use? Because I haven't seen extreme differences in my situations either.