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

Drew Wutka DWUTKA at Marlow.com
Tue Mar 16 11:51:19 CDT 2010


You don't have to type the whole word!  Ctrl-Space, will autofill
anything VB will recognize....  

<soapbox>
Ya know, if I went up to the person on the street, and said, spell
'hoop', and they wrote 'Hoop', I wouldn't go, NO, 'hoop'.

The entire argument about case sensitivity really boils down to a
generation gap, between old case sensitive languages, and newer
non-sensitive ones.  It's that simple.  The true reason for case
sensitivity is a moot point.  It's no longer necessary.  What has kept
it alive, is the 'conformity' to it, not the necessity for it.  You
statement that it's part of a naming convention is counter-intuitive
when it comes to programming.  A naming convention is designed so that
code is INHERENTLY more readable from one programmer to another.  It
should NOT be a requirement to understand a naming convention to be able
to read the code in the first place!

The original reasons for case sensitive were space and time.  There were
limited spaces in a line, and for a compiler to figure out the
difference in ascii between A and a took more compiling time.  Neither
of these is an issue today, nor have they been for quite some time (in
fact, for as long as I've been programming!).  So when you were pressed
for space in an 80 character line, allowing x and X to represent two
different variables made life easier for the programmer.  And saving a
few cycles while compiling also saved time, precious time, because when
you were limited in line space, you also didn't have Ghz processors, let
alone Mhz or even Khz.

The irony, is that programming is logic at its best.  The spoken/written
languages of humanity defies logic in many ways.  'She's Phat!'
(pronounced 'fat') would sound like an insult to the uninitiated, but
for people that pay attention to trends, they would understand that Phat
means Pretty hot and tempting.  I before E, except after C, with x
number of exceptions.  Throw Papa down the stairs his shoes. (An example
of Pennsylvanian dutch).  Yet a world of 1's and 0's is logical heaven!
There was logic in the origins of case sensitivity, now we are stuck
with a habit, instead of logic.  In fact, case sensitivity flies in the
face of logic, on the simple fact that a programming language's primary
intent is to provide a bridge between machine language and human
language.

If I were to tell you 'Bob and I went to the store, and then bob and I
went to a restaurant, and that Restaurant is Denny's.' Logic would say
that I went to Denny's and a store with a guy named Bob.  However, with
the 'naming convention' that is being applied to today's C descendant, I
could be saying that I went to the store with one guy, then went to a
restaurant with another guy, and that a restaurant that I might be
pointing too is named Denny's.  With modern programming languages, we
have the ability to write code like this:

Dim int7DaysFromNow As Date = Date()+7
If SomeOtherDate>int7DaysFromNow Then RunAFunctionWithADescritpiveName

Yet constrictions of the past want to muck up the wave of the future
with long learned habits, instead of newer, and better logic.
</soapbox>

I am a Network Administrator, I am a Network Administrator, I am a
Network Administrator

Ah..... SNMP protocols and Active Directory... back to the world of
logic I go!

Drew


-----Original Message-----
From: dba-vb-bounces at databaseadvisors.com
[mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Michael
Maddison
Sent: Monday, March 15, 2010 5:40 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

Hi Guys,

Drew, your code...
class SomeClass
{ 
    private int someField; 
 
    public int SomeField 
    { 
        get { return SomeField; }  
    }
}

Can be written as...
class SomeClass
{ 
    public int SomeField { Get; }
}

Hard to get more concise then that lol.

I've been coding in various VB languages since VB3 and am now (after a
few years) very comfortable with C#.
I actually find doing maintenance in VB6 a real problem now. It's so
slow to write code in the IDE.
Typing the whole word, how odd...lol.
As others have said, Foo and foo is very easy to distinguish in C#. Foo
is a class, foo is a local instance of Foo.
When you get used to it it makes good sense and actually makes your code
more not less readable IMO.
You just need to use a naming convention, preferably MS's.
http://msdn.microsoft.com/en-us/library/xzf533w0%28VS.71%29.aspx 

Cheers

Michael M



-----Original Message-----
From: dba-vb-bounces at databaseadvisors.com
[mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Drew Wutka
Sent: Tuesday, 16 March 2010 8:51 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

 I hate to chime in here, cause I haven't done any serious development
in about 2 years now.  I still use VB 6, simply because I have so many
tools that I have built for that, and I have so much code already
written that it's not worth the effort to dig into anything new since
I'm not doing it full time anyways.

However, JWC posted a link from a "coder's" blog where he made a comment
in one of his posts about having to deal with 'sloppy code' where he
clarified that with 'other peoples code'.  LOL.  So dead on the mark.
There are standards, none of which are universally applied.  So pretty
much every 'coder' out there thinks their code is the best written.  But
it makes sense, since code, in a way, is an artistic output, that we
create, therefore the creator understands it the best.

However, as a 'semi-retired' developer, back in the days, I dabbled in
C++, php, even a little Java.  And I always preferred VB 6, VBA and ASP.
One of my hang-ups with the C style languages is the case sensitive
parts.  I remember having an argument with my sister years ago (about 9
years ago) about this very topic.  It just makes no sense to me to have
strtemp and strTemp represent two different values.  No I googled, and
found out that C# is still case sensitive.  And one of the links had a
vivid discussion about this.  The C world pointed out that with case
sensitivity, you could create a class called Foo, and then have an
instance of the class called foo.  Sure, great, wouldn't want to work on
that code if my life depended on it.  But then again, it's a style
difference.  And as Max just posted, there is all the structure
nomenclature that, to me, just seems like just a hassle.  Why do I need
to put ; at the end of a line?  

Another issue I have had is that .Net requires much larger 'support'
files.  And when it first hit, there were versioning issues with them.
I don't think this is much of an issue today, especially with the size
of available media (hard drives, DVDs, etc) and the wide spread use of
broadband.  But I still like the simple 1.4 megs for VB6.... ;)

Dan, specifically to your post, however, I had to look up the word
laconic.  I find that kind of odd to be used with C code:

class SomeClass  
{ 
    private int someField; 
 
    public int SomeField 
    { 
        get { return SomeField; }  
    } 
}

Versus:

Option Explicit
Public SomeField as Integer

Can you really say that the C version is really more concise?

Drew


-----Original Message-----
From: dba-vb-bounces at databaseadvisors.com
[mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Shamil
Salakhetdinov
Sent: Monday, March 15, 2010 3:52 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

Hi Dan --

<<<
...because it's easier to read...
>>>
Well what of the following code lines is easier to read/understand/code
for
a (beginner) programmer?:

string line = "test";

or

dim line as string = "test"

IMO (just IMO) defining a string variable named 'line' with initial
value
equal to "test" is directly translated to C#'s code line:

string line = "test";

but not to a VB.NET one...

And there could be found many samples like that one above, more
complicated
samples, which will highlight "one-to-one" correspondence between C#
coding
and algorithmic specifications...

IMO (just IMO, I'm not trying to start a discussion here) C# is more
straightforward and laconic, and is expected to become "preferred"
programming language over time...

Thank you :)

--
Shamil

The information contained in this transmission is intended only for the
person or entity 
to which it is addressed and may contain II-VI Proprietary and/or II-VI
Business 
Sensitive material. If you are not the intended recipient, please
contact the sender 
immediately and destroy the material in its entirety, whether electronic
or hard copy. 
You are notified that any review, retransmission, copying, disclosure,
dissemination, 
or other use of, or taking of any action in reliance upon this
information by persons 
or entities other than the intended recipient is prohibited.


_______________________________________________
dba-VB mailing list
dba-VB at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/dba-vb
http://www.databaseadvisors.com


No virus found in this incoming message.
Checked by AVG - www.avg.com 
Version: 9.0.733 / Virus Database: 271.1.1/2735 - Release Date: 03/15/10
06:33:00

_______________________________________________
dba-VB mailing list
dba-VB at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/dba-vb
http://www.databaseadvisors.com

The information contained in this transmission is intended only for the person or entity 
to which it is addressed and may contain II-VI Proprietary and/or II-VI Business 
Sensitive material. If you are not the intended recipient, please contact the sender 
immediately and destroy the material in its entirety, whether electronic or hard copy. 
You are notified that any review, retransmission, copying, disclosure, dissemination, 
or other use of, or taking of any action in reliance upon this information by persons 
or entities other than the intended recipient is prohibited.





More information about the dba-VB mailing list