jwcolby
jwcolby at colbyconsulting.com
Mon Mar 15 17:25:47 CDT 2010
>Why do I need to put ; at the end of a line?
Because now you don't need the _ nonsense to continue code to the next line.
From the beginning of the line to the first ; is all a line of code. C# really is nice in that
regard. White space is white space whether it is a space, tab or CRLF.
>It just makes no sense to me to have strtemp and strTemp represent two different values.
I don't particularly like case sensitivity, I would PREFER case insensitivity, but now with modern
coding editors it is dead easy to find and fix such things. I still don't LIKE it though. In fact
C# coders tend to use a convention where the variable has UC all words and the function has a LC
first character (or VV).
And you can declare class fields public and do away with the get/set if you wish. I don't recommend
that, whether in VB or C#.
It is a fact that VB was designed to be easier to read, but again "easier" is relative to what? Try
reading a medical article. Holy crap. But it is perfectly easy to a doctor. Trying to read VB if
you come from C# is NOT easy, trying to read C# if you come from VB is NOT easy. Both syntax
require learning. Writing code in VB is actually a tad harder once you are good at both, and that
from a person that comes from VB. Typing Begin instead of { is more keystrokes. It just is, and it
takes longer and allows this "keyboard dyslexic" lots of opportunities to mis-spell. OTOH nowadays
the editor tends to do the "auto-finish" thing anyway.
I think it is instructive to notice that the VB crowd says VB is easier and the C crowd says C# is
easier. I think at the core, both are pretty much equally hard / easy and whichever you do first
and / or longest is which is "easiest".
I tend to believe that, over the long haul, the "extra" time it takes to become familiar with C#
over VB is lost in the noise of the time to learn the .net framework. IOW the total time to learn
either syntax is under 5% of the time to learn "dot net". Learning VB syntax might be 4.5% as
opposed to 5% for C#. In either case learning all of the classes and other stuff of .Net is going
to be 95% (or more!).
John W. Colby
www.ColbyConsulting.com
Drew Wutka wrote:
> 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
>
>