PDA

View Full Version : .NET vs Java



Scarvenger
10-30-2006, 10:41 AM
Hi, i am Felipe. I am doing a program for the Imagine Cup where we all should use .NET framework. Iīm at the start of the development and i saw that my program is using like 45.000K of memory, i really think that it is abusive. Is Java just like that or am i wasting time studing deeply .NET framework that isnīt even portable? Im at a crisis, please, help me.

Prelude
10-30-2006, 11:32 AM
>my program is using like 45.000K of memory, i really think that it is abusive
It depends on what your program does.

>Is Java just like that
It depends on how you write it. In fact, it depends on how you've already written it. If you're wasting memory all over the place and using large features then naturally you'll have a bulky process. The same goes with Java, especially if you don't use JIT. The problem with Java and .NET is that it's so very easy to write horrible code for the sake of convenience.

>or am i wasting time studing deeply .NET framework that isnīt even portable?
I'll ignore the flamebait manner in which you asked that and say that it's impossible to waste time if you're learning something.

Scarvenger
10-30-2006, 11:39 AM
im sorry if i have been ofensive, i dont know actually how to express myself well in english, by the way, do you have any tutorial saying how to write good code that doesnīt consume much memory and is fast with .NET? Im really in need of that thank you.

Prelude
10-30-2006, 11:49 AM
>do you have any tutorial saying how to write good code that doesnīt consume much memory and is fast with .NET?
That's strictly an experience thing. As you practice more, you learn what works and what doesn't, what's fast and what's small, etc...

Scarvenger
10-30-2006, 11:59 AM
Is seting variables to null eficient? And should i release COM objects after using them?

Prelude
10-30-2006, 01:45 PM
>Is seting variables to null eficient?
Well, it's not inefficient, but it doesn't have zero overhead, especially in the presence of a garbage collector. :p

>And should i release COM objects after using them?
Uh, all resources under your control should be released when you're done with them.

Scarvenger
10-30-2006, 01:53 PM
in XAML, when i hide controls is there a way to release their memory, and when the user asks for it to appear, i reload the control ConsoleGrid in the Scene.xaml?

Prelude
10-30-2006, 02:40 PM
>in XAML
Despite the presence of a C# forum, we generally frown on .NET questions here.

>when i hide controls is there a way to release their memory
Hide and dispose are two completely different actions. If you want fine grained control over your memory, you're basically SOL using .NET.