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.
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.
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 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.
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.
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.
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.
> “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.)
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.
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.
[0] https://github.com/wqweto/VbAsyncSocket/issues/4
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.
+1
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!
Love the story! It almost makes me feel good about academic fraud, no sarcasm intended.
I sincerely hope your nick is not PII though or you might have incriminated your brother.
This is probably the cleanest VB 6 I've seen.
Do notice Option Explicit. That is like disabling 90% of the magic that causes unmaintainable code.
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.
> Along with a switch to use SDI instead of MDI.
You monster!
Wait till you find the assembly code hidden in a list of hex numbers that gets copied to a function and then called as a thunk ;-)
I remember the feeling when you see a module and it has an "On Error Resume Next" at the start.
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.
2 replies →
That’s basically how shell scripts behave by default. At least in VB it’s not the default.
1 reply →
I wish I had known this back in the day.
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 are (at least) two project in development aiming to make a modern VB6 with full backwards compatibility:
https://twinbasic.com/
https://www.radbasic.dev/
Especially Twin Basic looks good IMHO. Looking forward to testing it on my old applications!
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.
1 reply →
The VB6 IDE can still be installed on Windows 10 and probably 11.
See https://www.vbforums.com/showthread.php?898205-Can-Visual-St...
I don't think Microsoft will come after you for doing it even if you use a pirate copy.
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.
TheRasteri has a video on getting VB6 running on a modern system, it's not pretty: https://youtu.be/LVEsNUm04Sc
I heard GAMBAS is one. Not tried it. Was mentioned on HN recently and in the past too.
Gambas is not compatible with VB. Similar capabilities in many ways but it can't compile VB.
1 reply →
This is glorious.
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 would have been cool to have a rad tool but for react and js as a whole. Writing it by hand is such a waste of time, at least for backoffice tools.
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:
https://files.johno.uk/habbo/h4bbo.net/archive/HabboStuff/Mo...
5 replies →
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.
I implemented TLS without any external deps by supporting only mandatory stuff from the RFC specifications.
DER parsing here: https://github.com/mateuszb/tls1.3/blob/master/der.lisp
Elliptic curves here: https://github.com/mateuszb/tls1.3/blob/master/elliptic-curv...
Protocol records: https://github.com/mateuszb/tls1.3/blob/master/record.lisp
At the time I implemented TLS1.3 there was very little support for it and it seemed like a fun project. The parsing wasn’t the difficult part
5 replies →
Let's not forget the ~600 lines of type declarations lol...
To be fair, though, in C, those would just be hidden inside a header file, so you wouldn't notice them as much.
Kids today will never know the joy of "On Error Resume Next"
Man, you made me think of this old gem: https://m.youtube.com/watch?v=Ts96J7HhO28
My greatest shame as a young developer was wrapping a Delphi application in an exception handler and re-running itself when it crashed.
Nono, this is called "let it crash" philosophy, you just reinvented Erlang and you're actually a genius!
It's called
these days. :)
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).
1 reply →
That’s what shell scripts do by default, so I would argue that kids today actually do know.
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.
Twinbasic isn't wqweto's, it's Wayne Phillips.
Neat, thanks for sharing!
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?
> Does VB6 not have any other mechanism for function pointers?
Not really:
https://www.codeproject.com/Articles/19239/Compilers-Demysti...
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.
I used to pass functions by just creating a class making a noun of a verb, i.e. I passed objects.
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!
Same here! I remember carrying a VB6 book with me in the beach as a teen!
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.
I still can’t comprehend that VB6 had time travel debugging 20 years ago, and we still don’t have that with most other IDEs.
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.
2 replies →
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.
4 replies →
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.
2 replies →
> “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.)
3 replies →
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.
Really nice work which prove, once again, that there is no "bad" langage !!
VB 6 paid for my first home. But yes, this is insanely brave. VB is not the most expressive language out there.
Yeah, but it's a humiliating lesson that good enough beats best.
More complex business logic was solved with VB than with Haskell. Same for JS, PHP, Python and all the other "poor" languages.
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.)
Nice! I had to migrate a project using VB6 because I couldn't call an API year back that needed TLS 1.2.
Super cool to see this amazing tool getting love in 2023!
Would be great if operating systems implemented this stuff so every application doesn't need to. Every other internet protocol is built into the OS.
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.
1 reply →
See also my experimental TLS 1.3 library in JS/SubtleCrypto, which you can see running live in the browser: https://news.ycombinator.com/item?id=35884437
[dead]
I fell out of my chair into a fit side-splitting chuckling.
Hey, VB6 is ~~free real-estate~~ Turing complete, although maybe just barely.
If a quine transpiler between JS and PHP and VB6 existed, all things have happened, AI has won, and we can go back to typewriters and candles.
It exists: https://esoteric.codes/blog/the-128-language-quine-relay