Re: C# and VB.Net?

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance




"Jon Skeet [C# MVP]" <skeet@xxxxxxxxx> wrote in message
news:MPG.1e0912251fa4e03b98cb31@xxxxxxxxxxxxxxxxxxxxxxx
> Michael S <no@xxxxxxxx> wrote:
>
> <snip>
>
>> And the latter group typically don't adopt OO-principles. They still view
>> a
>> class as some module you just put code and som Dims in, they keep on
>> concatinating strings, declaring their arrays, and don't get why an
>> ArrayList or a StringBuilder could ever be useful. The think in terms of
>> variables and don't get the 'reference on stack, object on heap' model
>> and
>> can't undestand why passing a huge array to a method would be the bad
>> thing.
>
> I don't understand why passing a huge array to a method would be a bad
> thing either though. Arrays are reference types - you're not passing a
> load of data. What kind of problem are you thinking of?
>
> --
> Jon Skeet - <skeet@xxxxxxxxx>
> http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
> If replying to the group, please do not mail me too

My Bad!

I ment huge structs, in loops.

I re-wrote that part a couple of times and wanted to mention value/reference
and also boxing/unboxing. It was not any good, so I erased stuff to get rid
of complex examples, and I guess array just got there and I went along
continuing writing...

Thanks Jon, for making sure people get that passing arrays is not bad.

- Michael S



.



Relevant Pages

  • Re: C# and VB.Net?
    ... > And the latter group typically don't adopt OO-principles. ... > can't undestand why passing a huge array to a method would be the bad thing. ... Arrays are reference types - you're not passing a ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: why cannot assign to function call
    ... and passing the array by reference? ... void mysub (int k, int n) { ... say C was definitely pass-by-reference (for arrays)? ... If one could only use v as a pointer (i.e. access ...
    (comp.lang.python)
  • Re: Difference between passing a number and a variable to a subroutine
    ... This results in code that is consistent with the standard, which is silent on specifying argument passing mechanisms, so it should result in code that is as portable as possible. ... has to pass a lot of large arrays to its subroutines. ... alter them and some do alter them. ...
    (comp.lang.fortran)
  • Re: passing array to function to pick up values
    ... passing around arrays. ... > Hi Birgit, ... > Dim bRes As Boolean ...
    (microsoft.public.word.vba.general)
  • Re: passing char arrays by reference
    ... Et voila - not just one, but two arrays being passed by value. ... Yes, yes, very good - except that what you're really passing by ... are being passed as much by value as the struct itself. ... I, your host for tonight's annual Mental Inflexibility Awards 2008, am in ...
    (comp.lang.c)