Some time ago, MS decided to eliminate VB6. As a long time user of VB6 it
wasn't much of a transition to go to VB.Net, nonetheless, what I increasingly
discovered was a huge loss in productivity, especially for those little niggly
glue projects in teaching, or manufacturing, or where you are transitioning code, or visualizing
a CNC output, or solving a simple differential equation, or doing path planning for
a robot, or connecting a sensor and visualizing it's output. This was caused by throwing
away a myriad of polished stones simultaneously, thousands and thousands
of small hidden refinements and productivity helps that were added to VB6 over 20 years
were suddenly lost with VB.Net. But just below the surface, in all those kinky
formats that made professional software people sick at their stomachs was
another huge problem. VB6 did a better job at OOPs than VB.Net. It did so
by "getting it right", by understanding what objects you wanted to use
most frequently and hiding the complexity for getting you there. For example,
your mother might say "Go to the drugstore and get some Band-Aids." What
she doesn't say would stifle an elephant and kill the most obnoxious prima donna
from Brooklyn, New York. She doesn't say: "Walk along Elm Avenue going south until
you approach the "Tenth Street Pharmacy" at GPS coordinates 41.825 North,
by 85.176 West, enter thorugh the East door, the pharmacy door, try not
to look guilty of theft by keeping your hands at your sides, proceed 8 feet
to the department aisle labelled Pharmacy by .......etc.,etc.,etc. and find
the large rack with containing "Winkle and Tinkle" Band-Aids.....
(PS Would you ever come back from that trip, or would you tell mom.....)
i.e. Not every who, what, when, where, why, how much, and how many, needs be
specified. That's why a lot of programmers prefer Python. Context information
is even much less desireable.
When you went to the MS web site and read the rants and suggestions it was clear
not only that Microsoft did not understand, not only did the programming community not
completely comprehend, but in addition, there was a huge ego trip being had. A classic
reply might be: "VB6 is dead, get over it, take the time to learn real programming."
So what I thought I would do is offer 20 simple productivity hints that could
easily be added back to VB.Net, while infuriating as many MS C++ wannabe types as
earthly possible.
1. Shorten names. "Beep" not "WindowsMessageBeep", "MsgBox" not "MessageBox.Show"
2. Invoke default OOPs objects and targets wherever possible. Why type
Form1.Label1.Text="Hi mom" instead of just Label1="hi mom"?
3. Encapsulate complexity. The FSO class object was put into VB presumably
to add new commands and possibilities. But instead of keeping a simple
format, with automatic allocation, stream positioning, and complexity optional,
MS became lost in the wordy FSO chicken soup with odd long file names, poor
documentation, infinite possibilities, and again, a lack of OOPs defaults.
So, instead of something like: "Open cdlg.filename for input as buffer1",
Now at a minimum you must write:
Dim myStreamBuffer1 As StreamReader
myStreamBuffer1 = File.OpenText("c:\foo.txt")
And instead of something like: Read buff1, Text1.text
Instead you face something like:
Dim strContents As String = myStreamReader.ReadToEnd()
Most authors get so wound up the the chicken soup and worrying about the file
pointers that roughly 50% forget to point out you still must
close your files!!! Basic file programming hasn't changed in 40 years
but periodically it seems we must rediscover that snake pit just below the surface.
4. The creation of forms is no longer handled automatically and the guts
of the process is a bone yard of instantiations exposed like
the bones of a beached whale, inviting every new student to foul up what
remains of a code that MS has already fouled up and dumbed down to
the point of near inoperability!
5. They did the same thing with the GDI graphics library, a BP oil spill implementation.
6. Make easy things easy. To draw a line, the command should simply be "draw" or "line"
followed by the coordinates. Let the computer do the memory management, that's what
computers are for. It is a wonderful suggestion, really.
7. Get rid of anything on the screen that is not part of the program or is unlikely
to ever get modified: e.g.>>>> Inherits System.Windows.Forms.Form
WHAT? In 40 years of programming I have never needed to mess with, look at, or
get all up there touchy feely with such a line of code. I made an occasional
friend object in C++ and VB6 but why use templates in VB unless you are
certifiable and there are sheep. (Are ther sheep or did you steal HP's STL again??)
8. But if I did, the documentation isn't there!! Hint, hint!!
9. Dear MS, give us the other horse for a while. 99% of us want to ride that dappled
Palomino that is dying to please us, or that old Amish mare that plods an
even step. We don't want to train the horse every time. And no one wants
to hitch his buggy to a wild stallion requiring a verbose library of obscenity.
Example, the the key word "malloc" has killed more programs than the Spanish
Inquisition. So why add it and make it a "feature" of the VB.Net groin pull?
10. If 99% of the programs are less than one page of code, why turn on option explicit
by default?
11. Invest in simplification (for the programmer, not for MS silly). The variant
data type was created for a very, very, very important purpose, to save time.
And when a variant isn't used, how about some help, instead of saying:
"dim sally as moose, tom as moose, herd(42) as moose" How about instead:
"Uses moose" or
"!Moose sally,Tom,herd(42)" They copied the crap from C and C++ and left the
easier stuff. What a company?
12. Invest in simple tools and then label them so you can find and use them! It
shouldn't take hours to write a help file, make an icon, or package a short
program.
13. Simplify and build up things that people complain about, unicode, rich text boxes,
handling of file suffixes.
14. Bring back and fix things that you have messed up, like string commands. It takes
hours to do in C++ what VB6 can do in seconds. The drift toward C++ is that
mustang, Palomino thing. No mustang needed!
15. Most casual users have a serious problem with base 0 constructions, "awe mom
can't I play with dad's rifle, just this once?" This is ego country, big
killer egos. My base smarts are better'n yorn. So, make the commands
base 1 optional! Then, if the code police show up on your porch and want
to see your medical marijuana permit, you can show it to them. But since
when does an actual list, search, or table start with a zeroeth entry?
16. Autoinvoke libraries (better). i.e. If I use a command from a common library
then link the darn thing. You can ask me if I want it. Yes, I want actual input,
output, I/O and Multimedia in my program.
17. Bring back the print command. The GDI construct is wasteful.
18. Don' mess up the good stuff. The VB.Net object library is good. The GUI blows.
19. Don't be afraid to upgrade and market old software like GWBASIC and VB6.
20. Take a look at the following 15 lines of code and the resultant display.
Triple dog dare you to come even close in an hour with VB.Net