June 2004 - Posts

Beta time is here again

Visual Studio .NET 2005 Beta 1 is now available on MSDN subscriber downloads. 

And now there is also express eidtions of VB.NET , C# and SQL. These express editions are lightwieght versions, the SQL Express being the replacement for MSDE.  See Brian's blog for comments on SLQ express, and Duncan's blog for some more general info on the express editions.  Or if you can't wait and want to find out for yourself, downlaod these express editions now from here.  Note: When you download and install the VB.NET express edition, setup will let you choose to download SQL Express.

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

Eloquence of language

Great to see another Aussie VB guy answer the call! Greg Low, all round nice guy even if he is from Queensland , has moved his blog onto the msmvps.com blog site. So now you can read Greg’s entries from both the Aussie bloggers feed and the MS MVPs feed.

In Greg’s latest post, he raises some good points about the positioning of VB and also talks about the benefits of choosing VB.  I fully concur!!

The bit I liked the most was when he talked about struct instead of Structure. Brevity is no excuse for decrease of readability. Taking C# for instance, block structures are enclosed with { and }, whereas VB.NET is explicit in saying Sub .. End Sub, Function .. End Function, If .. End If etc.  The C# style is very much like those who declare variables as a,b,c,d etc rather than having to type a descriptive, informative name. And we all know that is a bad practice, it’s a lazy practice.

To me, VB.NET is more evolved. It has higher forms of language. It uses *words*.  C# on the other hand has some pre Neanderthal form of language that basically consists of various grunts. { and } are grunts and only by the bone waving of the surrounding code do they relay the actual meaning of the grunt.

As for C# being used in universities, well that’s kind of understandable. Students generally are evolving. Computer Science students learn primitive grunts of 0’s and 1’s, progress to low level assembly and early evolution C style languages. For them, C# is the logical choice as they are still learning, and like any homo sapiens they have to learn to crawl before the learn to walk or run. It’s probably not until they leave university//college that they will get the knowledge and wisdom that only the real world and maturity bring. (there are of course always exceptions ).  But as they do evolve, many of them will indeed see that in the real world VB is incredibly strong and wide spread even though it is not taught in CS.

So perhaps they should be asking why is it that fortune 500 companies choose VB over C style languages, that VB is so strong yet is not part of the Computer Science curriculum. Maybe they really need to be asking whether their curriculum is still relevant, or is it becoming out dated. Are C# languages really only used because of outdated Computer Science courses, and are those students who use C style languages exhibiting signs of inability to evolve?  Probably the real two big questions they need to ask is why are the numbers of students taking up Computer Science dropping, instead of increasing. Given the evolution of computers in society, one would expect that to be high growth, so there seems to be some serious signs of Computer Science itself failing to evolve ;)

The number one question is of course, why does C# require the break statement in a switch block? Is that some kind of antediluvian tar pit construct ?

Evolution in terms of computers and computer languages is about bringing computers closer to human language and human needs and uses, not some re-hash1 of early grunts.

1. Ironically, # is pronounced “hash”, which is quite fitting when you think of it as C# really is just a rehash of C style languages ;)

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

A patch in time saves nine

A few weeks ago I bitched about how I believed the move by MS to monthly updates was leaving customers vulnerable. There was a “day zero” exploit and MS till this date has done nothing to inform customers about the potential problem and still not fix. That’s almost three weeks since information was publicly available on the internet on how to download and run any application you like to a users computer (iow: WIDE OPEN).

Microsoft’s logic on this seems to have been that maybe it wasn’t wide spread. That is, instead of pro-active, they decided to wait and be reactive. Well guess what has happened?

There is news of a recent IIS exploit that is downloading code to user’s machines and executing it. Sound’s familiar right? The hypothesis I’ve read to date on it indicate it might be taking advantage of known exploits on un-patched severs, and then exploiting more known vulnerabilities on the clients, vulnerabilities for which a patch is not available. Susan Bradley has posted some good tips for client machines, but really for the more tech savy part of society, not for the moms and pops and children who trust Microsoft to keep them informed and patched.

