473,385 Members | 1,570 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

'Then' is Optional?!?

VS.NET 2003, ASP.NET Project with Option Strict turned ON.

(yes, I know this is not the aspnet group. This is a VB syntax thing, not
an ASP.NET thing)

This actually compiles without the "Then" keyword. What gives?!?

If Not Page.IsPostBack

End If

--
Peace & happy computing,

Mike Labosh, MCSD

"When you kill a man, you're a murderer.
Kill many, and you're a conqueror.
Kill them all and you're a god." -- Dave Mustane
Nov 30 '05 #1
34 2985
Mike

Look again ,,, and surprise there is your then
however there it was in my situation as soon as i leave the page and return
or even when i jump to another part in the same class VB adds the Then
statement automaticly

so that is what is happening
Regards

Michel Posseth [MCP]
"Mike Labosh" <ml*****@hotmail.com> wrote in message
news:Or**************@TK2MSFTNGP11.phx.gbl...
VS.NET 2003, ASP.NET Project with Option Strict turned ON.

(yes, I know this is not the aspnet group. This is a VB syntax thing, not
an ASP.NET thing)

This actually compiles without the "Then" keyword. What gives?!?

If Not Page.IsPostBack

End If

--
Peace & happy computing,

Mike Labosh, MCSD

"When you kill a man, you're a murderer.
Kill many, and you're a conqueror.
Kill them all and you're a god." -- Dave Mustane

Nov 30 '05 #2
Mike,
If Not Page.IsPostBack

End If

This is one of my wishes, together with making that senseless 'Dim' optional

:-)

Cor
Nov 30 '05 #3
Yes, I think it is optional, though as was pointed out by Mike, the IDE will
put it in for you many times.

Why is this a big deal? It's not like 'Then' is really adding any syntactic
meaning. C# and other languages have if statements without a 'then' just
fine. Isn't VB verbose enough as is?

"Mike Labosh" <ml*****@hotmail.com> wrote in message
news:Or**************@TK2MSFTNGP11.phx.gbl...
VS.NET 2003, ASP.NET Project with Option Strict turned ON.

(yes, I know this is not the aspnet group. This is a VB syntax thing, not
an ASP.NET thing)

This actually compiles without the "Then" keyword. What gives?!?

If Not Page.IsPostBack

End If

--
Peace & happy computing,

Mike Labosh, MCSD

"When you kill a man, you're a murderer.
Kill many, and you're a conqueror.
Kill them all and you're a god." -- Dave Mustane

Nov 30 '05 #4
"Mike Labosh" <ml*****@hotmail.com> schrieb:
VS.NET 2003, ASP.NET Project with Option Strict turned ON.

(yes, I know this is not the aspnet group. This is a VB syntax thing, not
an ASP.NET thing)

This actually compiles without the "Then" keyword. What gives?!?

If Not Page.IsPostBack

End If


If this was really the case I'd consider it a compiler bug ;-).

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Nov 30 '05 #5
Sorry, I mixed something up. 'Then' is optional for the block 'If'
statement.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Nov 30 '05 #6
> Look again ,,, and surprise there is your then


however there it was in my situation as soon as i leave the page and
return or even when i jump to another part in the same class VB adds the
Then statement automaticly


Apparently not, because here's the procedure after several edits, saves,
builds and runs.

Protected Overrides Sub Page_Load(ByVal sender As System.Object, ByVal e
As System.EventArgs) Handles MyBase.Load

MyBase.Page_Load(sender, e)

If Not Page.IsPostBack

Dim ssKey As Integer = Convert.ToInt32(Request.QueryString("ssKey"))

lblHeader.Text = "Reviewing countries in Sample Source " &
ssKey.ToString()

End If

End Sub

--
Peace & happy computing,

Mike Labosh, MCSD

"When you kill a man, you're a murderer.
Kill many, and you're a conqueror.
Kill them all and you're a god." -- Dave Mustane
Nov 30 '05 #7
> Why is this a big deal? It's not like 'Then' is really adding any
syntactic meaning. C# and other languages have if statements without a
'then' just fine. Isn't VB verbose enough as is?


