.NET Answers

ASP.NET, HTML, CSS, Visual Studio, CSharp, VB.NET and other programming items of interest.
Subscribe

Readable Code

December 04, 2007 By: Dave Category: none

Time out today for just a bit of a rant.

A couple of days ago, I posted a top ten list for why you shouldn’t buy Visual Studio 2008.  Most people totally got that this was all tongue in cheek.  But, I was amazed how many comments I got on YouTube where people took it WAY too seriously.  Sigh.. people… just goes to show how shaky this writing medium is.  Ah well…

What makes most of the items I suggested in that list funny is that there really are people who believe at least one of the reasons I listed.  Including the last one about using notepad and the command line.  I had a student in a Java class I was teaching several years ago who told me that the lead programmer where he worked was still using VI (’nix version of notepad) for all of his development.  He was also STILL setting the CLASSPATH variable.  This when there were free tools available that had intellisense, color syntax highliting, and the CLASSPATH environment variable had died several years prior.

Along these lines, I actually found a blog post by an ex C++ programmer indicating that he believed anonymous types would make the code unreadable.  So, let’s look at that in some detail this morning.

(more…)

If you're new here, you may want to subscribe to my RSS feed. Thanks for visiting!

Anonymous Types

December 03, 2007 By: Dave Category: none

Well, Connecticut had a small ice storm last night, and I’m one of the lucky ones who still has power.  So, let’s get to work looking at anonymous types in .NET.


(more…)

The Ternary Operator in VB.NET

November 29, 2007 By: Dave Category: none

I think this may be the last operator that I really miss in VB from my curly brace language experience.  Although, I have to admit, I wouldn’t have missed it all that much if they never added it.  There just isn’t a whole lot of use for it.

However, the Ternary operator is a REALLY nice feature to have available to you when you do need it.  It’s another one of those language features that falls under, “Just because it is there doesn’t mean you have to use it.”

If you’ve ever run into a situation where you just need a simple evaluation and assign a variable based on it.  Like this: (more…)

Object Initialization in CSharp 3.0 and VB.NET 9

November 28, 2007 By: Dave Category: none

Yesterday we looked at the new var keyword in CSharp.  This makes CSharp variable declaration similar to VB.  After all, they’ve had the DIM keyword for years which essentially does the same thing.

Today, we’re going to look at object initializers, which have been added to both CSharp and VB.

(more…)

Intellisense Everywhere in VB 9 (and a small bug)

November 23, 2007 By: Dave Category: none

One of the features the CSharp guys have had for quite a while is Intellisense everywhere.  Want to create a private variable?  Just start typing private and hit the tab key as soon as the word is highlighted.  This, combined with code snippets have made coding in CSharp a bit faster than coding in VB.

What about the VB guys?

Sorry.  All the VB guys got was the ability to see methods an properties hanging off of their objects.  They have had to type out  the whole word for things like public, private, dim and class. 

Until now.  Watch the following video to see the new Intellisense for VB 2008 in action.

Technorati Tags: ,,

  

del.icio.us Tags: ,,