[prev in list] [next in list] [prev in thread] [next in thread] 

List:       mono-list
Subject:    [Mono-list] methods without arguments do not need parentheses
From:       "Andreas Nahr" <ClassDevelopment () A-SoftTech ! com>
Date:       2003-06-28 11:04:40
[Download RAW message or body]

Hi,

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

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

DisplaySize = 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.  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.


[Attachment #3 (text/html)]

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2800.1170" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial>Hi,</FONT></DIV>
<DIV><FONT face=Arial></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial>first of all IMHO parentheses do DECREASE 
general&nbsp;code readibility in that case. Look at the following lines and 
judge for yourself:</FONT></DIV>
<DIV><FONT face=Arial></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>DisplaySize = Me.GetMinimumSize ().ToPointF 
().X.ToString ().Length</FONT></DIV>
<DIV><FONT face=Arial size=2><BR>DisplaySize&nbsp;= 
Me.GetMinimumSize.ToPointF.X.ToString.Length</FONT></DIV>
<DIV><FONT face=Arial></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial>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).</FONT></DIV>
<DIV><FONT face=Arial>There&nbsp;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. </FONT></DIV>
<DIV><FONT face=Arial>You are correct that they generally&nbsp;don't hurt. They 
don't hurt if someone WANTS to use them, and&nbsp;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.</FONT></DIV>
<DIV><FONT face=Arial>If you really like the compiler to check that then add a 
compiler option that you can turn on (and is off by default)&nbsp;and that 
checks for empty parenthesis.</FONT></DIV>
<DIV><FONT face=Arial></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial>Andreas Nahr</FONT></DIV>
<DIV><FONT face=Arial></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial>Original:</FONT></DIV>
<DIV><FONT face=Arial>No, it's no good thing at all, IMO. Parentheses increase 
the readability<BR>of code with no hurt at all, by simply distinguishing between 
an<BR>expression and a statement.<BR></DIV></FONT></BODY></HTML>

_______________________________________________
Mono-list maillist  -  Mono-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-list

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic