If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

you are all stupid

hi there,

i have read all the postings about the redrawing of vb.net. let me tell you,
you are discussing about the wrong things.
since years i have only zero-based arrays. arrays are always declared as
array(0 to n) as ...
i never use boolean arithmetic. the result of a boolean operation is never a
direct operator for further operations. these results
are always stored in a variable. if i create a function/sub, parameters are
always declared byval. if i need a parameter byref, the keywword byref is
explicit used for that parameter. i have never used control arrays.
if you would have taken care about some styles of good programming (wich is
required for all programming languages), you would not be in trouble and
could convert all your vb6 code to vb.net, with ease or little workaround.

have you seen karl e. pettersons list of incompatibilities?
look at the first item.
VARPTR is gone. that is the real ugly change.
you can no longer declare an api call parameter as any.
you can no longer use byval/byref explicit in api calls.
im am using very excessive the ms api's, so the winsock, gdi, kernel, user,
mmsystem and i work direct with device drivers. all in vb, and it works
perfecly with much better speed.
since i can no longer find the pointer to a variable, there is no chance for
me, to move my vb6 stuff to vb.net. in a long term i have found, that some
api declares do not work correct.

so i made the magic change. something is a bitmap, someotherthing is an
array.
declare myfunc lib "..." alias " " (something as bitmap, someotherthing as
any) as long
wich gives errors is changed to
declare myfunc lib "..." alias " " (byval something as long,Byval
someotherthing as long) as long
now i call
call myfunc(byval varptr(mybm), byval varptr(myarray(0)))
wich works perfect.
these simple change, from BYREF to BYVAL VARPTR() opened the ms os (and all
api's) complete to vb.
i wrote a lot of code with powerbasic to create windows dll's. all this work
is flushed through the toilette.

ok, ms said VARPTR was an undocumented feature. but is was used commonly and
a real part of the language.

SO THATS WHY YOU ARE ALL STUPID.
THE WAY TO THE UNDERLYING OS IS NOW AND FOR EVER BLOCKED BY THE CLR.

Re: you are all stupid

Torsten,

Have you read Brian Harry's discussion of memory management? I believe it or
a link is also on Karl's site. Once they made those underlying architecture
decisions, pointers are no longer valid, unless the memory is pinned. You
don't really want to do this much.

MS received a lot of input on beta1 and selected the changes they made based
on that input. They got at least some input to prioritize to those changes
that could be accomplished and that could not be changed later. They
announced three changes Wednesday. Anyone who thinks there will only be
three changes in beta2 does not understand the nature of betas, but these
are the three that have been announced by MS.

--
Kathleen
(MS-MVP)
Reply in the newsgroup so everyone can benefit
--

Re: you are all stupid

Re: you are all stupid

Even in C#, pointers are not recommended. As soon as you use them, your code
can no longer be verified. That means it is not suitable for Internet
downloads and applet scenarios.

Pointers also require pinning variables in the heap, which interferes with
the GC.

Pointers cannot be saved, as the GC is constantly moving objects around in
memory.

Pointers are not type safe, which means you can trash memory or even trigger
a GPF.

--
Jonathan Allen

"Torsten Rienow" <torsten.rienow@bcf.de> wrote in message
news:3acdc69e@news.devx.com...
> i read this article.
> but, why are pointers in c# valid, in vb.net not? both adressing the same
> target, the clr.
>
>

Re: you are all stupid

> So what? This is important? Nope.

Randy: That's a pretty myopic point of view; I would expect better from a
developer of your caliber. That's the same attitude displayed by people who
say things like, "I haven't used a GoSub in years; Microsoft should
eliminate it from the language."
---
Phil Weber

Re: you are all stupid

On Fri, 6 Apr 2001 21:20:19 -0400, "Randy Birch" <rgb@mvps.org> wrote:
>: can no longer be verified. That means it is not suitable for Internet
>: downloads and applet scenarios.
>
>So what? This is important? Nope.

It sure is important, for people who like to deliver components with their
webpages/applications. It's also very important for anyone who would like
to distribute an application, potentially delivered in pieces on an "on
demand" basis, over the net.

One thing which is overlooked in all the myopic discussion of this or that
compatability issue is that .net applications and componets are Far
smaller than the VB6/ATL equivalents. Coupled with increasing bandwidth
there are new opportunities for software distribution on the horizon.

So maybe it's not important to you. But it is important to some of us.

Re: you are all stupid

The original question was why aren't they valid in VB.NET while they are in
C#, not why pointers can be dangerous. Or are you saying that VB.NET should
not allow you as much flexibility as C# ??

more comments inline :

"Jonathan Allen" <greywolf@cts.com> wrote in message
news:3ace09df@news.devx.com...
> Even in C#, pointers are not recommended. As soon as you use them, your
code
> can no longer be verified. That means it is not suitable for Internet
> downloads and applet scenarios.
>

That is a broad generalisation. In untrusted situations yes they are less
suitable, but no more so than activex controls. For intranet and in trusted
scenarios the use of pointers is no obsticle.

> Pointers also require pinning variables in the heap, which interferes with
> the GC.
>

really ?? Do you have a reference for that ? I thought pointers allowed
you to work with unsafe blocks and also with memory outside the realm of the
GC.
> Pointers cannot be saved, as the GC is constantly moving objects around in
> memory.
>

That depends on what the pointer is pointing to, whether or not it is in the
GC heap. Examples would be a block of memory such as a MemoryMapped file, or
for rapid double buffering of graphics etc. In such cases the pointer can be
saved for the duration of the operation or even the lifetime of the
application.
> Pointers are not type safe, which means you can trash memory or even
trigger
> a GPF.
>

you can still trash memory and trigger a GPF in VB.NET without requiring
pointers.
In anycase, how does any of what you have said relate to the specific
question which was why they are supported in C# not in VB.NET, after all
both do run on top of the CLR.

Re: you are all stupid

bill, you are the first who has recognized the problem.

for somebody, who cannot deal with pointers to memory,
it is not recommended to use them.
i have used them for a long time in vb, know all the problems
and can handle memory now with ease.
what i want is to decide by myself, if i use memory in a low
level way or not. it is not on ms to make this decision for me.
my projects needs deep api calls. i cannot move my apps to
vb.net.