[Mono-list] methods without arguments do not need parentheses

Andreas Nahr ClassDevelopment@A-SoftTech.com
Sat, 28 Jun 2003 13:04:40 +0200


This is a multi-part message in MIME format.

------=_NextPart_000_0005_01C33D75.D601B550
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Hi,

first of all IMHO parentheses do DECREASE general code readibility in =
that case. Look at the following lines and judge for yourself:

DisplaySize =3D Me.GetMinimumSize ().ToPointF ().X.ToString ().Length

DisplaySize =3D Me.GetMinimumSize.ToPointF.X.ToString.Length

In 99.9% of all possibilities it doesn't matter if I'm calling an =
expression or statement (and you don't need and want to know). And don't =
forget that you don't use parenthesis for properties either (which are =
internally just method calls).
There is another major point. If we remove that about 95% or all VB.Net =
code that exists on the net will not compile with MBas (just check the =
user contriubutions at gotdotnet). That means mbas will not be a =
superset of VB.Net as is says but a subset.=20
You are correct that they generally don't hurt. They don't hurt if =
someone WANTS to use them, and they can (and should) use them, but if =
somebody doesn't want to, then there is no reason to FORCE him to do. =
Thats the main aspect of VB.Net and one of the main differences to C#: =
In VB.Net there is always more than one way to do something. And while =
this is the curse of VB it's also it's biggest advantage.
If you really like the compiler to check that then add a compiler option =
that you can turn on (and is off by default) and that checks for empty =
parenthesis.

Andreas Nahr


Original:
No, it's no good thing at all, IMO. Parentheses increase the readability
of code with no hurt at all, by simply distinguishing between an
expression and a statement.

------=_NextPart_000_0005_01C33D75.D601B550
Content-Type: text/html;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2800.1170" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial>Hi,</FONT></DIV>
<DIV><FONT face=3DArial></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial>first of all IMHO parentheses do DECREASE=20
general&nbsp;code readibility in that case. Look at the following lines =
and=20
judge for yourself:</FONT></DIV>
<DIV><FONT face=3DArial></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>DisplaySize =3D Me.GetMinimumSize =
().ToPointF=20
().X.ToString ().Length</FONT></DIV>
<DIV><FONT face=3DArial size=3D2><BR>DisplaySize&nbsp;=3D=20
Me.GetMinimumSize.ToPointF.X.ToString.Length</FONT></DIV>
<DIV><FONT face=3DArial></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial>In 99.9% of all possibilities it doesn't matter =
if I'm=20
calling an expression or statement (and you don't need and want to =
know). And=20
don't forget that you don't use parenthesis for properties either (which =
are=20
internally just method calls).</FONT></DIV>
<DIV><FONT face=3DArial>There&nbsp;is another major point. If we remove =
that about=20
95% or all VB.Net code that exists on the net will not compile with MBas =
(just=20
check the user contriubutions at gotdotnet). That means mbas will not be =
a=20
superset of VB.Net as is says but a subset. </FONT></DIV>
<DIV><FONT face=3DArial>You are correct that they generally&nbsp;don't =
hurt. They=20
don't hurt if someone WANTS to use them, and&nbsp;they can (and should) =
use=20
them, but if somebody doesn't want to, then there is no reason to FORCE =
him to=20
do. Thats the main aspect of VB.Net and one of the main differences to =
C#: In=20
VB.Net there is always more than one way to do something. And while this =
is the=20
curse of VB it's also it's biggest advantage.</FONT></DIV>
<DIV><FONT face=3DArial>If you really like the compiler to check that =
then add a=20
compiler option that you can turn on (and is off by default)&nbsp;and =
that=20
checks for empty parenthesis.</FONT></DIV>
<DIV><FONT face=3DArial></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial>Andreas Nahr</FONT></DIV>
<DIV><FONT face=3DArial></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial>Original:</FONT></DIV>
<DIV><FONT face=3DArial>No, it's no good thing at all, IMO. Parentheses =
increase=20
the readability<BR>of code with no hurt at all, by simply distinguishing =
between=20
an<BR>expression and a statement.<BR></DIV></FONT></BODY></HTML>

------=_NextPart_000_0005_01C33D75.D601B550--