Oh, I'm certainly not complaining about that. :) It's just that I've never
seen any flavor of VB behave like this until today.
--
Peace & happy computing,

Mike Labosh, MCSD

"When you kill a man, you're a murderer.
Kill many, and you're a conqueror.
Kill them all and you're a god." -- Dave Mustane
Nov 30 '05 #8
> If Not Page.IsPostBack

End If


Woah! I missed this the first time I checked the help topics. The MSDN
topic for the "If Statement Visual Basic Language Reference" says this:

"If Then is absent, it must be the beginning of a multiple-line
If...Then...Else."

I guess when in doubt, RTFM *closely* :)

--
Peace & happy computing,

Mike Labosh, MCSD

"When you kill a man, you're a murderer.
Kill many, and you're a conqueror.
Kill them all and you're a god." -- Dave Mustane
Nov 30 '05 #9
> Sorry, I mixed something up. 'Then' is optional for the block 'If'
statement.


Yep, I just found the one-liner that says so, buried below manu paragraphs.
How bizarre.

--
Peace & happy computing,

Mike Labosh, MCSD

"When you kill a man, you're a murderer.
Kill many, and you're a conqueror.
Kill them all and you're a god." -- Dave Mustane
Nov 30 '05 #10
"Mike Labosh" <ml*****@hotmail.com> schrieb:
Sorry, I mixed something up. 'Then' is optional for the block 'If'
statement.


Yep, I just found the one-liner that says so, buried below manu
paragraphs. How bizarre.


Take a look at the syntax specification here:

Visual Basic Language Specification -- 10.8.1 'If...Then...Else' Statements
<URL:http://msdn.microsoft.com/library/en-us/vbls7/html/vblrfvbspec8_9_1.asp>

I'm glad the IDE inserts the 'Then' keyword automatically.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Nov 30 '05 #11
"Cor Ligthert [MVP]" <no************@planet.nl> wrote in message
news:uL**************@TK2MSFTNGP12.phx.gbl...
Mike,
If Not Page.IsPostBack

End If

This is one of my wishes, together with making that senseless 'Dim'
optional

:-)

Cor


Sound like you want C# >then< <g>

--
Ken Halter - MS-MVP-VB (visiting from VB6 world) - http://www.vbsight.com
Please keep all discussions in the groups..
Nov 30 '05 #12
Ken --

"Ken Halter" <Ken_Halter@Use_Sparingly_Hotmail.com> schrieb:
If Not Page.IsPostBack

End If

This is one of my wishes, together with making that senseless 'Dim'
optional

:-)


Sound like you want C# >then< <g>


.... or VFP ;-).

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>
Nov 30 '05 #13
Ken,
Sound like you want C# >then< <g>
No I want a tool that is better than C# and can be a tool for the future.

The Visual Basic language has in my idea a prominence position to become
that.

A pity is that some classic VB diehards want to keep all kind of things that
has no sense and therefore makes that it looks like an outdated tool.

:-)

Cor

"Ken Halter" <Ken_Halter@Use_Sparingly_Hotmail.com> schreef in bericht
news:On**************@tk2msftngp13.phx.gbl... "Cor Ligthert [MVP]" <no************@planet.nl> wrote in message
news:uL**************@TK2MSFTNGP12.phx.gbl...
Mike,
If Not Page.IsPostBack

End If

This is one of my wishes, together with making that senseless 'Dim'
optional

:-)

Cor


Sound like you want C# >then< <g>

--
Ken Halter - MS-MVP-VB (visiting from VB6 world) - http://www.vbsight.com
Please keep all discussions in the groups..

Nov 30 '05 #14
"Cor Ligthert [MVP]" <no************@planet.nl> schrieb:
Sound like you want C# >then< <g>


No I want a tool that is better than C# and can be a tool for the future.

The Visual Basic language has in my idea a prominence position to become
that.

A pity is that some classic VB diehards want to keep all kind of things
that has no sense and therefore makes that it looks like an outdated tool.


'Dim' and 'Then' make perfectly sense, IMO, especially 'Dim'. I would not
want to miss them.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Nov 30 '05 #15
On Wed, 30 Nov 2005 18:52:10 +0100, "Cor Ligthert [MVP]" <no************@planet.nl> wrote:

