VB 10 thoughts (part 4)

Posted Tue, Oct 9 2007 14:01 by bill

still teasing out thoughts from the cobwebs

  1. Date literals
    today in VB you can only specify date literals in the format of #MM/dd/yyyy#
    That's incredibly USA centric. I'd like to input date literals in the form of dd/MM/yyyy, but because that would cause an ambiguity, I'd really like to see dd MMM yyyy, or failing that the ISO 8601 standard format of yyyy-MM-dd and yyyy-MM-ddThh:mm:ss
  2. select case object
    I've been asking for this one for so long I forgot about it till I read the comments on Paul's blog.
    Ideally in the format of :

       Select Case sender Is
            Case TextBox1
                 ....
            Case TextBox2
                 ....

    similarly

  3.    Select Case TypeOf(sender) Is
            Case TextBox
                 ....
            Case Label
                 ....



  4. Catches in Using blocks
    Again this is one that I had forgotten about.

    Using aDisopable As  .....

    Catch Ex As Exception

    End Using
     
  5. Calling partial methods
    VB 9 gives us partial methods, but the partial method itself has to be empty. It would be nice if there was a default method generated which you could still use, similar to the capabilities or Overrides but without the inheritance need.  I thought the use OverWrite could be used, e.g:
     
  6.    'generated code
       Overwriteable Sub Foo()
          Dosomething()
       End Sub
       'user code
       Overwrite Sub Foo()
          DosomethingElse()
    Overwriten()'calls the generated overwriteable method End Sub

     
     
Filed under: , ,

Comments

# re: VB 10 thoughts (part 4)

Tuesday, October 09, 2007 6:13 AM by Matteo Bagattini

16 and 17 have my vote, 16 would be extremely useful.

tK

# re: VB 10 thoughts (part 4)

Tuesday, October 09, 2007 3:00 PM by Morgan

#15 There is only one logical one, ISO 8601 which is what everyone use in my country :) (Maybe an Option DateFormat ISO8601? )

# re: VB 10 thoughts (part 4)

Tuesday, October 09, 2007 3:04 PM by Ernesto

How about a StreamReader.ResetToPrevousLine method in the StreamReader class.  This would allow us to  stop the read operation and insert new data prior to the line just read then we could reset the buffer and continue to read where we left off at.

Example:

n_Line = StreamReader.Readline

If n_Line = "Line to stop at" Then

  temp_File = writer.WriteLine("Appended Text")

  StreamReader.ResetToPreviousLine

End If

temp_File = StreamReader.ReadLine

' The output to the temp_File would be:

Appended Text

Line to stop at

# re: VB 10 thoughts (part 4)

Tuesday, October 09, 2007 3:06 PM by Morgan

Here's what I would like to see.

There is one thing I can't get over in VB and that is that AND & OR doesn't short circuit.

I use ANDALSO/ORELSE _EVERY_ single time, Could I have an Option ShortCircuit ON?

There is 2 things I would like to get rid of in VB, the line continuing character _ is plain annoying. It will be so even more with LINQ. And can someone tell me why its considered a compilation error if I end the line with ,_ Why cant the IDE insert the space char?

I would also like to see the the Dim keyword being optional or removed, Let was ditched in VB7.