It’s not that monthly security rollups are wrong or bad, it’s the leaving it for so long without a patch, without advising their customers which I believe is negligent. MS has know about this potentially damaging exploit for the best part of three weeks now, and yet they have neither supplied a patch or notified their customers. Bad, bad, bad, BAD !!

UPDATE:  Tech Republic seems to confirm my worse fears

The tactic is not new. Earlier this month, an independent security researcher found an aggressive advertising program, known as adware, that installed itself onto a victim's computer via the same two flaws in Internet Explorer.

This time, however, the flaws affect every user of Internet Explorer, because Microsoft has not yet released a patch. Moreover, the infectious Web sites are not just those of minor companies inhabiting the backwaters of the Web, but major companies, including some banks

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

Be a part of the Community

Yag just emailed me, telling me I’m famous   J Frank also blogged and emailed me, adding me to the Aussie bloggers opml feed. It’s nice to be surrounded by so many nice people  J

Community is good … I love it. It’s that “together” we can do it type of thing. It’s that sharing, it’s the achieving. And it’s also about caring. I think that’s one thing I love about the VB community is it has all those essential ingredients.
Reminds me in ways of my local community, where a couple of weeks ago I was invited to dinner by the local CFA, where I was presented with a twelve year service award. You are probably wondering how that is relevant to VB, right?  Well just a couple of years ago our CFA volunteer numbers were dwindling, but thanks to a local membership drive asking people to get involved our numbers are now strong again. And we have all, even ol’ timers like myself, had to undergo training. The good news is due to that hard work we are now more ready than ever to tackle the arduous tasks that may lay ahead, as well as share the good times too .

So what can you do to help your community? If you are an Aussie, get blogging, get involved, check out some of the cool things the local MS people are helping to organize.

If you are a VB’er, time to do the training, and join in the community. Get blogging, get involved.

Oh, and don’t forget to subscribe to the VB rss feed, and check out the VB community page. Hopefully someone at MSDN will wire those two together soon so we can have a VB channel  J

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

A hacked Boolean

reposted to fix the missing StructLayout and FieldOffset attributes

In VB.NET, And and Or are bitwise operations. They do accept Boolean operands, but the operation is still bitwise. To see this, I will show you a hacked Boolean.
The following structure allows us to manipulate the value stored inside a Boolean (hence the *hack* :)

<StructLayout(LayoutKind.Explicit)>_
Public Structure HackedBoolean
   <FieldOffset(0)>Public value As Int32
   <FieldOffset(0)>Public bool As Boolean

   Public Function GetBool(ByVal seed As Int32) As Boolean
      Me.value = seed
      Return Me.bool
   End Function
End Structure

You can then test this in code such as :

Dim operand1 As Boolean = HackedBoolean.GetBool(1)
Dim operand2 As Boolean = HackedBoolean.GetBool(2)

So at this point we have operand1 as a Boolean containing the value 1 and operand2 as a Boolean containing the value 2. Since in both cases, the value is non zero, by definition of a Boolean being bi-state only, the value of the Boolean is non zero thus non False. Some folk might say for the value 2 the Boolean is indeterminate, and it can behave that way with a bad compiler, or an immature compiler.

As a side note, in Vb.NET 2002 there were some issues when you compared a Boolean to the value True if it’s internal value was not 1, so operand2 would have not been false and not been True. In Vb.NET 2003 however, the compiler detects tests for equal to True and just checks if the value is non zero on the stack, which is more efficient and less error prone than doing a comparison with a value such as 1 (this is what it did in 2002).

So testing code in VB.NET 2003, you will get some interesting results:

Dim result As Boolean

result = operand1  ' result is True
result = operand2  ' result is True

result = operand1 = True  ' result is True
result = operand2 = True  ' result is True

result = operand1 = operand 2 ' result is False !!!


Now let’s look at the And operator :

result = operand1 And operand2

Guess what result is from the above code. If you guessed False, you’d be right. The reason is, the And operator does a bitwise and, which is bitwise and of 2 And 1, which is 0.