¤ Ken,
¤
¤ > Sound like you want C# >then< <g>
¤
¤ No I want a tool that is better than C# and can be a tool for the future.
¤

You already have one...or you wouldn't be using it. ;-)

¤ The Visual Basic language has in my idea a prominence position to become
¤ that.

Already there. Why reduce readability by removing keywords?

Are you certain you're not a C# developer? ;-)

¤
¤ A pity is that some classic VB diehards want to keep all kind of things that
¤ has no sense and therefore makes that it looks like an outdated tool.
¤

No, many of us just want to retain the keywords that differentiate Visual Basic from less verbose
(and less code readable) programming languages.
Paul
~~~~
Microsoft MVP (Visual Basic)
Nov 30 '05 #16

"Herfried K. Wagner [MVP]"
Sound like you want C# >then< <g>
No I want a tool that is better than C# and can be a tool for the future.

The Visual Basic language has in my idea a prominence position to become
that.

A pity is that some classic VB diehards want to keep all kind of things
that has no sense and therefore makes that it looks like an outdated
tool.

'Dim' and 'Then' make perfectly sense, IMO, especially 'Dim'. I would
not want to miss them.

Yes I know the same as that the C# guys want to see that a delclaration
always ends with (); do you want to see that it always begins with DIM
inside a method.

\\\
Public sub b()
Dim c as string 'here is for you (not for the compiler) the Dim absolut
needed.
d as string 'for me this is obvious a declaration of a string
End sub
///

Strange is that you don't want this one to keep in consequent in the
language.
\\\
Public sub b()
for dim i as integer = 0 to etc.
End sub
///
It is now very inconsequent, although I would hate it to see as it is above.

Cor
Nov 30 '05 #17
Paul,
No, many of us just want to retain the keywords that differentiate Visual
Basic from less verbose
(and less code readable) programming languages.


See as well my samples in the message to Herfried, for me the "Dim" (not
even the "then" about that we can discuss), makes in my opinion the language
more unreadable for new users. It has absolute not the meaning more what it
had in the "BASIC" time, and therefore will look the same for newbies in the
language as

\\\
Public sub
Kzp MyVariable as String
end sub .
///
This makes it for me not more readable.

I am absolute not talking about the keywords declaring the scope, however
beside the "Static" are those not needed inside a method.

Cor

Nov 30 '05 #18
"Cor Ligthert [MVP]" <no************@planet.nl> schrieb:
No, many of us just want to retain the keywords that differentiate Visual
Basic from less verbose
(and less code readable) programming languages.


See as well my samples in the message to Herfried, for me the "Dim" (not
even the "then" about that we can discuss), makes in my opinion the
language more unreadable for new users. It has absolute not the meaning
more what it had in the "BASIC" time, and therefore will look the same for
newbies in the language as

\\\
Public sub
Kzp MyVariable as String
end sub .
///
This makes it for me not more readable.


As you already know for sure, 'Dim' is simply an abbreviation of
"dimension". 'ReDim' stands for "redimension". Both keywords make perfect
sense and they are more than just some useless characters. Visual Basic
..NET doesn't have special blocks to put declarations of local variables in.
Thus it's important to be able to identify variable declarations easily. I
usually do not put all declarations of local variables at the beginning of a
method's body. Instead, I spread them throughout a method in front of the
line where the variable is being used for the first time. The blue 'Dim'
keyword is very important for me to identify variable declarations.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Nov 30 '05 #19
Cor,
BASIC

Beginner's All-purpose Symbolic Instruction Code,

symbolic stands in this context as far as i know for a way to define the
abstract

in my opinion C like syntaxes are abstract by themselves ,,, what you want
is to evolve the language to a more abstract language
or am i going to deep here :-)

Michel ,

"Paul Clement" <Us***********************@swspectrum.com> wrote in message
news:5t********************************@4ax.com...
On Wed, 30 Nov 2005 18:52:10 +0100, "Cor Ligthert [MVP]"
<no************@planet.nl> wrote:

¤ Ken,
¤
¤ > Sound like you want C# >then< <g>
¤
¤ No I want a tool that is better than C# and can be a tool for the
future.
¤

