From: Bill McCarthy on


"Alex Clark" <quanta(a)noemail.noemail> wrote in message
news:#CYQ206RKHA.5108(a)TK2MSFTNGP02.phx.gbl...
>>>
>>> No it doesn't. Gosub, for example, is not supported in VB.Net. Stop
>
>
> Well goodness gracious, they finally killed it off? I had no idea, but
> thank goodness for that - a wasteful, pointless keyword. It does
> highlight an inconsistency in MS' approach though, as "Call" is similarly
> superfluous and should really have been removed. Unfortunately however,
> GoTo is still supported. I can't think of any reason why any programmer
> (with skills beyond an 11yr old) would need to use GoSub or GoTo, but I'm
> sure there are some on here who will doubtless be professing their undying
> love for both.

GoSub does have some advantages but it does also produce hard to maintain
spaghetti code. Lambda functions and expressions and formalized delegates
are a far better and more elegant way to achieve the same (and a lot more).
I think the real pity about this though is we didn't have a replacement for
GoSub when VB .NET first came out. Of course if they had spent the time it
would take to include Gosub in VB .NET we'd probably still be waiting for
lambdas a lot longer; and lambdas are far more important.


From: Karl E. Peterson on
Bill McCarthy wrote:
> GoSub does have some advantages

Whoa! There's my old friend, Bill. :-)

> but it does also produce hard to maintain spaghetti code.

No, "it" doesn't.

That requires an actual developer prone to such accidents. HTH! ;-)
--
..NET: It's About Trust!
http://vfred.mvps.org


From: Tom Shelton on
On 2009-10-08, Bill McCarthy <bill(a)localhost.com> wrote:
>
>
> "Alex Clark" <quanta(a)noemail.noemail> wrote in message
> news:#CYQ206RKHA.5108(a)TK2MSFTNGP02.phx.gbl...
>>>>
>>>> No it doesn't. Gosub, for example, is not supported in VB.Net. Stop
>>
>>
>> Well goodness gracious, they finally killed it off? I had no idea, but
>> thank goodness for that - a wasteful, pointless keyword. It does
>> highlight an inconsistency in MS' approach though, as "Call" is similarly
>> superfluous and should really have been removed. Unfortunately however,
>> GoTo is still supported. I can't think of any reason why any programmer
>> (with skills beyond an 11yr old) would need to use GoSub or GoTo, but I'm
>> sure there are some on here who will doubtless be professing their undying
>> love for both.
>
> GoSub does have some advantages but it does also produce hard to maintain
> spaghetti code.

I never saw anything wrong with gosub as a language structure, but since I
came to the VB party in version 4 when it was already documented as being a
huge perfromance hit to use - I never got in the habbit of using it in VB...

Though, I used it quite frequently in my first formal programming job - since
for the first year, I spend part of my time dealing with code written in a
form of basic called IMS/BASIC - it was port of buisness basic to unix and
unix like systems :)

> Lambda functions and expressions and formalized delegates
> are a far better and more elegant way to achieve the same (and a lot more).

It's too bad that lambdas are so crippled in VB.NET. C# lambda's are far more
useful - especially when coupled with it's custom iterator support.

Still getting better in VB10 - but, this is probably not the place to discuss
that.

--
Tom Shelton
From: Bill McCarthy on
Hi Tom,

"Tom Shelton" <tom_shelton(a)comcastXXXXXXX.net> wrote in message
news:OUaDm47RKHA.1236(a)TK2MSFTNGP05.phx.gbl...
> On 2009-10-08, Bill McCarthy <bill(a)localhost.com> wrote:
>>
>> GoSub does have some advantages but it does also produce hard to maintain
>> spaghetti code.
>
> I never saw anything wrong with gosub as a language structure, but since I
> came to the VB party in version 4 when it was already documented as being
> a
> huge perfromance hit to use - I never got in the habbit of using it in
> VB...
>

Right it was really from an era long ago and had long been abandoned without
replacement ;)


> Though, I used it quite frequently in my first formal programming job -
> since
> for the first year, I spend part of my time dealing with code written in a
> form of basic called IMS/BASIC - it was port of buisness basic to unix
> and
> unix like systems :)
>

Not familiar with it. Did it have formal structures like UDT's or classes ?


