February 2008 - Posts

Something more succinct than Function ?

I really dislike VB's inline Function syntax... it's incredibly verbose.  When they were looking at it, I suggested Func, but given that usage in the framework that would be confusing. (I hadn't seen the Func(Of T,...) delegates at that time )  I would still like something more succinct. I'm wondering if we couldn't have something like if you type f( and press tab or hit space, that get's changed (similar to a snippet) to ƒ(

That is, why not use ALT+0131 if we can make it easy for users to add via IDE auto-modification.  So instead of :

Dim cust = customers.Where(Function(c) c.FirstName = "Smith")._
                     Select(Function(c) c.FirstName & " " & c.LastName)

you'd have :

 

Dim cust = customers.Where(ƒ(c) c.FirstName = "Smith")._
                     Select(ƒ(c) c.FirstName & " " & c.LastName)

Posted by bill | 4 comment(s)
Filed under: , ,

More on videos from Lang.NET symposium

If you want to download the videos to watch later, or to happily play them faster, skip ahead etc, then you can grab the .wmv files instead of having to watch them in a browser in silverlight.  I like to increase the play speed in parts and silverlight doesn't allow that ;)  To get the .wmv's, go to the Agenda page and right click on a shortcut to a video and select Copy Shortcut.  The shortcut will be to a html page. What you need to do is remove the .html and replace it with .wmv, and add the Videos subdirectory to the talks path, e.g:


http://langnetsymposium.com/talks/1-01%20-%20CSharp3%20-%20Anders%20Hejlsberg.html

becomes

http://langnetsymposium.com/talks/Videos/1-01%20-%20CSharp3%20-%20Anders%20Hejlsberg.wmv

 

And now onto reviews/thoughts:

 

C# 3.0 by Anders Hejlsberg.

The first hour of this presentation is on c# 3.0 and how they got there.  If you don't get LINQ or how all the language features in C# 3.0 revolve around that watch it, otherwise skip to just before the 1 hour mark where the talk starts to look forward.

Some things to note: Anders states emphatically that VB and C# "will stay roughly in sync" which is something they "are explicitly committing to" as they have both large users bases that have the same innate desire for the same feature set.  So hopefully that puts an end to the artificial segregation I hear people try to conjure up ;)  BTW: was that an Aussie asking that question (Wayne Kelly?) ??? Typical ;)

It was also good to hear they are still trying to figure out a good way of doing INumeric and still looking at making nullable types more intrinsic.

On Expressions trees it seems we will see some improvements going forward. Most notably, expression trees will allow annotations that should make the debugging better.  No-one asked about Edit and Continue with expression trees, which was a shame.  Closures do cause issues there, but apart from that I don't see why we couldn't have E&C, especially if the tree can be easily related back to the source via annotations :)

Expression trees are also likely to support "statements" in the future.  This adds even more pressure for VB to provide support for multi statement lambdas.

 

On a side note, I raised an eyebrow when I heard Anders say "bloody" in his presentation. He did the same in the last video I watched of him.  Maybe it's a cultural/upbringing thing, but there's certainly nothing nice about bloody unless it is a steak.  If he wants to swear he should say fucking, as we all enjoy that ;)  Of course that wasn't as bad as the unfortunate name one of the questioners had for their language <g>

One funny thing to note was Anders continually referred to namespace importing as "Importing".  Yes that's the Imports keyword in VB, whereas it's the Using directive in C#. Just funny to note how we sometimes use terms from other programming languages, such as I generally use the term static instead of Shared.  Hopefully language designers consider the natural phrases. For example, going forward, is "Extends" really the right word for mix-ins given there's already Extension methods and more significantly it is the general term we often use for inheritance, and as in the case in Java.

Posted by bill | 6 comment(s)
Filed under: , , , , ,

videos from Lang.Net symposium

Thanks to Paul Vick for pointing out the Lang.Net symposium talks are now on the web.  I've only watched a few so far, but here's my thoughts/review of them

 

Paul's talk on VB.Next