You already have one...or you wouldn't be using it. ;-)

¤ The Visual Basic language has in my idea a prominence position to become
¤ that.

Already there. Why reduce readability by removing keywords?

Are you certain you're not a C# developer? ;-)

¤
¤ A pity is that some classic VB diehards want to keep all kind of things
that
¤ has no sense and therefore makes that it looks like an outdated tool.
¤

No, many of us just want to retain the keywords that differentiate Visual
Basic from less verbose
(and less code readable) programming languages.
Paul
~~~~
Microsoft MVP (Visual Basic)

Nov 30 '05 #20
Michel,

in my opinion C like syntaxes are abstract by themselves ,,, what you want
is to evolve the language to a more abstract language

or am i going to deep here :-)

Absolute, I would like those things that can be used optional to be
optional. It is that the users choise to use it as they want. Use those
things that were strong in Cobol combined with what is strong in Visual
Basic and don't hesitate to take those things that are strong in C languages
as we have seen that is done.

I assume that you know Cobol and that is absolute not an abstract language,
but the full-grown versions did let you free in the use of not needed words.
Visual Basic has with the DIM and the THEN still aspects in my opinion from
those first Cobol versions. The needed by demand just because some people
had the idea that they were the ones who should tell what was the best.

Now I have the idea that it is the same with Visual Basic, some persons
don't want to make things optinal just because they tell that they cannot
read a program without that there is the DIM in it as it was in the first
versions of Basic.

Did I make my ideas clear?

Cor
Nov 30 '05 #21
Herfried,
As you already know for sure, 'Dim' is simply an abbreviation of
"dimension". 'ReDim' stands for "redimension". Both keywords make
perfect sense and they are more than just some useless characters. Visual
Basic .NET doesn't have special blocks to put declarations of local
variables in. Thus it's important to be able to identify variable
declarations easily. I usually do not put all declarations of local
variables at the beginning of a method's body. Instead, I spread them
throughout a method in front of the line where the variable is being used
for the first time. The blue 'Dim' keyword is very important for me to
identify variable declarations.


REDIM is for redimensioning an array. It is in my idea even confusing for
somebody new that he can not do that with a single variable while he has
declared that as DIM.

Dim a as string
Redim a as integer ' is not possible.

However in your explanation it should be possible.

Here you give an aspect that I never have thought about, but why it even
should be more optional. Just to keep it that old BASIC users can go on
using it and it becomes for new users more readable.

Cor
Nov 30 '05 #22
"Cor Ligthert [MVP]" <no************@planet.nl> schrieb:
Sound like you want C# >then< <g>


No I want a tool that is better than C# and can be a tool for the future.


Where would you stop with removing or altering keywords?

<URL:http://www.bitwisemag.com/copy/bytegeist/bytegeist7.html>
-> "It seems to me that the language changes got out of hand."

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>
Nov 30 '05 #23
Herfried,
No I want a tool that is better than C# and can be a tool for the future.


Where would you stop with removing or altering keywords?

Who has written in this thread about removing or alterin keywords?

Making something optional does not mean removing or altering, it gives the
writer more freedom to describe the problem in the program in a way that
fits him the most.

If understand from you that as you go to a restaurant than you say

"I want DIM jambon as entree, than I want DIM WeenerSnitzel as meat and than
DIM Spinach as vegetables. I think that I take DIM Ice as dessert."

I want to say those things without that Dim, so let me.

:-)

Cor

Dec 1 '05 #24
Herfried,
I would rather Dim be replaced with Local or Declare. I would also like to
see Dim prohibited from being used for fields.

However I agree, having "Dim" (or local or declare) identify a local
variable declaration statement is useful visually.

Just like "If" is used to identify an if statement, "For" a for statement,
"While" or "Do" a loop statement.

