Results 1 to 6 of 6

Thread: Is C# VB ??

  1. #1

    Thread Starter
    New Member
    Join Date
    May 2002
    Location
    Bucharest, Romania
    Posts
    11

    Is C# VB ??

    Ok... I'm trying to decide which programming language to learn and... well I can't decide!

    From the look of C# it appears to be just a VB with a syntax change, and, although I've programmed in VB before I find it a little "not as powerful" as VC++

    So my question is: Does C# offer the same performance as VC++?

    I tried to figure this one out and created a blank form (in C# or VB, it doesn't matter, they make it the same), classic windows app and when ran, the task manager showed me it used about 6 megs of memory. In VC++ a MFC app uses a little over 3 megs and a classic generated "Hello world" app 2.8 megs... so I'm talking about optimization and making your app use as little memory as possible.

    P.S. do you know why the win processes use so little mem? 'cos I don't! (a very small console C++ app uses like 800Kb)
    Are they written in Asm or something like that?

  2. #2
    PowerPoster hellswraith's Avatar
    Join Date
    Jul 2002
    Location
    Washington St.
    Posts
    2,464
    Well, for the most part, VB.Net and C#.Net are 99% the same. There are things you can do in C# that you can't in VB.Net, and there are also things you can do in VB.Net that you can't do in C#. The cool thing is if you know both languages, you can just use which ever one you need to use if you run into a situation that requires one language over the other. So for most purposes, yes, they are the same, just different syntax.

  3. #3
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    -C# is as powerful as managed .NET C++ .
    -C# is in VB.NET form and C++ synatx (not exactly though) .
    -For optimization issue , C++ always and will always wins . It generate small files size than other languages .
    -For memory resource , yes , .NET applications take up more memory than C++ or even VB6 because of the CLR and the way these applications being run ( they first translated into IL code then , JIT compiler compiles that to native code at runtime ) and this make it slow too (at least when you run it for the first time) .

  4. #4

    Thread Starter
    New Member
    Join Date
    May 2002
    Location
    Bucharest, Romania
    Posts
    11

    Hmmm....

    OK...

    First of all, thanks
    Second, I think VC++ generates larger executables only they use fewer resources than VB (an empty app - just a window in VC++ takes ~130Kb but in VB at most 20Kb, it could be just the empty app in general but...)

    now I did a little testing and found out that if you minimize an app and then restore it, it would use fewer resources (I think the memory is filled with initialization stuff) from 10Megs (a empty app in C#) it went down to 600Kb! and when restored it went up and stayed there at around 2.5Megs... any idea on how to get rid of unused resources? (for the fun of it I tried minimizing and then restoring an app at run-time and got some really interesting results - from 6Mb used it dropped at around 2Mb)

    P.S. I recently installed MASM32 and THAT's optimization... it generates an executable that's 3Kb long and it does a lot of stuff.
    Not that I'm gonna learn assembly though

  5. #5
    PowerPoster hellswraith's Avatar
    Join Date
    Jul 2002
    Location
    Washington St.
    Posts
    2,464
    You don't have to worry about mem usage as much with .Net. There are instances when you definately want to release the memory right away, but for the most part, the Garbage Collector built into the CLR will take care of it for you.

    The Garbage Collector is lazy, it will let memory build up until it needs to do a collection. This gives better performance because the garbage collection processes isn't always running. You can force a collection if you need to though.

    With .Net, you shouldn't really worry to much about the memory usage and let the CLR handle it for you. Unless you are using huge memory intensive resources, then you will want to free those explicitly.

  6. #6

    Thread Starter
    New Member
    Join Date
    May 2002
    Location
    Bucharest, Romania
    Posts
    11

    OK...

    OK... I got it

    But when you look in that Task manager and see that your app is using over 10% of your system's resources, you get a little freaked out... anyway, I tried that collection.release or something like that and it didn't do anything.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width