A quick overview of one area VB will probably be heading is making the language more scriptable.  This isn't anything revolutionary as we all recall VBScript, and we all also know that died for a number of reasons mainly lack of support in other browsers and lack of a public standard that wasn't proprietary Microsoft control. Today as far as scripting goes, JScript rules the nest.  But for client side applications there is still a void from what VBA and the Scripting control use to provide. Admittedly it's not that hard to roll your own with reflection, but not as easy as it use to be. The kind of scripting we are talking here is more like running code in the immediate window of VS which you can do today, and probably extends through to possibilities like recording macros, something Office still lacks for VB.NET (although Visual Studio does have VB.NET macro recording today)

How important this will be to the VB community I think is questionable.  Indirectly it will be important as there should be some good spin-offs, especially inside Microsoft.  One advantage that shouldn't be under estimated is that the VB team will be writing the compiler and editor helper bits in VB.NET.  This kind of level of dog fooding will for the first time probably drive them to really consider power features inside the language a lot more ;)

Concerns will be how much this takes time away form other things the language and users really need. And the scariest thought is this will be yet another attempt at dumbing down VB, with the typical patronising "Mort" persona rubbish, where the VB team no longer asks real users what they want, instead they ask silly questions like "assume you're Mort ....".  I really hope we|they have matured beyond that by now.

 

Modelling and Languages

Jay and Silent Bob Don Box and Chris Anderson give what was probably an entertaining presentation. I love Don Box's presentation style, always fun/entertaining.  But if you are looking for content, to actually watch an informative presentation then skip this one.  They really don't talk about what Microsoft is doing, more they talk about what has already been done, e.g XAML.  You should get the message that Microsoft thinks modelling is important and folks there are looking at making that happen, and hopefully doing so in a way that congregates other tracts they have worked on.

Sadly this presentation doesn't really present anything concrete, only a foofy world of maybe.  It's disappointing to me as I view modelling as incredibly important and the interaction with languages is crucial. Don and Chris have been working on it for some time so it was sad to see their presentation was nothing more than a rehash of one they did twelve months ago.

 

remotion Mixins

A good bit of European humour opens this session. Not really in depth, but does provide a good overview of how remotion is using Mixins today.  Their implementation is a runtime object factory that looks for attributes and does the mixin magic accordingly.  I think I'd prefer a more AOP compile time injection, and perhaps more design time feedback on possible issues.  As the guys "hint" at, it would be great to see language support for mixins.

In the VB world, Amanda Silver, reportedly mentioned "Extends" at TechEd EMEA 2007, but to date the VB team hasn't made those slides generally available or opened up any discussion as to what mixins would mean.  Hopefully that will change soon, if we are to take them seriously over the claim to "democratise" VB ;)

 

Volta

Erik Meijer provides an interesting and honest presentation of Volta. So far this has been the best session I've watched.  It had a good level of technical content combined with the view of the overall goals.

Of course, I don't agree with some of the way Volta is targeted/implemented at present, but I'll apply the Moore's law factor for now ;) I would like to see Erik and the Volta team starting to look more at the modelling side of things rather than just attributes in code, maybe even start adding some substance to Don & Chris's work <g>.

Lots of good take away points, especially the parts about making things easy to adopt yet giving the developer the ability to make explicit choices.  Someone should make that one a poster and put it up around certain team's offices... "if you're going to do magic, give them the choice"

Posted by bill | with no comments
Filed under: , , , ,

Microsoft thinks VB programmers are so "special" ...

I was flicking through some MSDN help pages, when I noticed this topic on Component Authoring:

Capture

 

Isn't it nice how "special" Microsoft views VB folks.  Obviously anyone using C# doesn't have this issue, it's just the people using VB.  Not patronising at all <geez>

Oh well, at least they didn't say you VB folks need to use the other door. 

Posted by bill | with no comments
Filed under: , , , ,

Sunflowers

 

For fun I thought I'd plant some sunflowers this year. I have to confess this is the first time I think I have ever grown them in my life... shameful almost ;)   Hopefully they might bear some seeds for me to nibble on.  This one I took a snap of t'is afternoon makes a great desktop background

Posted by bill | 2 comment(s)
Filed under:

Power Pack 3.0 released !!

