[dba-VB] Recent Discussion from MS on VB.Net and C# in VS 2010

Shamil Salakhetdinov shamil at smsconsulting.spb.ru
Tue Mar 16 12:52:40 CDT 2010


Nope, Max, good modern C# code's methods/properties/... have just a few code
lines, with a few leading spaces for indentation...

One can also use #region statement to hide parts of large classes (if
any)...

IOW, no need at all to "scroll 2 miles" up and down or left to right - and
I'd also note that modern programmers do use Class Diagrams/Class View when
coding - no need to scroll source code lines at all...

Thank you.

--Shamil {^;^}

-----Original Message-----
From: dba-vb-bounces at databaseadvisors.com
[mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Max Wanadoo
Sent: Tuesday, March 16, 2010 8:35 PM
To: 'Discussion concerning Visual Basic and related programming issues.'
Subject: Re: [dba-VB] Recent Discussion from MS on VB.Net and C# in VS 2010


...and let us not forget that to read this code you have not only to scroll
up and down repeatedly to see the construct of what is supposed to be going
on, you have to scroll 2 miles to the right to find when the incredibly
indented code ends.

Max

 

-----Original Message-----
From: dba-vb-bounces at databaseadvisors.com
[mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Drew Wutka
Sent: Tuesday, March 16, 2010 5:24 PM
To: Discussion concerning Visual Basic and related programming issues.
Subject: Re: [dba-VB] Recent Discussion from MS on VB.Net and C# in VS 2010

" curly brackets do enhance code readability, make it unambiguous, clear,
relevant, accurate and as brief as possible"

The only 'accurate' part of that statement, Shamil, is BRIEF.

Unabmiguous.... Nope, If I write Function TestProcess(), I better see an End
Function.  Not End If, End Loop, End Sub, I know I am looking for End
Function to be on the last line of the function.  With a {....him, now I'm
looking for a }, hey there's one...oh wait, I hit a { first...wait, another
{, and another, okay, and here's a }, and oops, another {, crap, is that 3
or 4 {'s, darn, need to go back up.  Or, I could trust the programmers
'perfect ' indentation to verify that the brackets are good...... So is
indentation and faith really less ambiguous then finding the first 'End
Function'?

Clear ...  Hmmmmm, that pretty much is the opposite of ambiguous, thus it's
the same as unambiguous.  But I'll smack some more logic on this term for
you...after scrolling through a page of code, exactly how does } give me a
clear indication of what just happened?  End If tells me I just hit the end
of a logical statement.  End Function tells me I just hit the end of a
procedure...... What did } tell me that I just ended?

Relevent ...  Hmmm, spilled into this one with Clear..... what again did }
just end?  How is it relevant at the bottom of a page I've scrolled down to
get too?  

Accurate ...  Really?  Odd, if I miss an End if, the compiler will tell me,
'Missing End If', does a C compiler tell you you're missing a }?  I know
when I'm writing SQL with a slew of parenthesis, getting told that a ) is
missing is like finding a needle in a haystack sometimes.  But getting told,
hey, you're missing an End if....MUCH easier to find, because the language
is providing a MORE accurate relevance, which is clearer, and less ambiguous
to a human eye/brain, then symbols with tribal meaning.

Man, I could do this all day!  And to think I rarely post on this list!

;)

Drew

-----Original Message-----
From: dba-vb-bounces at databaseadvisors.com
[mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Shamil
Salakhetdinov
Sent: Tuesday, March 16, 2010 7:02 AM
To: 'Discussion concerning Visual Basic and related programming issues.'
Subject: Re: [dba-VB] Recent Discussion from MS on VB.Net and C# in VS 2010

OK, Max :)

Not trying to convince you (:)) just noting that curly brackets do enhance
code readability, make it unambiguous, clear, relevant, accurate and as
brief as possible - all using just two generic (helping hands) symbols - '{'
and '}' . And in most of the cases curly brackets are inalienable
(indefeasible, integral, essential) part of the code - remove them and code
blocks will become ambiguous...

Programming languages do come from mathematics, and therefore (IMO just
IMO)
using special symbols to keep a programming language syntax as concise and
as unambiguous as possible is a good and productive idea...

And in VB(A)(.NET) one have to use the whole set of (natural language)
substitutes:

- Namespace ... End Namespace
- Module ... End Module
- Class ... End Class
- Sub ... End Sub
- Function ... End Function
- For ... Next
- While ... End While
- If .... Then ... End If
- ...


Thank you.

--
Shamil  {^;^}




More information about the dba-VB mailing list