Where is I++ in VB.Net? 
Author Message
 Where is I++ in VB.Net?

They give us I*=3 and I+=5 (traditional C statement syntax). But where is
I++? Will this be in another beta? If it is, can I assume that we might be
have prefix ++I as well?

Just a thought.

Peter



Sun, 14 Sep 2003 18:07:54 GMT  
 Where is I++ in VB.Net?
Peter,

Quote:
>But where is I++?

In C#  :-)

Quote:
>Will this be in another beta?

Seems unlikely.

Mattias

====================================

http://www.msjogren.net/dotnet/

CodeHound - The Software Developer's Search Engine
http://www.codehound.com



Sun, 14 Sep 2003 18:18:13 GMT  
 Where is I++ in VB.Net?
A fundamental concept in BASIC is "One Line, One Action", so I don't think
it will happen.

I++ will cause more problems in VB than it can ever solve. All it gives us
is a one character advantage.

I++ => I+=1

The cost is the introduction of ambiguous situations. The syntax is defined,
but not the semantics. In C, there are expressions that result in different
values depending on the compiler.

--
Jonathan Allen


Quote:
> They give us I*=3 and I+=5 (traditional C statement syntax). But where is
> I++? Will this be in another beta? If it is, can I assume that we might be
> have prefix ++I as well?

> Just a thought.

> Peter



Sun, 14 Sep 2003 19:25:41 GMT  
 Where is I++ in VB.Net?
You know Jonathan I've always liked overloaded operators but as you've
pointed out, they cause more problems than they solve. Let's keep it out of
VB.


Quote:
> A fundamental concept in BASIC is "One Line, One Action", so I don't think
> it will happen.

> I++ will cause more problems in VB than it can ever solve. All it gives us
> is a one character advantage.

> I++ => I+=1

> The cost is the introduction of ambiguous situations. The syntax is
defined,
> but not the semantics. In C, there are expressions that result in
different
> values depending on the compiler.

> --
> Jonathan Allen



> > They give us I*=3 and I+=5 (traditional C statement syntax). But where
is
> > I++? Will this be in another beta? If it is, can I assume that we might
be
> > have prefix ++I as well?

> > Just a thought.

> > Peter



Sun, 14 Sep 2003 22:11:19 GMT  
 Where is I++ in VB.Net?


Quote:
> A fundamental concept in BASIC is "One Line, One Action", so I don't think
> it will happen.

> I++ will cause more problems in VB than it can ever solve. All it gives us
> is a one character advantage.

> I++ => I+=1

It gives more then that when used inside longer statements:
   a(i++)=b(j++)

Quote:
> The cost is the introduction of ambiguous situations. The syntax is
defined,
> but not the semantics. In C, there are expressions that result in
different
> values depending on the compiler.

All that means is that both the syntax and semantics need to be defined for
the VB.Net implementation.
I always found the prefix and postfix operators in C to be very useful and
easy to work with.  Things could get hairy if you overuse them but almost
any feature can be abused and that doesn't mean it can't be used
effectively.


Sun, 14 Sep 2003 23:02:43 GMT  
 Where is I++ in VB.Net?

Quote:

> It gives more then that when used inside longer statements:
>    a(i++)=b(j++)

Okay, better explanation: it gives a 1 character advantage per time used.
But then, I presume that's what Jonathan meant originally, since it'd be
quite difficult for a piece of syntax to offer a one character advantage one
time it was used, and not the next, when you compare it to another piece of
syntax, assuming you don't change either along the way.


Sun, 14 Sep 2003 23:58:29 GMT  
 Where is I++ in VB.Net?


Quote:

> > It gives more then that when used inside longer statements:
> >    a(i++)=b(j++)

> Okay, better explanation: it gives a 1 character advantage per time used.
> But then, I presume that's what Jonathan meant originally, since it'd be
> quite difficult for a piece of syntax to offer a one character advantage
one
> time it was used, and not the next, when you compare it to another piece
of
> syntax, assuming you don't change either along the way.

When used in more complex expression it eliminates one or more statements
and that ends up being more than a single character per use.  However you
look at it, I find it  useful feature and C and would definitely make use of
it in VB if it were available.  I'd like to see it added.


Mon, 15 Sep 2003 00:07:33 GMT  
 Where is I++ in VB.Net?

Quote:
> I'd like to see it added.

I'd hate for it to be added in the C sense, since it makes divining
actual intent when reviewing John Q. Corporate Programmer's brain
farts that much harder. Besides, it violates one of BASIC's unwritten
rules that only one fundamental thing happens per line. So:

x++  ' fine, but what's the point
foo(++x, x++, ++x, x++) ' hmm... www.dice.com



Mon, 15 Sep 2003 01:13:12 GMT  
 Where is I++ in VB.Net?


Quote:
> > I'd like to see it added.

> I'd hate for it to be added in the C sense, since it makes divining
> actual intent when reviewing John Q. Corporate Programmer's brain
> farts that much harder. Besides, it violates one of BASIC's unwritten
> rules that only one fundamental thing happens per line. So:

> x++  ' fine, but what's the point
> foo(++x, x++, ++x, x++) ' hmm... www.dice.com

Being able to abuse a feature isn't, imo, sufficient reason to eliminate it.
Most things can be abused but used judiciously they have value

a(x++)=0

a(++x)=b(--y)

 Putting compiler restrictions on it (e.g. a variable with a prefix or
postfix operation on it can't be used more than once in the line) would be a
reasonable way to add the feature and still reign in much of the potential
abuse.  Using that restriction, for example, the line "foo(x++,--x)" would
be illegal but "foo(x++,--y,z++)" would be allowed.



Mon, 15 Sep 2003 02:37:52 GMT  
 Where is I++ in VB.Net?

Quote:
>Being able to abuse a feature isn't, imo, sufficient reason to eliminate it.

True if you develop alone or in a proficient team; false if you have
to clean up messes left by, erm, let's say less than competent
individuals. Rope to hang themselves with? I've seen some that could
hang themselves with a 3" piece of twine.


Mon, 15 Sep 2003 06:11:34 GMT  
 Where is I++ in VB.Net?


Quote:

> >Being able to abuse a feature isn't, imo, sufficient reason to eliminate
it.

> True if you develop alone or in a proficient team; false if you have
> to clean up messes left by, erm, let's say less than competent
> individuals. Rope to hang themselves with? I've seen some that could
> hang themselves with a 3" piece of twine.

me too (goo riddance! <g>)


Mon, 15 Sep 2003 06:24:46 GMT  
 Where is I++ in VB.Net?

Quote:
> All that means is that both the syntax and semantics need to be defined
for
> the VB.Net implementation.

Ok, lets play. Show me sequentially what this line does. Then we will take a
look at the possible problems.

Quote:
>    a(i++)=b(j++)

--
Jonathan Allen


Mon, 15 Sep 2003 07:58:11 GMT  
 Where is I++ in VB.Net?

Quote:
> Being able to abuse a feature isn't, imo, sufficient reason to eliminate
it.
> Most things can be abused but used judiciously they have value

To some (or at least me), using it inside an expression is considered
abusive. Using any destructive operation inside another expression is
questionable in my book.

Anyways, you still haven't answered...

Quote:
> > foo(++x, x++, ++x, x++) '

If you cannot simply look at it and get a good idea of what is happening,
then it violates another guiding philosophy of Basic programming.

--
Jonathan Allen



Mon, 15 Sep 2003 08:06:56 GMT  
 Where is I++ in VB.Net?

Quote:
> All that means is that both the syntax and semantics need to be defined
for
> the VB.Net implementation.

Ok, lets play. Show me sequentially what this line does. Then we will take a
look at the possible problems.

Quote:
>    a(i++)=b(j++)

--
Jonathan Allen


Mon, 15 Sep 2003 07:58:11 GMT  
 Where is I++ in VB.Net?

Quote:
> Being able to abuse a feature isn't, imo, sufficient reason to eliminate
it.
> Most things can be abused but used judiciously they have value

To some (or at least me), using it inside an expression is considered
abusive. Using any destructive operation inside another expression is
questionable in my book.

Anyways, you still haven't answered...

Quote:
> > foo(++x, x++, ++x, x++) '

If you cannot simply look at it and get a good idea of what is happening,
then it violates another guiding philosophy of Basic programming.

--
Jonathan Allen



Mon, 15 Sep 2003 08:06:56 GMT  
 
 [ 25 post ]  Go to page: [1] [2]

 Relevant Pages 

1. I am learning VB.NET and am wondering....

2. i am using vb.net and crystal reports for visual studio.net

3. I am writing a book about VB .NET, and I need your help you

4. I++ instead of i=i+1?

5. VB.NET: Steps for Converting a Windows .NET Application to a Web .NET Application

6. ADO.NET with ASP.NET using VB.NET

7. how to use the system.net.sockets and system.net in VB.net

8. VS.Net + Cr.Net and VB.Net

9. I am still confused with using ADO.Net

10. Difference between VB NET and VB NET 2003

11. Convert VB.Net to C#, convert C# to VB.Net

12. VB.NEt Beginner: Creating a COM+ Object in VB.net

 

 
Powered by phpBB® Forum Software