Office Programmability/New Language Features
-
Monday, October 27, 2008 6:47 PMModeratorHey guys,
My name's Jonathan and I'm a Program Manager on the Visual Basic compiler team. VB10 introduces a number of new language features such as Auto-implemented properties, statement lambdas, implicit line continuation (no more underscore!), and collection initializers.
C# 4.0 introduces a number of features that make it easier to work with COM, such as named/optional parameters, "omit ref" on COM calls, and dynamic dispatch on COM calls returning object.
Both languages are also introducing a feature called "NoPIA", which allows you to deploy applications that no longer depend on Primary Interop Assemblies (PIAs).
The "Office Programmability Walkthrough" available at PDC demonstrates all these features in a CTP build, and we'd love to hear your feedback on them!
For more information on the CTP itself, check out http://go.microsoft.com/fwlink/?LinkId=129231.
Thanks,
Jonathan
Program Manager - Visual Basic
All Replies
-
Thursday, October 30, 2008 4:59 PMNow all that's left is iterators. And I'll be able to talk to C# guys again.
-
Friday, October 31, 2008 8:29 AMFduch said:
Now all that's left is iterators. And I'll be able to talk to C# guys again.
C# has had iterators for some time now. Perhaps you're being too cryptic?
Keith J. Farmer [Idea Entity] -
Friday, October 31, 2008 1:55 PM
As a VB.Net developer I'm being bullied by C# coders for inability to utilize .Net features fully.
It's very frustrating for me that if I want to use iterators in some function I have to write entire class in C# instead of VB.Net.
I really wish they'll add iterators to VB.Net. It shouldn't be so hard. -
Saturday, November 01, 2008 3:42 AMFduch
I wrote VB.Net code for 3 years working in the health care sector up to the 2.0 framework. After moving to the financial sector I noticed that most people were programming in C#. Coming from a C++ background C# seemed more natural to me and is the langue I prefer to use today. However I have seem what you are talking about people "bullied" by other developers. This is nothing new I have seen this before with C++ programmers looking down at java programmers (etc). To me the argument between using C# vs VB.Net is really a silly argument. I think as a developer when ever you have a problem you should look at the technologies available and chose the one that best solve the problem whether that is VB.Net C# or IronPython that is the beauty of the .Net framework. Too many times people get stuck in a mind set that there is only one choice out there to use
Victor -
Tuesday, November 04, 2008 10:22 AM
Let's not lose the point of the original post (and hundreds like it, in dozens of forums):
Add iterators to VB.Net.
Or perhaps someone on the MSFT team could explain why they seem to be ignoring/refusing this repeated request from the community. -
Tuesday, November 04, 2008 7:41 PM
(I really don't want to derail Jonathan's thread, which is about office programmability. Just to say that all of us on the VB team are eager as anything to get iterators into the language. We are listening to the community to guide us on which features to prioritize. It's then a matter of finding time to design, implement and test. Paul Vick has posted our initial design plans for iterators at http://www.panopticoncentral.net/archive/2008/08/08/24155.aspx. That'd be a good place to leave feedback on iterators, and we are eager for feedback.)
Back on topic, here's the code I used at PDC to copy an XML literal into the clipboard, for pasting into Word:
Sub CopyToClipboard(ByVal htmlFragment As Xml.Linq.XElement, Optional ByVal title As String = "", Optional ByVal url As String = Nothing)
' Note: we assume the htmlFragment doesn't contain "<!DOCTYPE", nor "<!--StartFragment-->"
' nor "<!--EndFragment-->"
url = If(url, My.Computer.FileSystem.CurrentDirectory & "\")
' With thanks to Mike Stall, http://blogs.msdn.com/jmstall/pages/sample-code-html-clipboard.aspx
Dim t = "Format:HTML Format" & vbCrLf & _
"Version:1.0" & vbCrLf & _
"StartHTML:<<<<<<<1" & vbCrLf & _
"EndHTML:<<<<<<<2" & vbCrLf & _
"StartFragment:<<<<<<<3" & vbCrLf & _
"EndFragment:<<<<<<<4" & vbCrLf & _
"StartSelection:<<<<<<<3" & vbCrLf & _
"EndSelection:<<<<<<<3" & vbCrLf & _
"SourceUrl:" & url & vbCrLf & _
"<!DOCTYPE HTML PUBLIC ""-/W3C/DTD HTML 4.0 Transitional/EN"">" & vbCrLf & _
<html>
<head><title><%= title %></title></head>
<body><!--StartFragment--><%= htmlFragment %><!--EndFragment--></body>
</html>.ToString
t = t.Replace("<<<<<<<1", String.Format("{0,8}", t.IndexOf("<!DOCTYPE")))
t = t.Replace("<<<<<<<2", String.Format("{0,8}", t.Length))
t = t.Replace("<<<<<<<3", String.Format("{0,8}", t.IndexOf("<!--StartFragment-->") + 20))
t = t.Replace("<<<<<<<4", String.Format("{0,8}", t.IndexOf("<!--EndFragment-->")))
Windows.Forms.Clipboard.Clear()
Windows.Forms.Clipboard.SetText(t, Windows.Forms.TextDataFormat.Html)
End Sub
--
Lucian Wischik, VB Spec Lead.