Now let’s try AndAlso:

result = operand1 AndAlso operand2

This time the result is True. This is because AndAlso is a branching construct based on the operands value on the stack not being zero.

Posted by bill
Filed under:

Find and Replace in VS.NET

Fiona Fung has a couple of tutorials on using Find and Replace in Visual Studio. Part 1 is here, and part 2 here.

My biggest gripe though is why the h*** do they use their “own regular expression engine”.  Why not make that consistent with the language the tool is meant to be helping you work with? Why force developers to know two different regular expression syntaxes, oen for .NET and yet a different one for VS.NET ?

I’m sorry, but that just seems stupid to me.

It would be far better if they at least had an option so as you could use .NET regular expressions in Find and Replace.

Oh yeh, and while I’m at it, it’s also about time they made those search and replace textboxes multiline.

So please *update* search and replace!  If you feel it is necessary to keep it similar to the 98 version, fine make that some retro option somewhere, but stop holding it back.

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

.Net For shareware

Nick Bradbury blogged recently saying “.NET runtime is suicide for most downloadable shareware apps”. That might be true *today*, but will that be true next month ?

 

When XP SP2 rolls off the presses, rumour has it that CD’s will be wide spread. Let’s hope that is true, and that on those CD’s will be the .NET runtime. Microsoft has been slow to distribute the runtime to date, and part of that reason may have been because of legal rulings instigated by Sun to stop MS distributing the .NET runtime and/or Java runtime. But once those CD’s are as wide spread as those AOL and MSN cd’s, the runtime distribution won’t be a real issue. I agree it’s a shame it has taken so long, but at last it looks like we are getting there.

 

That’s the negatives, but what about the positives ?

 

.NET and click once style of deployment means that customers can trust applications downloaded from the web not to mess with their system. Sure Microsoft made a mistake in making .NET exe’s “exe”, but that was a legacy API thing ;)  Still, by using the Web, .NET  downloads should be distinguishable from other software, and users can safely let an exe run on their machine.

For administrators it means they can lock down machines and still give users freedom to download and run shareware apps.

 

.NET really is a good step forward for shareware, and a giant leap forward for users. Finally they can safely download and run software, rather than hope the author doesn’t mess with their system or screw up shared dlls etc, etc.

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

Have you had your Window’s fix?

So MS tries to do the nice thing and give it’s software away. But then folks liken MS to a drug pusher for doing so and it gets nasty. L

 

Funny thing is, do drug pushers give away free samples? I would have thought with their short term memory problem etc, that would be a recipe for financial disaster as they wouldn’t remember who they gave the freebies to. Maybe people should put that to the test. Approach a drug dealer when you see one and ask for a free sample ;)

 

Of course the stupidity of the synonym is only exceeded by the stupidity of MS’s lawyers. Seriously suing someone for likening MS to a drug dealer is likely to bounce back on them *big time*. Going to be a lot of egg on some lawyer faces when the case gets dismissed, and then people say “see MS really is like a drug dealer”.

 

Then again, this free software initiative really is going about things the wrong way. Unfortunately it’s because of the way the software is designed, MS has no other choice if they are trying to stem the migration away from Windows. It’s a real pity, because as it stands Windows isn’t free, instead they have these occasional “tastes” of free windows.

 

I think the coolest way to go about this would be to componentalize MS software including Office and Windows. (of course componentalize isn’t a word *yet*).

What that would mean is there would be a basic version of windows that was free, or at least free to education and non profit organizations. A cut down version of XP home. If you wanted the windows network features that currently requires students to buy XP Pro, instead of having to buy a complete OS, you could purchase a *component* to enable that. Some of these features might be baked in, and just require licensing switches to turn them on, and others might be downloadable as extensions.

 

And the good news is that everyone wins. Customers get freedom of choice, and real low cost alternatives. Microsoft stems the flow away from Windows, and doesn’t get bad PR or likened to being a “pusher” for doing so. And *developers*, *developers* *developers* can all prosper too as many of the locked down integrated windows features against which you can’t compete, would become “extra components”, moving that ever so slightly more into the world of free enterprise. Realistically for MS though that competition would be minor and MS should have no legal problems in having package deals for their components.

 