>> Lambda functions and expressions and formalized delegates
>> are a far better and more elegant way to achieve the same (and a lot
>> more).
>
> It's too bad that lambdas are so crippled in VB.NET. C# lambda's are far
> more
> useful - especially when coupled with it's custom iterator support.
>

Lambdas in VB9 are limited to those that can be translated into expression
trees. I wouldn't call them crippled as you can still use them for state
machines and use delegates.
Iterators are handy on the few occasions you need them, but the vast
majority of C# code I've seen using custom iterators doesn't actually need
them, and typically suffers inefficiencies. On the few occasions you do
need them, having a good template is really all it takes.


> Still getting better in VB10 -

Yep, then lambdas have the full range of multi statement functions or subs.


> but, this is probably not the place to discuss
> that.
>

Well we are talking about it in context of VB, old and new, in particular
GoSub.










From: Tom Shelton on
On 2009-10-08, Bill McCarthy <bill(a)localhost.com> wrote:
> Hi Tom,
>
> "Tom Shelton" <tom_shelton(a)comcastXXXXXXX.net> wrote in message
> news:OUaDm47RKHA.1236(a)TK2MSFTNGP05.phx.gbl...
>> On 2009-10-08, Bill McCarthy <bill(a)localhost.com> wrote:
>>>
>>> GoSub does have some advantages but it does also produce hard to maintain
>>> spaghetti code.
>>
>> I never saw anything wrong with gosub as a language structure, but since I
>> came to the VB party in version 4 when it was already documented as being
>> a
>> huge perfromance hit to use - I never got in the habbit of using it in
>> VB...
>>
>
> Right it was really from an era long ago and had long been abandoned without
> replacement ;)
>
>
>> Though, I used it quite frequently in my first formal programming job -
>> since
>> for the first year, I spend part of my time dealing with code written in a
>> form of basic called IMS/BASIC - it was port of buisness basic to unix
>> and
>> unix like systems :)
>>
>
> Not familiar with it. Did it have formal structures like UDT's or classes ?
>

I wouldn't expect you to be :) It really is an obscure version of BASIC -
which by the way that company still uses to this day... In fact, when the
company that developed it abandoned it several years ago, they bought the
source code and rights to distribute licenses to their customers.

Anyway, it was a port of the basic language used on the Point 4 Iris systems -
a long forgoten mini-computer system (I've never seen one - though, we still
had 3 or 4 customers running them when I first started that job. So, I did
dial in and work on those systems on occasion - debuging programs etc)

I worked with it full time for the first six months at that job, and then
about half time for the next six months (i was doing perl programming the
other time). After the first year, I still worked with it on occasion doing
custom programming for customers or writting stored procs in it for our in
house sql engine :) We also were moving a lot of functionality to a .NET
based windows product...

>
>>> Lambda functions and expressions and formalized delegates
>>> are a far better and more elegant way to achieve the same (and a lot
>>> more).
>>
>> It's too bad that lambdas are so crippled in VB.NET. C# lambda's are far
>> more
>> useful - especially when coupled with it's custom iterator support.
>>
>
> Lambdas in VB9 are limited to those that can be translated into expression
> trees. I wouldn't call them crippled as you can still use them for state
> machines and use delegates.

Do this in VB.NET:

var list = new List<int>() {1, 2, 3, 4, 5};
list.ForEach ( i => Console.WriteLine (i) );

> Iterators are handy on the few occasions you need them, but the vast
> majority of C# code I've seen using custom iterators doesn't actually need
> them, and typically suffers inefficiencies. On the few occasions you do
> need them, having a good template is really all it takes.
>

I would have agreed with you before 2008. The problem is I find my self
using them much more now that we have linq. IEnumerable has gotten a large
promotion.

>
>> Still getting better in VB10 -
>
> Yep, then lambdas have the full range of multi statement functions or subs.
>
>
>> but, this is probably not the place to discuss
>> that.
>>
>
> Well we are talking about it in context of VB, old and new, in particular
> GoSub.

Yes, but I think we might have crossed the line here a bit - despite what
Kevin and mayayanna(or whatever) may think, I'm not here to discuss VB.NET.
I don't think I will be saying anymore on this topic - unless you want
to discuss it somewhere else.

--
Tom Shelton
First  |  Prev  |  Next  |  Last
Pages: 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
Prev: crack for VSFlex8 in VB6.0
Next: Component Handles