By | April 23, 2020

I have a couple of “big” projects on the go, but the one I have been focusing most on over the past couple of months has been Digero (Latin for “I arrange”, in a callback to my years studying medieval history). Digero is, essentially, Visual Basic in Javascript form — or rather, in Node.js form. I’m using the excellent (though perhaps poorly-named) NW.js framework as the foundation both for Digero, as well as for the programs made from it.

Not Visual Basic, but not not Visual Basic, either

Digero is the product of many years of wishing there was a tool like it out there somewhere, and never finding one. There are plenty of GUI HTML development tools around, though I’ve found it difficult to find one I like, and, more importantly, they are typically focused on the creation of websites, not standalone applications. There are also a host of Javascript/Typescript-based application development languages and frameworks (React, Angular, Vue), but I find these hard to work with as well, for the simple reason that they are not GUI tools.

Here’s the thing: I’m not the biggest fan of GUI tools. Nine times out of ten, code is more precise, efficient, and stable with respect to solving any programming problem. If you wanted to learn programming and wanted my advice, I would steer you strongly away from GUI coding playgrounds like Scratch and towards real learning languages like Python. Programming languages are fascinating constructions in their own right, and you can’t appreciate the mechanics and design philosophies behind any computational object without knowing their essential intricacies. But every once in a while, a use case will come along that a GUI tool will serve best. And UI construction in HTML/Javascript is one of those cases.

When I create programs out of NW.js, I don’t like to use HTML. I have to supply each individual program with an HTML page, of course, so that it has something to display onscreen, but I tend to pass on pages that are more or less completely empty. Every UI element I use is created dynamically using Javascript code, typically within the “window.onload” function. This may sound inefficient and/or painstaking, but I much prefer it this way. I don’t like working with HTML. It’s not real code. I’d much rather start with a blank page, and then tell the computer exactly what I want things to look like using a real programming language like Javascript.

The problem is that creating HTML elements using Javascript is a huge pain. It can easily take at least a dozen lines of code to create an element, name it, and apply all the necessary CSS styling to it. You have to include a line just to tell the program you want to position each element absolutely, as opposed to relatively. And each line has to take the form “[element variable name].style.[style name] = [whatever]”, which is annoying to keep typing out and/or copying and pasting. And you have to remember things like how values such as “top” and “width” have to end in “px”, or they won’t even work. It’s a huge, tedious pain. And I know that jQuery simplifies the process somewhat, but it’s still a bit of a slog. Plus I’m something of a Javascript puritan in that I tend to avoid jQuery.

Here’s another thing: I absolutely love Visual Basic. I’ve been playing with versions of it since the mid-1990s. I find the balance it strikes between GUI tools and actual code to be just about perfect for developing Windows-based programs. I even find it useful for games, or at least specific genres of games. In fact, I’ve always wanted a tool like Visual Basic that was more focused on game development. I also find Javascript the ideal language for creating many types of games (a topic for another post). So Digero is meant to strike the compromises I’ve been looking for in a programming environment for a long time.

I’m at a point right now where I’m focused largely on making turn-based strategy games, especially those in the 4X genre. I have yet to create a complete game of this sort, and I think one of the major reasons why is because the GUI elements are so difficult to make (or at least that’s what I’m telling myself). I don’t know if I’ll have the patience to ever complete one of these games, but I’m hoping that Digero will take me closer to doing that. Plus it’s an interesting application to make in its own right. In later posts I’ll highlight some of its features, or at least that’s the plan. I have some other stuff I’m working on to. I’ll get that posted here eventually.

This article was published on: 04/23/20 3:25 PM