$0.02

 

Posted by bill
Filed under:

Making Xbox relevant..

I was reading Robert Scoble’s blog today (yeh I admit it ), and there was a quick post about Xbox II that got me thinking …..

Xbox II is meant to be on the market next year, whereas PlayStation III won’t be on the market till the year after. So, in the stores come XMas 2005, there will be Sony’s PSII compared to MS’s unit which although supposedly technically superior, will cost probably 3 or 4 times more than the heavily discounted PSII.  As far as games goes, there is and probably still will be more games for the PSII, depending on how much money MS continues to throw at game development.

So for the *purchaser* there isn’t any obvious reason to buy the MS product, instead it sounds much like MS’s entry into the gaming market : an exercise of throwing a *lot* of money at something and still having less than the competition. I think in this, MS is targeting the wrong market sector and are trying to battle Sony on Sony’s grounds. Sony has the edge in hardware manufacturing as MS is not really a manufacturer, and Sony has the edge in game development because they have a larger market sector. It’s hard to convince independent game developers to target a smaller market sector.

I think what MS should be doing is establishing market niches and leveraging those.

First, rule number one is look at your target market, right? And if you said it was teenage kids wanting to play games, you would be wrong. They aren’t the one’s paying for the machine, for the games, for the cable, for the high definition wide screen TV’s etc, it’s their moms and pops that are. That is, focus a bit more on the decision makers, make Xbox relevant to them.

So how do we make Xbox relevant to *non-gamers* ???

Easy !!  XBox is NOT just a gaming machine, it is a connected entertainment system, that is capable of high quality virtual reality. So the quest is to look at what else it can do *other* than just gaming….

As an example, how many moms and pops spend time at the gym or on exercise machines battling that midlife spread ? ;)  So why not integrate Xbox into that ??

Imagine you hop on a cycling machine and there on the big screen you are cycling along beautiful mountain tracks, along coastal roads with stunning views. And on screen you can be watching you heart beat, calories burnt, speed etc. You could also be, via Xbox live, watching your stock quotes customized to your portfolio, and/or a news ticker (also customized to your profile). And maybe even have email alerts. Potentially you could even be buying and selling shares… always a good thing to have that on screen heart monitor while trading ;)

Pretty simple thing to do really. MS writes the software, then does deals with the exercise equipment manufacturers. The manufacturers just have to provide an input jack on their existing computer equipment. A translation unit maybe needed in some machines, but most likely a lot of it can be done by software translators that ship with the “game”.  That’s how MS gets buy in for their “software”.

Suddenly MS has a marketing niche.  When parents walk into stores that sell exercise bikes, running machines etc, there would be that cross marketing of “Xbox compatible”

And it would also be lots of fun.  Imagine you and a couple of your buds are at the gym. You could hop on the exercise bikes and “play” in competition mode, racing each other in the Olympics or the tour de France.

This leads us to market niche two, the same market niche that makes MS have a chance in pocket PCs and smart phones. That’s integration. Being able to take your “profiles” with you, or access them over the web, integrate your stocks, your news preferences, keep track of what calories you have burnt this week, *enabling* you to set goals and enjoy it. And most importantly being able to take that with you from place to place. Integration, similar to how Xbox has memory modules, but some thing more cross platform, be it sdio cards or usb pens etc. 

Who knows, in years to come doctors and dentists might all have them in their waiting rooms, and when you choose your doctor or dentist or gym, you might be asking are they “Xbox compatible” ?

One thing is for sure, MS needs to broaden the market if it wants to increase market share. It needs to market all the other things Xbox can do other than just play games. They have to get the decision makers, the moms and pops to view Xbox as more than just a game system. They have to give them reason to spend more on the Xbox compared to the PS II.

To re-cap, if Xbox is to really cut into market share, I think MS needs to:
(i) create niches and leverage them
(ii) hire more lateral thinkers (oh and send me lots of money)
(iii) think outside the box !

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

