1. Technology
Send to a Friend via Email

Visual Basic Blog

By

Follow me on:

Goodbye ...

Friday August 24, 2012

Wishing Bug-free Code to Everyone!

It's with quite a bit of regret that I must tell you that I won't be the About Visual Basic site guide starting next month. This will be my last blog. It's been real and it's been fun!

I originally decided to become the About Visual Basic guide after I retired from a career writing code and managing other programmers. I started using Visual Basic with version 1.0. I knew immediately that this new way of writing code would be a world class revolution.

Unfortunately, the company I worked for at the time had other ideas. Top management was married to IBM. They spent millions on IBM technologies like IMS, token-ring networks, PL/1, and OS/2 that became tombstones along the way in IBM's horrible and prolonged death march. (Corporations, unlike people, can die and then come back to life. That's what happened to IBM.) The company I worked for even made major investments in Lotus, Novell, WordPerfect and an IMS based code generation technology called Pacbase that was recommended by their consulting partner, Arthur Anderson.

It is difficult to imagine a longer and more consistent string of completely wrong technology choices!

All the while, I tried in vain to convince top management that Personal Computers, Visual Basic, and the Internet were really the future. I conducted the very first Internet demo the President of my company had ever seen. He told me I was wasting my time. Looking back on it now, I really don't know how I survived.

The bottom line was that when I retired, I had a driving need to get back to the technology foundation that made sense to me: Personal Computers, Visual Basic, and the Internet. I became the About Visual Basic guide and I've been writing about it for a decade now. Along the way, I also co-authored a book about it:

Pro ASP.NET 4 in VB 2010

I wish I could tell you what the future of Visual Basic will be, both here at About.com and in the world. But my crystal ball is foggy on those. Change is in the air in both. The only thing that is completely clear is that they won't be the same. Windows 8 is such a dramatic departure from anything Microsoft has done before that it's almost unrecognizable. It will be fascinating to see whether it will be a breakthrough or a train wreak.

Visual Basic continues to be a great development environment - I think the best environment - for the jobs it has always done well:

  • Desktop applications
  • ASP.NET server based applications
  • Office automation

It's not so clear that it will be the best answer for the new world of mobile applications, cloud based computing, and game programming. In fact, it probably won't be. Microsoft seems to want to pretend that all computing can still be wrapped up in a huge package labeled "Windows". IBM died because they could not see out of their own internal hall of mirrors. I wish Microsoft the best ... but they may be dying of the same disease.

In any case, it's time for me to conquer new worlds too. I've often described myself as a novelist trapped in a techie's body. Maybe you will see a novel with my name on it someday. If you do -- buy it!! But until then ... may your code always run flawlessly the first time.

Filter Function - String Processing in VB.NET

Sunday August 19, 2012

Strings may be the second most useful "type" in VB.NET. (Integers are probably the first.) So there is a lot of useful string processing built into VB.NET. The Filter function is one and a new article here at About Visual Basic gives you a fast explanation showing how to use it.

The Filter Function in VB.NET

Shallow Copy versus Deep Copy

Sunday August 12, 2012

Although you will find these terms mentioned in technical articles, you won't find any methods with these names. In fact, "Shallow Copy" is the only type of copying directly supported by a method and that one is named MemberwiseClone. (Where Microsoft got that name, I do not know. If you think you can explain it, let the rest of us know.)

 A new article on the site explains what they are and how to use them.

Shallow Copy versus Deep Copy

Does this Microsoft Example Make Sense To You?

Saturday August 4, 2012

Check out the example at Microsoft's page about the String.Clone Method. A snippet of the code there ...

' Create a Unicode String
'
with 5 Greek Alpha characters
Dim szGreekAlpha As New String(
     ChrW(&H0391), 5)
' Create a Unicode String
' with a Greek Omega character

Dim szGreekOmega As New String(New Char() {
     ChrW(&H03A9), ChrW(&H03A9),
     ChrW(&H03A9)}, 2, 1)

This is possibly the worst example of Microsoft documentation I have encountered. (And that's saying something.) And it's used many times to document the different versions of .NET.  Here's just a few of the things wrong with it:

1 - Greek letters have absoutely nothing to do with what they're explaining.

2 - It's totally unnecessary to use things like Unicode characters expressed as Hexadecimal numbers and an obscure New constructor that picks the second element from an inline array. Why do they do those things?

3 - They never explain any of it or even tell you what the result should be. To see that, you have to copy it into your own environment and run it.

But the most egregious fault is ... It doesn't tell you anything about String.clone! (Except maybe basic syntax ... and that's shown earlier.)

Can anyone tell me what I'm missing?

In any case, this was one reason I wrote a new article for the site: Copying Reference Types. Hopefully, this article explains it.

A Double Linked List Program

Sunday July 29, 2012

So, I was reading a book about Design Patterns which had a neat piece of code that kept track of nodes in a double linked list. But there was no code to show how to use it.

I hate it when that happens!!

I decided to write one. How hard could it be? I found out. I didn't know it was possible to create an infinitely recursive data structure until I did it by mistake while writing the program!

Read the article about coding a double linked list "the hard way".

The Factory Design Pattern

Saturday July 21, 2012

The factory pattern is usually classified as part of a family of patterns called "creational patterns" ... they're ways that your code can "create" objects. A common definition of the factory pattern goes like this:

A pattern to define an interface for creating an object where the classes that implement the interface decide which class to instantiate.

If this is less than completely clear to you, try this article: The Factory Design Pattern.

Designing Classes - The Delegation Design Pattern

Sunday July 15, 2012

Delegates have become part of .NET now, and they perform about the same function as the Delegation design pattern. But they're not the same.

A new three article series was necessary to cover the Delegation design pattern. Part 1 - The Theoretical General Case of the Delegation Design Pattern - covers the general case - the one that is so abstract that you might have trouble figuring out how to make it work in the real world. That's why parts 2 - Inheritance - A Contrast with the Delegation Design Pattern - and 3 - A Real World Example of the Delegation Design Pattern - are necessary.

Design Patterns

Saturday July 14, 2012

The Singleton Design Pattern

Technical articles, including those at About Visual Basic, usually discuss the detailed syntax of VB.NET, not the overall philosophy of why you might want to do things in a certain way. Design Patterns, on the other hand, are all about the why and how of programming, not the syntax. This article, one of a series about design patterns in VB.NET, discusses what might be the most popular design pattern, the Singleton pattern.


Using TimeSpan and DateTime

Sunday July 8, 2012

A companion article here at About Visual Basic, Of Ticks and Timers describes the fundamental basis of DateTime and TimeSpan from the point of view of the Ticks that they're made of. This article goes the other way. It describes the differences between DateTime and TimeSpan themselves.

Using TimeSpan and DateTime

Multiple Interfaces

Saturday June 23, 2012

According to C++ programmers, a lack of something called "multiple inheritance" in VB.NET (and other .NET languages - we're certainly not alone in this) make it slightly less than fully object oriented. The rap is that you need the ability of a class to inherit from more than one parent to be able to do things like dynamic binding and polymorphism.

In VB.NET, we have something called multiple interfaces instead. Here's a new Quick Tip showing how that works.

Multiple Interfaces

©2014 About.com. All rights reserved.