Just noticed the VB Power Pack 3.0 has been released with the much anticipated Data Repeater component......

Haven't had a chance to test it yet, but fingers crossed it looks promising.  The download is here, the pretty splash page about it is here.

Posted by bill | 1 comment(s)
Filed under: , ,

And the beer was ....

 

 MVP Beer

 

 

 

Posted by bill | 2 comment(s)
Filed under: ,

Arrays in VB.NET

You probably know that declaring an array in VB, such as :

      Dim names(9) As String

creates an array with 10 elements.  As of VB8 you can use the 0 To syntax for the same thing:

      Dim names(0 To 9) As String

 

I prefer the 0 To syntax as it clearer for those from other languages as well as clearer for me ;)

 

But did you know you can also do this :

      Dim names(-1) As String

 

      Dim names(0 To -1) As String

this creates a zero length array.

This comes in handy if you are resizing an array, and there is the possibility of the count being zero, e.g

 

      Dim names(0 To count - 1) As String

 

 

:)

Posted by bill | with no comments
Filed under: , , ,

Fixing explorer in Vista

One of the most annoying things I have found about Vista is the file explorer. It constantly changes the views of folders and way too often sets the columns in a folder as if the folder contains photos when it doesn't.  To me that is really disappointing and undermines any confidence I could have in Microsoft producing a stable safe OS... the fundamental tasks an OS must do is work with hardware and manage files. If they can't surface that with a stable UI then something seriously is wrong there.  I had hoped SP1 would fix the issue, alas it did not. But thanks to some MVPs I saw a link to a site that suggested a registry tweak to fix the problem.. and it did :)

The fix is to add this registry key:

 

Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\Software\Classes\Local Settings\Software\Microsoft\Windows\Shell\Bags\AllFolders\Shell]
"FolderType"="NotSpecified"

Posted by bill | 4 comment(s)
Filed under: , ,

Blood plums

The blood plums are in season now.  Apart from lovely eating fresh, last night I found they cook really well with ripe Nashi fruit, balances the flavours superbly. The Nashi sweeten them much like pear juice is used in conserves.  This is really handy, because Pears usually don't ripen till late in the season, where-as you can grow fresh Nashi and Plums that will be ripe at the same time :)

 

My favourite blood plums (pictured above) .  I'm not exactly sure which variety they are but think they are Mariposa : large fruit approx 60 to 65 mm (2 1/2 inch) diameter, stone semi cling (actually comes out with just a minor tuff of flesh, so more free stone than cling, IMO ;))

The trees this year had way too much fruit on them, so they have suffered some damage from broken limbs, and they have dropped a lot of fruit on the ground too. The other day I saw the ducks having a feed of them, especially flattened ones; they'll shake them about, and the young ducks will try to get a feed from the ones the parents pick.. looks almost like they are tearing apart raw meats steaks <g>

Posted by bill | with no comments
Filed under:

PlatformVB has moved.

PlatformVB pages are now at http://billmccarthy.com/Projects/Archived/PlatformVB/

I got an email from Herfried Wagner yesterday asking about my PlatformVB site.  For those who don't know it, it's an old VB6 set of pages I use to have that had a couple of bits of useful code and a lot of code about RAS (dialup networking).  Folks still use it as a reference when working with VB6 and RAS, and my old old ISP, iprimus kept the pages alive for years and years and years after I left them.  Well finally iprimus decided to clean up their storage, and the pages have gone.  The pages can now be found in my projects section of billmccarthy.com

Posted by bill | with no comments
Filed under:

VB6 support till 2018 ?

As you probably know Windows Server 2008 has been released.  I set up a virtual machine for the 64 bit Win 2008 with VMWare (Virtual PC doesn't support 64 bit) and was happily surprised to see I could just drag a VB6 application into the VM and it ran :)

So the good news is the Vb6 runtime ships as part of Windows 2008 and hence gets 5 year main stream support followed by 5 years extended support !!  That's up to 2018 !!

Now given this extended support, why is it MS doesn't update the VB6 editor and also provide a 64 bit runtime ?

Posted by bill | 1 comment(s)
Filed under: ,
More Posts Next page »