Continue statement in VB.NET 2005

Mike McIntyre shows some examples of using the Continue statement in VB.NET 2005. Another cool feature of the Continue statement is it allows for the Continue to be on an outer loop. For example, if you were iterating over items in a 2 dimensional jagged array, you can use code like this:

  Dim values()() As Int32
  Dim i As Int32 = -1

  While i < values.Length
     i += 1
     For j As Int32 = 0 To values(i).Length - 1
        If values(i)(j) = 2 Then Continue While
        ' Some lengthy operation
     Next j
     ' more lengthy operations
  End While

Note that the continue statement in the above code is Continue While, not Continue For. The caveat is, you have to have different loop types.  Thankfully VB.NET has three loop constructs, Do, While and For, so you can mix and match these pretty easily.  And intellisense is pretty cool here as it lists the loops you can use Continue on based on your actual code.  In the above example when you type “Continue ” intellisense lists For and While.

Personally, I would like the VB team to add to that for the sake of For loop. That is I *wish* I could do this:

   For iAs Int32 = 0 To values.Length - 1
      For j As Int32 = 0 To values(i).Length - 1
         If values(i)(j) = 2 Then Continue For i
         'Some lengthy operation
      Next j
      'more lengthy operations
   Next i

The difference being I could specify “Continue For i” or “Continue For j”.

Still, Continue is a good and overdue addition to VB. Great to have it at last !!

 

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

None of the above.

Don’t ask a question if the question precludes the correct answer !!

Unfortunately too often folk just want to hear what they want to hear, so they limit the question to a choice of the answers they have already chosen. Unfortunately Andy Pennell and Scott Nonnenberg have now fallen victim to this mind set too. They aren’t the only ones, it’s a pretty common and easy mistake to make.  The quest for efficiency drives us in ways to try to limit the feedback process, to simplify, to categorize, and in doing so, we often limit the answers to questions. :-(

Let’s look at Andy & Scott’s question. In essence it was “Where do you expect debugger windows to be on the menu?”. Sounds simple enough right? So, why not limit the answers to a set of options, in this case menus, and limit that to a choice of one of two menus?  Well, simply because that isn’t really looking at the bigger picture, the real underlying question….

First, understand the target audience: Developers working with VS.NET, really are a special group as far as end user groups go. These are the people who just love to tweak things, to modify things. I think just about every developer there is has a certain intrinsic artistic flare, a creativeness. They are all very much unique in subtle ways. For developers, the complex task of right clicking on a toolbar, selecting customize, and dragging a menu item from one menu to another hardly seems like a huge issue.

So the issue is not really where those menu items are, because that is easy to customize. And with VS.NET 2005 you can persist your customization to file and easily take that with you too to other computers. What the real issue is, is which is more discoverable!

And that’s where we get the two different options come into play. One is about an option that is more discoverable for users of VS.NET 2002 and 2003, and the other is about discoverability for new users or users who wish to take VS.NET 2005 as all being new regardless of their previous experiences. That is, it’s now a game of politics, a vote, weighing one set of people’s preferences against another’s. That’s always a dangerous game, and rarely has stable results.

As I hinted to earlier, this phenomena is not limited to Andy and Scott. If anything, they are just the latest causalities in this process as Whidbey takes shape. There’s already plenty of folk upset over the changes to their keyboard settings for example. And to put it frankly, the early proto-types the VB.NET team has come up with for their customer’s settings are so far targeted at the “new” users, that for existing users of VS.NET, you really need to NOT select the VB settings profile.

In *all* these cases the *real* question is “how do we make this more discoverable?”

That’s the question all these people need to be asking. Not categorizing, and definitely not weighing one group of people’s preferences up against another group’s. Logic tells us that for every winner, there is a loser, and when the customer is a loser, that is a disgruntled customer!!

So are they asking the right question, or do they need to step back from the answers they want to hear, and ask a different question? I think they do.  But then again, I already have an answer for that question ;-)

Posted by bill
Filed under: , ,
More Posts Next page »