The "problem" I have with dropping Dim totally as Cor suggests, is there is
no keyword that would identify a local variable declaration as opposed to an
assignment statement or invocation statement. With Assignment & Invocation
I'm "doing something" with my objects, its a runtime thing. While local
variable declaration is defining something, its a compile thing...
Maybe I need to start a campaign to get Let reinstated as a required
keyword, to identify assignment statements. Also have Call be required! ;-)
--
Hope this helps
Jay [MVP - Outlook]
..NET Application Architect, Enthusiast, & Evangelist
T.S. Bradley - http://www.tsbradley.net
"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:uU**************@TK2MSFTNGP11.phx.gbl...
| "Cor Ligthert [MVP]" <no************@planet.nl> schrieb:
| >> No, many of us just want to retain the keywords that differentiate
Visual
| >> Basic from less verbose
| >> (and less code readable) programming languages.
| >
| > See as well my samples in the message to Herfried, for me the "Dim" (not
| > even the "then" about that we can discuss), makes in my opinion the
| > language more unreadable for new users. It has absolute not the meaning
| > more what it had in the "BASIC" time, and therefore will look the same
for
| > newbies in the language as
| >
| > \\\
| > Public sub
| > Kzp MyVariable as String
| > end sub .
| > ///
| > This makes it for me not more readable.
|
| As you already know for sure, 'Dim' is simply an abbreviation of
| "dimension". 'ReDim' stands for "redimension". Both keywords make
perfect
| sense and they are more than just some useless characters. Visual Basic
| .NET doesn't have special blocks to put declarations of local variables
in.
| Thus it's important to be able to identify variable declarations easily.
I
| usually do not put all declarations of local variables at the beginning of
a
| method's body. Instead, I spread them throughout a method in front of the
| line where the variable is being used for the first time. The blue 'Dim'
| keyword is very important for me to identify variable declarations.
|
| --
| M S Herfried K. Wagner
| M V P <URL:http://dotnet.mvps.org/>
| V B <URL:http://classicvb.org/petition/>
|
Dec 1 '05 #25
Jay,
The "problem" I have with dropping Dim totally as Cor suggests, is there
is
no keyword that would identify a local variable declaration as opposed to
an
assignment statement or invocation statement.


Where the hell did I ever suggest that?

Cor
Dec 1 '05 #26
Jay,

I have written more times that there are never 2 keywords needed to create a
declaration with only scoop in the method.

This is already proven in

for a as integer = etc.
This shows that 'as' is more than enough.

With the "as" which is unique in VB at this place, you declare every thing.
I have always told that I am against removing any scoop declaration in
advance of that if that is needed. The same is that I have written that I am
against removing any keyword just for backward compatible reasons.

Dim is historical meant to dimension an undefined variable. It is changed
and now it is syntactical culprit.

However, you are free for me to use it, the only thing I ask is to make it
optional. What is against that, will that prove that it is not needed?

The same discussion there has been about the "Then" and now it is proven
that it is inserted automatically, just because the archaic bunch want that.
For me it could been out of the sentence as well and let it use optional.
However the old VB classic bunch is strong.

Just my opinion.

Cor
Dec 1 '05 #27
"Cor Ligthert [MVP]" <no************@planet.nl> schrieb:
The same discussion there has been about the "Then" and now it is proven
that it is inserted automatically, just because the archaic bunch want
that. For me it could been out of the sentence as well and let it use
optional. However the old VB classic bunch is strong.


Cor, it's you who is requesting a change which I assume the majority of
VB.NET users doesn't want. It's too easy to call them "VB Classic diehards"
or similar.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Dec 1 '05 #28
Herfried,
Cor, it's you who is requesting a change which I assume the majority of
VB.NET users doesn't want. It's too easy to call them "VB Classic
diehards" or similar.

The reason of that is that I get never any sample why it is needed or the
samples are at the area where it is for 99% not used in VB.Net. I only see
text as. "It makes it for *me* much more readable".

Count how many times you have Dim in your programs, and count than as well
how many times you are able to replace that by a program that see if there
is an AS and there is not a declaration as Private or whatever before the
statement.

At least for *me* the DIM statement makes a Visual Basic program less
readable, I can not translate that word with a sensefull meaning.

And therefore, why is there a group that makes strong oposition against
making that word "optional".

Tell me what is against making it optional and than not from your point of
view but from somebody whos is seeing the first time Visual Basic. How do
you than explain that DIM is needed.

Cor
Dec 1 '05 #29
Cor,
| Where the hell did I ever suggest that?
Do you honestly don't know where in *this* thread you suggested dropping Dim
from "Dim d as string"? In a response to Herfried on 11/30?

