7 ms·
I built a Win 3.1 app during a company hackathon just for fun. Here, I detail learnings and process for how a new old app can be created with the aid of modern
by yeokm1 7y ago
I built a Win 3.1 app during a company hackathon just for fun. Here, I detail learnings and process for how a new old app can be created with the aid of modern tools and hindsight of old technologies. And perhaps what lessons can it offer us today.
Without the benefit of modern libraries and languages, I had to read up and take care of many low level details, socket programming, HTTP, JSON parsing, UI design in code all under tight memory constraints. Nevertheless, it was a terrific lesson in understanding how things work under the hood.
I had to do things the old-fashioned way reading books and header files due to the dearth of online documentation. I can empathise with the plight of the programmers of yesteryears who had to code without the benefit of online search engines.
With this blog post, I hope you'll find it interesting to learn about developing a modern-ancient app for Win 3.1.
https://github.com/yeokm1/w31slack https://github.com/yeokm1/w31slack
https://github.com/yeokm1/http-to-https-proxy https://github.com/yeokm1/http-to-https-proxy
- dboreham 7y agoPrior to online search engines there were similar offline resources such as the MSDN CDs.
- yeokm1 7y agoAgreed. But such CDs are tough to locate today.
- homarp 7y agomaybe https://archive.org/details/msdncds https://archive.org/details/msdncds can help
- whoopdedo 7y agoBorland's compilers had the best documentation. They included a much of the MSDN API reference in their built-in help files.
- yeokm1 7y agoHmm. Borland and Watcom compilers came up in my research. Will look into them for help next time!
- jbverschoor 7y agoYeah Borland was great with docs
- deleted 7y ago[deleted]
- efreak 7y agoThe Eye might have these, they have a bunch of old Microsoft/msdn related stuff.
- deleted 7y ago[deleted]
- vardump 7y ago> https://github.com/yeokm1/w31slack https://github.com/yeokm1/w31slack Gives just a 404.
- yeokm1 7y agoI forgot to make the repo public. It's up now!
- keithnz 7y agobet you had fancy pants autocomplete also! That was a game changer when it came along....otherwise you had to refer to docs/books.... not to mention the limited screen size.... two monitors? no one was that rich :)
- ygra 7y agoThey mention having to look up function declarations in the header files, so perhaps not.
- jsjohnst 7y ago> not to mention the limited screen size.... two monitors? no one was that rich :) I had dual screens at home in late 1995 for sure, can’t remember if I used a dual screen setup any earlier than that.
- eb0la 7y agoI expected to be compiled in some kind of VM, not on an actual computer with Windows 3.11 :-). I feel "old-style" documentation is much better than we have now. My most productive _python_ only work times were when I had only the python .hlp file and a _physical_ paper book. What are your impressions?
- kstenerud 7y agoI've been programming since 1983. The internet opened up publishing to the masses, which means that non-professional people could also publish, resulting in much more documentation than ever before. But now the amateur documentation writers are competing with the professional ones; the quality of the professional documentation is still as high as ever, but it can be drowned out by the amateur quality documentation. All in all, finding the information you need is MUCH quicker via a search engine, but the signal-to-noise ratio is lower.
- userbinator 7y agoThe quality of Microsoft's own documentation has also fallen considerably; the latest nail in the coffin is that docs.microsoft.com thing that started to replace MSDN several years ago, that created tons of ridiculous fuckups in the "migration process". While doing that they also "open sourced" their documentation on GitHub, which to me sounds more like they're just trying to rely on free labour from the "community" to fix the mess. One of the more memorable WTFs I've seen is this, which is still wrong as of this post: https://docs.microsoft.com/en-us/windows/win32/api/wininet/nf-wininet-internetopenurla https://docs.microsoft.com/en-us/windows/win32/api/wininet/n... Compare to the old version of the page on MSDN: http://web.archive.org/web/20080828050103/http://msdn.microsoft.com/en-us/library/aa385098(VS.85).aspx http://web.archive.org/web/20080828050103/http://msdn.micros... See what's missing? The newer version is not the correct one... in "migrating" the document to the new site, for a reason that completely defines all rational explanation, the return type of the function declaration became void. There are plenty of pages on the new site with this serious error, and they've remained unfixed for well over a year. People report such problems on their GitHub, and they get fixed --- individually --- as they're reported, but it still boggles the mind how such a blatant and widespread error could go through (and the old, correct, content deleted flippantly) without someone in power shouting "STOP!": https://github.com/MicrosoftDocs/windows-driver-docs-ddi/issues/336 https://github.com/MicrosoftDocs/windows-driver-docs-ddi/iss...
- forgotmypw3 7y agoIf you happen to end up in those environments again, I would appreciate it if you take a look at my prototype web-based message board. It's designed for compatibility, and I've tested a lot of Netscapes and IE4, but nothing on Win311 yet. If you want to leave a comment, you can do so right on the message board. It should work, more likely with JS off.
- shakna 7y ago> It should work, more likely with JS off. Many of the 3.1-era browsers didn't have a concept of JS yet. If you're relying on noscript at all it won't work. I did try and check if this was the case, but both links in your profile that it could have been lead to "not found" dreamhost sites.
- Tepix 7y agoWhy would notscript not work on a browser that has no concept of JS?
- shakna 7y agoBecause the <noscript> element isn't valid for the stricter form of HTML that they use. Invalid elements didn't used to show up.
- cesarb 7y agoFrom what I recall of that era, it's the exact opposite: invalid elements (like <noscript>) are simply ignored, and their contents shown. That's how <noscript> works: newer browsers which understand JavaScript know the <noscript> element and ignore its contents; older browsers which do not understand JavaScript don't know the <noscript> element so its contents are shown. The same trick is used for <noframes>: browsers like Netscape which understand frames don't show the contents of that element, while other browsers which don't understand <frame> and <frameset> will show the content of the <noframes> element, so it can be used as a fallback. Strict validation of HTML came later with XHTML, but AFAIK all browsers which understand XHTML also understand JavaScript.
- loa_in_ 7y agoDid you get to work with a co-operative task scheduling? This version of Windows still used one I think. What's your experience if so?
- cesarb 7y agoWindows (not only the 16-bit 3.x, but going as far as the newest 64-bit ones) uses an event loop for the GUI: your program runs a loop calling the GetMessage function, which blocks until the next window message is available. As long as you don't take too much time processing each window message, you don't have to even think about cooperative task scheduling, since Windows will do it for you while waiting on GetMessage. (In fact, AFAIK even in modern Windows you should avoid taking too much time to process each window message, since blocking the event loop thread makes the UI for your program unresponsive.)
- loa_in_ 7y agoI remember the user experience, I was wondering about design decisions during development. You are guaranteed no context switches unless you explicitly request one - did it simplify some parts, or alternatively made it more complex? It's an asynchronous application.
- gmueckl 7y agoWindows NT and Windies 95 were the first versions to have preemptive scheduling. Windows 3.11 and older would only switch tasks when he program requested new messages from the queue. Thus was totally annoying because most applications were written badly and had moments where they would go off and do things and not return to their message loop for several seconds or worse, hanging the entire system during that time. Windows felt very sluggish because of that.
- bluedino 7y agoAnd in Win95, your 16-bit apps could still do whatever they want as they were only cooperatively multi-tasked
- 7y ago
- bluedino 7y agoWe use Visual Basic 6 for a lot more than we should at work...going back to that from using Python, Ruby, and even PHP was a shok. I thought porting a Python script to VB wouldn't be a big deal, but like you said, things youtake for granted like JSON and certain dictionaries are just lacking.
- cr0sh 7y agoI haven't touched VB6 in ages - I tend to wonder what it would be like "going back to it". Not too long ago I remarked here on HN that I expected VB6 programmers might become in demand in the future (when, I don't know), similar to how COBOL programmers were/are. Basically, for the need to convert apps, written internally for a business, from VB6 to something else (likely to VB.NET or C# - maybe on Mono - but there are other options too). I expect this to happen when Microsoft finally kills off the VB6 runtime DLL - but so far they haven't; from what I understand, it's still available in Win10...
- ralphc 7y agoI'm one of the "programmers of yesteryear", part-time in the early '80s on CP/M them on to Windows 3.1 after graduation in 1984. Doing things the old-fashioned way was harder but less was expected of you, time-wise. Getting a "database" (a set of BTrieve files, usually) set up would take days, editing on floppies, etc. It was just expected that making software was a long process.
- WorldMaker 7y agoSome of your UI might have been easier to build with VB than VC. VB4 was the last version to support 16-bit Windows applications. You might have better luck finding VB6 libraries/code-samples that run in VB4 than you had finding C89 libraries.