'Then' is Optional?!?

C

Cor Ligthert [MVP]

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
 
C

Cor Ligthert [MVP]

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
 
C

Cor Ligthert [MVP]

Herfried,
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
 
J

Jay B. Harlow [MVP - Outlook]

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


| >> 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/>
|
 
C

Cor Ligthert [MVP]

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
 
C

Cor Ligthert [MVP]

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
 
H

Herfried K. Wagner [MVP]

Cor Ligthert said:
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.
 
C

Cor Ligthert [MVP]

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
 
J

Jay B. Harlow [MVP - Outlook]

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


| 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
|
|
 
C

Cor Ligthert [MVP]

Jay B. Harlow said:
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
 
J

Jay B. Harlow [MVP - Outlook]

(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


|
| "Jay B. Harlow [MVP - Outlook]" <[email protected]> schreef in
| bericht | > 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
|
|
 
B

Branco Medeiros

Cor said:
"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.
 
C

Cor Ligthert [MVP]

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.

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top