--
Hope this helps
Jay [MVP - Outlook]
..NET Application Architect, Enthusiast, & Evangelist
T.S. Bradley - http://www.tsbradley.net
"Cor Ligthert [MVP]" <no************@planet.nl> wrote in message
news:uo**************@TK2MSFTNGP12.phx.gbl...
| Jay,
|
| > The "problem" I have with dropping Dim totally as Cor suggests, is there
| > is
| > no keyword that would identify a local variable declaration as opposed
to
| > an
| > assignment statement or invocation statement.
|
| Where the hell did I ever suggest that?
|
| Cor
|
|
Dec 1 '05 #30

"Jay B. Harlow [MVP - Outlook]" <Ja************@tsbradley.net> schreef in
bericht news:OT**************@TK2MSFTNGP10.phx.gbl...
Cor,
| Where the hell did I ever suggest that?
Do you honestly don't know where in *this* thread you suggested dropping
Dim
from "Dim d as string"? In a response to Herfried on 11/30?

No not in the context as you have written it.

I am always telling never to drop any keyword in VBNet.

I am always talking about making not more strict needed and sometimes even
misleading keywords optional.

If you can show me where I have written that sentence (in its full context)
as you suggest than I will be pleased.

Cor
Dec 1 '05 #31
(shakes head).

Really not worth my time Cor!

I will let the public judge my and your statements as they stand.

--
Hope this helps
Jay [MVP - Outlook]
..NET Application Architect, Enthusiast, & Evangelist
T.S. Bradley - http://www.tsbradley.net
"Cor Ligthert [MVP]" <no************@planet.nl> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
|
| "Jay B. Harlow [MVP - Outlook]" <Ja************@tsbradley.net> schreef in
| bericht news:OT**************@TK2MSFTNGP10.phx.gbl...
| > Cor,
| > | Where the hell did I ever suggest that?
| > Do you honestly don't know where in *this* thread you suggested dropping
| > Dim
| > from "Dim d as string"? In a response to Herfried on 11/30?
| >
| No not in the context as you have written it.
|
| I am always telling never to drop any keyword in VBNet.
|
| I am always talking about making not more strict needed and sometimes even
| misleading keywords optional.
|
| If you can show me where I have written that sentence (in its full
context)
| as you suggest than I will be pleased.
|
| Cor
|
|
Dec 1 '05 #32
Try boo: http://boo.codehaus.org/

Dec 1 '05 #33
Cor Ligthert [MVP] wrote:
"I want DIM jambon as entree, than I want DIM WeenerSnitzel as meat and than
DIM Spinach as vegetables. I think that I take DIM Ice as dessert."


I can see clearly that Cor prefers:

entree jambom; meat WeenerSnitzel; vegetables Spinach; dessert Ice.

:-))
Seriously, introducing special cases in a language may be worse than
simply dropping a keyword. Instead of Visual Basic, suddenly we have
Visual PL/I, which (as it seems) had so many special cases that looked
foreign even to experts.

As for the technical impediment to make Dim optional, I really can't
see one. I guess, requiring just one more token of lookahead from the
compiler can't be that hard.

Function AirCode(Path As String) As List(Of Integer)
Result As New List(Of Integer)
Reader As New StreamReader(Path)
Line As String = Reader.ReadLine
Do While Line IsNot Nothing
Value As Integer = Integer.Parse(Line)
Line = Reader.ReadLine
Loop
Return Result
End Function

But, hey, since Dim may be optional, why not allow "|" instead of As,
and , say, '~' (tilde) instead of New, ";" instead of End, "(:" instead
of "(Of", "?" instead of Function and wow, this one is really cool,
"!=" instead of IsNot?... I really don't see any technical reasons not
to... :-))

How nice:

? AirCode(Path|String) | List(:Integer)
Result | ~ List(:Integer)
Reader | ~ StreamReader(Path)
Line | String = Reader.ReadLine
Do While Line != Nothing
Value | Integer = Integer.Parse(Line)
Line = Reader.ReadLine
Loop
Return Result
; ?

Voilá, Visual.Not.Basic

