On this page.... RSS 2.0 | Atom 1.0 | CDF
# Tuesday, October 4, 2005

Looks like VB is growing up.  It finally has curly braces thanks to LINQ:

Dim People = {New Person {Age := 42, Name := "Erik"}, _
  New Person {Age := 12, Name := "Wouter" }}

It was only a matter of time until they admitted the power of the curly brace.  MUAHAHAHA! :)

To be more VB-like, I suggest:

Dim People = Begin Anonymous Type _
Begin New Type As Person(Age := 42, Name := "Erik") End New Type, _
Begin New Type As Person(Age := 12, Name := "Wouter") End New Type, _
End Anonymous Type As Anonymous Type

Tuesday, October 4, 2005 2:00:56 PM (Eastern Daylight Time, UTC-04:00)  #    Disclaimer  |  Comments [5]  | 
Tuesday, October 4, 2005 2:21:25 PM (Eastern Daylight Time, UTC-04:00)
Now they just need to learn to use square braces for collection indexers...
Tuesday, October 4, 2005 2:31:00 PM (Eastern Daylight Time, UTC-04:00)
Teemu pointed out that VB had a use for curly braces before. So it seems that have seen the power before and are now only coming to more fully realize it. :)
Tuesday, October 4, 2005 6:53:17 PM (Eastern Daylight Time, UTC-04:00)
And that methods (sorry, functions) should be forced to have a return statement!

(The rest I can handle ... that one kills me)
Wednesday, October 5, 2005 11:30:38 AM (Eastern Daylight Time, UTC-04:00)
With VS2005 there's option (project settings) where you can set that do you want it to complain if there's a method/operator without return value. But such setting (Project properties, Compile tab) is only for project types having "real" project file e.g all other but web projects. Or seems like more being MSBuild options.

But true, it doesn't still force it by default, despite what you do. And that's the bad thing.
Wednesday, October 5, 2005 8:27:58 PM (Eastern Daylight Time, UTC-04:00)
Begin Brace
' Now this is _real_ maturity!
End Brace
Comments are closed.

Disclaimer
The opinions expressed herein are solely my own personal opinions, founded or unfounded, rational or not, and you can quote me on that.

Thanks to the good folks at dasBlog!

Copyright © 2019 J. Ambrose Little