What is impressive (or hilarious) is that someone opened an issue because it wasn't compatible with VB5[0]. The maintainer added a VB5 branch which apparently fixed the issues.
Ah,VB6 - that's how I started programming. There was a book literally called "Visual Basic for Kids" and I got it when I was....12? I think? Anyway it got me into making all kinds of basic games, then I started reading books about C and C++, started programming for the Playstation Portable, went to university to study CS and got a job in the games industry after that. I 100% credit Visual Basic 6 for me being a programmer today.
VB6 was part of my Year 10, 11 & 12 software design and development class at school similarly was my first start as a programmer. I remember one of my first major projects was a sudoku solver :)
In fact, I still have the 1300 page 'Mastering Visual Basic 6' book on my bookshelf as a reminder some 15 years later.
Close enough, I found a free pdf on Windows Vista ~2008 and there was a chapter with VBScript. You could write these and just double click them to run, spent many hours in notepad making dialogs and small calculator apps etc. Was pretty shocked when I picked up cpp shortly after and the tutorial told me I needed something called a compiler.
I wonder how much the fidelity of modern games hinders young people from breaking into computer programming.
Games are an amazing mechanism for learning because they can cover a gamut of computing issues in an interesting and motivating environment. The key to learning how to program (or, honestly, most anything) is to have a problem you're keenly interested in and trying to solve it. The "learning" becomes secondary to the problem solving.
My Dad learned programming (badly, wow was his stuff horrible!) through solving financial analysis questions. Kids, however, tend to not have "problems". But games are filled with them, and, done right, in a quick turnaround environment, they can be really fun, and quickly rewarding, to solve.
But, Back In They Day, LOTS of games were crummy, character or text based games. So most of the problem solving was not spent on assets, but just on the logic behind the game. As a student in high school with access to a PET computer, all I did was write games. When all you have is the, albeit robust, PETSCII graphic character set and a 40x24 display, you run into limits quickly (you should have seen my first forays into 3D programming).
But at the same time, the cosmetics cost "nothing". A few characters laid out on the screen. I had a submarine game with ships traveling across "rolling waves water", that, honestly, probably took 10m of coding to make it work.
Today, however, if you look out at most any game, well, the graphics are the graphics. 2D, 3D, etc. They're very involved. Even a web page today is (can be) a time consuming process of making it "look good" beyond simply generating the content for the page.
And I just wonder if that's acting as a barrier to entry for folks even wanting to try their hand at it. This "Alphabet" game, I can see that being very quick, even for a novice to make progress on with Visual Basic. A window is trivial, painting characters is straightforward, adding colors, etc. No worries about frame rates, double buffering, animated sprites, etc. Just clear the screen and stamp a letter (or letters) on it, and watch for a keystroke.
I know there are some child friendly environments that perhaps make this easier, but for teens that want to use a "real programming language", the step up can be quite steep. When your "Star Trek" game looks much like any other, its easy to focus on game play, logic, and "learn programming". When your "Star Trek" is made from E's, K's, and *'s and The Other One is full motion 3D models blasting glittering photons, you can see how for some, that can take the wind out of their sails to even start trying.
Scanning "Visual Basic 6" in the title instantly triggered a strong haptic feedback in my heart!
VB6 is how I learned to speak to the computer and make it do anything I wanted it to do.
I was in high school when I built a simple, yet funny, game in VB6. I was a novice, but the game was working like a charm. The concept was basic, the alphabet letters, randomly falling down the screen from top to bottom, and you had to press the corresponding key on the keyboard before the letter totally disappeared at the bottom of the screen. When you hit the letter, it would explode with a nice animation while playing an "explosion.wav" sound file. When missed, the screen would get a red flash with an alert sound. I then took a step further by introducing "levels", which were basically a mix of falling speed and adding extra characters, like UPPERCASE letters, where you should hold the SHIFT key when pressing the letters, numbers on the keypad, and even special characters that have a special combination on the keyboard.
Sometime later, one of my elder brothers was studying at a broad university (in Europe to be precise), and as a final project of his studies, he was required to build something using programming — anything that runs on a computer! He reached out for help, and I told him I'd built a game, He asked me to send it over, and when he pressed the F5 key on his keyboard and ran it, he was amazed at how funny it was. He had a tiny challenge, though, he was obliged to explain how he built it in presentation. I can’t forget how I explained the code to him and what each function meant. I was in a public park, and the people were staring at me like I was not OK! I was yielding on the phone: "read that IsPressedLetterOnScreen function", "check that class", "go to line 99", "make a break point here", "press CTRL+F5".. you know..
In the end, he fully understood how it was working, presented the game, wowed the evaluators/teachers and, per his claims, got the highest score among all of his colleagues. Hearing that his (I mean, my) game was the best project presented that year made me the happiest person living on the planet that day..
That's my story with VB6.. in a nutshell, and that's why I felt the haptic feedback in my heart!
The IDE has a setting to always turn it on for new projects. That was a setting I always enabled on new installs. Along with a switch to use SDI instead of MDI.
In my first job, I was given a VB6 project to maintain which had a mixture of "Option Base 1" and "Option Base 0" (or unspecified, this being the default), with occasional "On Error Resume Next". This specifies the index value for the first item in an array, i.e. you could choose the default European building floors (ground floor is 0) or American floors (ground floor is 1) -- per module!
I had to convert everything to "Option Base 0" before I could start fixing the reported bugs, it was far too confusing following the arrays passed between modules being indexed starting at 0, then 1, then 0 etc.
The existing code was written with 0 or 1 as required (except where there were bugs), and frankly I think it's was better anyway to use 0 everywhere rather than LBound(x).
Are there still working and available ide and compilers for vb6?
Any open source ones?
After working on vba for MSAccess for a few years I came to both appreciate and hate it.
It’s fast, small in features compared to modern languages, but a pleasure to hack around and find ways to expand its capabilities.
I made simple ORM with it, autogenerating classes from a database, went into the rabbit hole of modernising the dialog box to properly display unicode and make it richer, extended it with string classes taken from .Net, played with COM, the ribbon, etc
Maddening at time but so satisfying to play with. And it was for a useful purpose.
There was also another one written in Java which was (supposedly) very compatible too and had a full working IDE, etc, but it was abandoned long ago and has been lost in the mists of time. Actually there was a much older project that was compatible with VB4 (i think) and IIRC it was made when Microsoft still worked on classic VB, but again, abandoned and lost.
None of these were open source, like the two you mentioned, which if history is any indication it means that they will be eventually lost too.
> There was also another one written in Java which was (supposedly) very compatible too and had a full working IDE, etc, but it was abandoned long ago and has been lost in the mists of time.
That was probably Jabaco[0]. Shame it wasn't open sourced. I played with it back in 2014-ish.
My company still maintains a VB6 program that we just keep that IDE alive in an XP VM. I can attest that the VB6 applications will work on Win10 & Win11 with only minimal effort to get the required libraries so I would not be shocked to learn the IDE works too
At work we created a vscode extension to use VB6. It's not a language server because it would need to interpret the syntax and all that but helps handling multiple projects, automatically cleaning registrations, checking vbp references and dependencies, etc.
I remember, fondly, my VB6 days in back office of a power company during my internship. I don’t think I’ve ever developed and delivered software faster than back then. It’s too bad the whole “RAD” thing isn’t a thing anymore.
It's less than 8kLoC, including what seems to be a bunch of tests at the end, although much of the actual crypto appears to be done using the native advapi32/crypt32/ncrypt libraries. (For those used to OpenSSL, I suppose this could be compared to the libssl part of it.)
Yep, one of the features of VB was you could call into Win32 fairly easily.
I once worked with a guy who was a VB savant. He had reverse-engineered the DOC and PST formats in Visual Basic and was comfortable bit-bashing stuff in that environment. His higher-level code was really not good, that wasn't important to him, so he pasted stuff everywhere. Lost track, but hope he found his niche.
I think we all have similar stories of tools like VB being pushed far beyond their original purpose by someone with enough motivation, and creating perfectly functional, yet extremely unconventional code. Here's another example I found in my links of old interesting web stuff --- a server for the MMO Habbo Hotel, written by (at the time) a teenager:
The most impressive 'pushed beyond it's limits' code I've seen is The trick's VB6 kernel mode driver. Yep, really. VB6. Kernel mode. You have to strip out the MSVBVM60.dll dependency, which dramatically limits what language features you can use, but it's possible, albeit for 32bit Windows only, of course.
Inspired by that, I made a similar 'hello world' type kernel mode driver and in addition to the VB6 version, made a twinBASIC version, which can compile to x64 and run on current Windows. twinBASIC has no runtime dependency, so you can use far more of the language features, supports cdecl for calling dbgprint, and it has native support for putting APIs into the IAT so no TLB dependency and overriding the entry point so no special hack for that.
I'm not nearly as brilliant as The trick or wqweto to figure these things out to begin with, but it's so much fun taking the techniques of these legends and running with them. Although I did claim the title of first to create a realtime kernel ETW event tracer, a notoriously unfriendly API that requires multithreading (possible in VB6 thanks to The trick et al, natively supported in tB via API for now, language syntax soon).
The trick is an actual genius. Why are people like that still using vb6 and making these awesome things? I'm not complaining, it makes me happy!
Love reading your posts too, fafalone. Imo you're up there with these other fellas! Keep at it.
They are the perfect example of the "it's not about the tool, it's how you use it" mentality. I'm not complaining either --- and actually think that we can learn a lot from how these people approach their work.
The big lines of code in TLS is x.509 certificate parsing, and supporting multiple protocols. If you just want 1.3 and you've got existing cipher and certificate validation libraries to call, it's not too bad. There's some published test vectors to help you get the cipher setup right as well; it gets fiddly, but it's not going to be a lot of code unless you have an Object Extravaganza, and even then, still not too bad.
Does supporting only the mandatory stuff give you acceptable compatibility in the real world, or do too many people rely on things that were supposed to be optional?
It works most of the time unless the "endpoint" employs an engineer who is prone to customizing things too much :) In TLS 1.3 "mandatory" really means it.
der.lisp is only loading a PKCS1/DER-encoded private RSA key, which is a far cry from certificate parsing. (And certificate.lisp just loads a blob.) Granted, for a server which doesn't support mTLS you don't need to parse certificates, or any other complex DER-encoded structures.
Thanks. It was a really fun project. There were a lot of things to keep track of so readability of the code was a big help to not lose the big picture.
I'm still programming in VBA today. I name the error handling labels try: and catch: and finally: :). My attempt to introduce some modernity into the language (the'try:'-label is obviously obsolete and is a mere indicator).
wqweto is a genius. Check out his twinbasic project, 99% similar to VB6 with a bunch of extras, modernising the language.
Shout out to all the VB6 legends still going at it and extending the language, wqweto, the trick, olaf, retailcoder.
I’m seeing in-line x86 assembly encoded as floating-point constants, implementing what looks like indirect function calls (function pointers?). Is this…normal for advanced VB code? Does VB6 not have any other mechanism for function pointers?
COM interfaces might count, but that's more of a reference to a COM object which can have many member methods besides a single function (though the concept of using only interface-types to pass around function-pointers is Java's chosen approach, and I don't know anyone who still maintains this was a good idea...)
You can use the "AddressOf" operator to get a function pointer, but it can only be used to pass to native (Win32) functions. This is how you do things like implementing your own WndProc function. VB itself can't call through the resulting function pointer.
The trick was to use some Win32 API function that is guaranteed to invoke the callback right away with the arguments that you specify explicitly. CallWindowProc was the usual go-to for that.
VB6 was my first programming language. I started using it in 2001. I loved it, and it is the reason I am a programmer today. Seeing stuff like this is really cool.
My first paid programming job (summer 2001 after first year at uni) was a VB6 project for a friend's family member's company, to update their website easily. I think they might still be using it!
Fond memories of my earliest 'programming' experiences with VB6. I remember making a currency convertor in it when I was about 10 and thought it was the coolest thing ever. Either that or GORILLA.BAS ;)
I was a little later so my memories are things like dos32.bas, VB6 code to make pr0ggi3s for AOL. 12-14, making punters to boot people off, making l33t phaders for your chat room text (gradient color)... i made a scrambler that got pretty popular-- a chat room game where you competed to unscramble words the fastest. Even made it so it avoided the esay csae of smae fisrt and lsat.
I was a huge asshole back then but it was a lot of fun.
Don’t tell anyone, but I still think we’ve been terrible at UIs since VB6 and Hypercard.
We mostly gave up on 2D grids as device resolutions evolved. We made HTML, then made HTML5 as if everything was a blog or newspaper with a navigation bar, semantically (and you still have to learn that the nav contains a bulleted list?)
Unfortunately, it became a 3-hour or 3-year or 30-year process for someone to learn “how do I add a button at the bottom-right of my app?!”
Windows Forms with C# still works excellently. Sure, Microsoft has deprecated it a bunch of times trying to push a new UI paradigm every year, but good old WinForms will never die.
The language is much better and the editor has more modern controls. Win32 calls are available relatively easily and the whole program runs quite a bit faster than VB6.
It's a shame that this is so often overlooked. At some point everyone seemed to have switched to WPF and that's when .NET cross platform GUIs seem to have died. There's a new tool out there right now but that doesn't work on Linux so I can't say I really care when WinForms will work perfectly on any operating system Mono has ever been ported to.
Yep. I cut my teeth making custom .ocx components. That teenager was part of your dll hell!
VB.net is pretty good, but at that point I just used C#. I go back and make C# guis every now and then with winforms. It always makes me think “how is everything else including QT and WPF and CSS worse decades later?” ;)
And how about that experiment with Electron? That ultimately ended up with me typing `atom foo.py` a few times a month and then being sad (50% of the time because it takes forever to load, the other 50% because it died like 3 years ago and isn’t installed).
I'm still using it although I'm not sure it's a great idea anchoring yourself in the past like that. Also the high dpi stuff has been improving but isn't really very good.
For all the criticism Apple gets on backwards compatibility I think they have a much better story than Microsoft when it comes to UI frameworks.
I completely agree. I've played with VB6 a few times recently and it feels so fast and natural to make a UI compared to modern frameworks.
A bit part of it feels like a dedication to highly polished developer tooling. A strong GUI editor that works with (mostly) zero configuration is a big feature of VB6 to me.
I don't speak for everyone, but in the end what bothered me of VB6 was that it was simply very slow. But nothing compares with the joy of loading some obscure .dll and finding out you now had some neat and fully functional component ready to lay out in your app.
Heyyyy ;) Computers were slow. Java applets were slowest. These days I think QT is slow.
It’s not, but with the decadal upgrades in hardware… there should be things that load instantly. Everywhere!
(Deep breath on my end. Ok.) It’s like how games went from a few kilobytes at most, to megabytes disk or dialup… to blue CDs, to 4.7gb, to blu-ray, to 0.5 TB downloads, to second mortgages.
And most of them suck anyway! We will always max out our tech, even if it doesn’t get us much. I mean… we bought that hardware for reasons.
> A strong GUI editor that works with (mostly) zero configuration is a big feature of VB6 to me.
IMO even Delphi 1 had a better GUI form designer. The "Align" property that many controls had, including containers, allowed for visually creating resizable layouts easily since that placed a control to one of the left, right, top and bottom edges of its parent (multiple controls could be stacked) or at the "client" area which basically covered the remaining area. VB had a similar property but IIRC only the picture control supported it (the picture control was also used as a container) and could only place controls to the edges but not the client area. This meant that pretty much any non-trivial UI that needed a resizable window had custom code for the resizing event to handle that instead of being done visually.
Delphi later added a simple "anchor" property to allow custom placed controls to be resized too (the default setting was to anchor to the left and top edge which behaved like before anchors were introduced, but e.g. anchoring a control to the right edge in addition to the left caused the control to be resized horizontally when its parent was resized and anchoring it only on the right caused it instead to move horizontally).
Nowadays Lazarus provides a more advanced anchoring system (e.g. you can have a label control be aligned vertically at the middle of a combo box control and the combo box's left edge to be aligned with the label's right edge with a margin of 5 pixels) which is set up using a visual editor (no code needed) but it also provides the Delphi-like anchors and align properties as well as a bunch of other properties that can be edited visually, like min/max sizes, child control placement, etc all of which make it IMO by far the best WYSIWYG form designer for desktop GUIs (though the anchor editor's own UX could be improved).
And this is why I absolutely refuse to do the whole HTML and Co. method of doing GUI's to this day. (XAML etc). I use tools like ETO instead where possible, where I define my UI in code, and it's built to the native UI toolkit whereever relevant. At no point am I writing fucking XML (why does anyone think this is a good idea?!) for a UI. I'm saying I want a title bar with these elements, directly in code. It's fantastic, and should be how it happened in the first place.
You may like my project, once I get around to open sourcing it.
I feel, of the three ways of designing guis, the most explored is the declarative way, and there seems to be an assumption by everyone that this is the best way...
But, there is absolutely no data that I could find that supports this view.
I made a small js library to make it easier to quickly write the widgets and layout of widgets in code only.
So fa I'm preferring my code components to react components.
> “how do I add a button at the bottom-right of my app?!”
Whenever I work with a WYSIWYG GUI designer I ask myself a different set of questions instead:
Is this button really in the bottom right, or does it just happen to look that way at the current window size?
Is the spacing on all sides actually equal, or are the pixel coordinates just close enough that I can't see the error?
If I click the button to find out, will I accidentally move it and introduce the error I was trying to detect? (And the version control system can't do much to help with blobs of generated layout code/data.)
> Is this button really in the bottom right, or does it just happen to look that way at the current window size?
To be fair, that would mean you're not using a WYSIWYG GUI designer. With VB6, you could resize the window, in the editor, and watch the elements move around.
Sure, but you have to manipulate the window to find out, instead of knowing that it's in the bottom right because that's what you specified.
And now your carefully set window size has changed, just because you were trying to find out the layout parameters of the button. So you have to go and poke at the properties of the window, if you can remember what size it was supposed to have, And hope you don't accidentally change anything else in the process, because "git diff" isn't going to be much use.
Well, maybe it's just me. I prefer writing a specification (e.g. source code), which can be reviewed and diffed, and then compiling/executing it.
Your points don't match how the VB6 editor presented the settings or behaved. You seem to think it was some pure WYSIWYG interface, which it wasn't. You could parametrically (in the properties window) and programmatically do whatever you wanted.
> instead of knowing that it's in the bottom right because that's what you specified.
You did specify the anchors, in the properties window. If you wanted, you could easily verify you had everything correct by resizing the window.
> And now your carefully set window size has changed
If you thought that exact size was important, then you would just have it set to that special size at startup, by setting the "width" and "height" property of the window, or whatever other thing.
> because "git diff" isn't going to be much use.
> I prefer writing a specification (e.g. source code)
You could define the whole interface programmatically, if you wanted, and many did. Sometimes, there was some hybrid, where you would draw up the main window, then throw programatic stuff in a frame/whatever container, because sometimes that makes sense.
The purpose of all of this was to make things easy and take less time. In some, going the programmatic route is a great way to increase billable hours, sometimes it a great way to decrease them. Sticking with one method over the other doesn't make sense to me, because that would be an emotional decision rather than a practical/efficiency one, right tool for the right GUI/window/dialog box, and all.
For what it's worth. I started my company with a B2B solution developed in VB6. Now 20 years later I moved to Cloud/SAAS long time ago. But wouldn't you know, about half of my clients still run mission critical processes with the desktop client that received it's last update in 2018. Another one is scheduled for this year.
Something about VB6 felt so pure when I wrote it. it's not fancy and is missing a lot of stuff we take for granted today (pretty sure there is no built in map structure lol) but solving problems in VB6 due to language quirks was always fun.
I can verify that there is no built-in map data structure. Also its "classes" don't support constructor parameters nor inheritance. (Wrestling some debugging issues in a legacy codebase so these frustrations are much closer to hand than I would like.)
Windows and Apple does. Linux is typically exposed through OpenSSL or an OpenSSL equivalent library.
The downside to the OS provided libraries is that you are at the mercy of what the OS provides. You need Server 2022 or a relatively new Windows 10 build to have TLS 1.3 available.
The Linux kernel exposes TLS but very few people actually use it. On some hardware it can make TLS significantly faster, but on beefier hardware I doubt you'll notice the improvement much. At the cost of rewriting your entire network stack, I don't think it makes sense for many tools to switch to it.
I'd argue that the Windows crypto system and openssl really aren't all that different, concept wise. In theory you can ship Linux without openssl but in theory you can remove the Windows cryptography library too if you remove all of its dependencies. In both cases you'll be left with a barebones system where only statically compiled tools can talk to the modern web.
The Linux kernel only handles the TLS record layer. It's enough to use sendfile(2) on a TLS socket and that's all -- that's why it was added. Userland is still responsible for the TLS session negotiation and handing off the cryptographic keying material and parameters to the kernel; you still need a userland TLS library like OpenSSL.
[0] https://github.com/wqweto/VbAsyncSocket/issues/4