Regards,

Branco.

Dec 2 '05 #34
Branco,
I can see clearly that Cor prefers: entree jambom; meat WeenerSnitzel; vegetables Spinach; dessert Ice.
Absolutly not, you did not read my messages and probably did not even think
about it.

jambon as entree says for me more than Dim jambon as entree.

What you wrote as "entree jambon" makes statements as this impossible.

jambon as New Entree

I find that much better than in C, therefore I prefer that current Visual
Basic style very much

There seems to be a kind of strange childness behaviour from some Visual
Basic devellopers that removing the Dim means directly that it has to be in
a kind of C style. That is absolutely what I don't want.
Seriously, introducing special cases in a language may be worse than
simply dropping a keyword. Instead of Visual Basic, suddenly we have
Visual PL/I, which (as it seems) had so many special cases that looked
foreign even to experts.
This "dropping" is something Jay Harlow has introduced in this
message-thread not me and that I agree with you. There is endless times in
this message-thread that I am against dropping of any keyword.
As for the technical impediment to make Dim optional, I really can't
see one. I guess, requiring just one more token of lookahead from the
compiler can't be that hard. Function AirCode(Path As String) As List(Of Integer)
Result As New List(Of Integer)
Reader As New StreamReader(Path)
Line As String = Reader.ReadLine
Do While Line IsNot Nothing
Value As Integer = Integer.Parse(Line)
Line = Reader.ReadLine
Loop
Return Result
End Function


What is against it, at least for me it reads much easier and consequent. In
fact you show with this that you agree with me.
But, hey, since Dim may be optional, why not allow "|" instead of As,
and , say, '~' (tilde) instead of New, ";" instead of End, "(:" instead
of "(Of", "?" instead of Function and wow, this one is really cool,
"!=" instead of IsNot?... I really don't see any technical reasons not
to... :-))


Why will you do that, than you introduce new keywords that are not needed,
Visual Basic has enough keywords so why create more. In my opinion is the
way as keywords are in Visual Basic better to read. This with the
exception of that strange DIM statement. (Dimension as undefined what is in
some other languages VAR). However for those who want to keep them, I have
no problem with that, I ask only to make it optimal, so that I am not forced
to use them.

However, in my opinion is your last part just a political part as this
message thread is full with (not by all), to get an opposition. Not able to
give serious comments against what I wrote and than just telling something
that does not exist and I never told to make a kind of fool of me to be able
to attack me.

Cor
Dec 2 '05 #35

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: lakshmi | last post by:
include the following lines of code: using System.Runtime.InteropServices; prefix the optional argument with This takes care if an optional parameter is not supplied by a VB script client....
13
by: William Ryan | last post by:
I just picked up a copy of John Robbins' debugging book and started to look at disassembled code. Anyway, I hate optional Parameters in VB, but I was checking them out to see what IL is created. ...
16
by: ad | last post by:
Does C#2.0 support optional parameters like VB.NET: Function MyFunction(Optional ByVal isCenter As Boolean = False)
1
by: Do | last post by:
Hi: What's the syntax for an optional parameter in my function? I've done so many ASP 3.0 Web Classes that I haven't experienced the "Optional" parameter. Eg. Public function adduser(ByVal...
1
by: Doug Zody | last post by:
How to make function argument as optional in Vb.Net? I have a function signature as shown below. I am using .Net Framework 1.1. Public Shared Function Foo(ByVal strCustNo As String, ByRef...
2
by: et | last post by:
I have the following function that uses an optional parameter, and it sets a default, as the program says I have to. Yet it doesn't pick up the default value. Why is this, what am I doing wrong....
3
by: guy | last post by:
found this oddity- copying a vb6 function with optional parameters and pasting it into a vb2003 class, for conversion purposes, it all works fine except that the collapsing "-" on the LHS goes...
14
by: cody | last post by:
I got a similar idea a couple of months ago, but now this one will require no change to the clr, is relatively easy to implement and would be a great addition to C# 3.0 :) so here we go.. To...
12
by: pamelafluente | last post by:
Hi guys, In the past I have used several time optional parameters in my function. But Now I am more inclined to think that they are more dangerous than useful, and probably better to be...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.