469 karma · joined September 25, 2014
I really like the flexibility of factory functions, that is the main point of the article imo.
COM/OLE ... that takes me back to the early 90s, a place I hoped to never visit again!
:)
emulating classes is, imo, exactly the problem
using factory functions which create and return an object, with variables passed to and created in the function, handles encapsulation
and there is no `this` to deal with
makeThing(options, usethistoo) { let foo = options.foo; let thistoo = usethistoo;
return {
functions...
}
}I started with 6800 machine language. Then c, smalltalk, scheme and etc.
Rather than spend a lot of time and botch a comparison between classes and factory functions I'll link you to an article.
He went further, introducing something he calls stamps, but I found them to be awkward the only time I tried to use them.
https://medium.com/javascript-scene/javascript-factory-funct...
Sometimes programmers spend way too much time optimizing code which doesn't really need it.
In my experience how data is structured is almost always the most important factor when it comes to performance.
Good data structure + simple code === performance.
Fortunately we can still aren't forced to use all the 'enhancements'.
Class is entirely unnecessary and, essentially, tries to turn JS into a class-oriented language from its core which is object-oriented.
I never create classes. I always create factory functions which, when appropriate, can accept other objects for composition.
And I don't use prototypes, because they are unnecessary as well. Thus sparing me the inconvenience, and potential issues, of using 'this'.
In my dreams those who want to turn JS into c# or Java should just create a language they like and stop piling on to JS.
But, at least so far, the core of JS has not been ruined.
That said, there are some new features I like. Promises/async/await, Map, Set, enhancements to Array being among them. But to my way of thinking they do not change the nature of the language in any way.
Regardless, well done!
She was out of commission for roughly 72 hours and months later still not back to normal, according to what she told me.
If something else comes along, gains a lot of traction, and develops its own ecosystem then javascript could conceivably eventually just fade into the background. But that's going to take time.
I haven't had occasion to use wasm but it seems that it provides the ability to run most (all?) languages in the browser.
Here, for example, is f# wasm.
There was a young, brilliant, programmer, James Shields, who was my partner working on a project. We took one look at VB3 and both immediately saw the potential of vbxes.
At lunch we came up with a couple of initial ideas for custom controls, wrote them, and began selling them on Compuserve for $5 each.
Soon I wrote some controls for working with the just-released Sound Blaster card, which gained some interest on Compuserve's music-related forums, I actually traded messages with Jerry Garcia one night.
But our first big hit was Message Hook which I wrote to overcome some of the limitations of using the Windows API when using VB. That lead to Mitch Waite (publisher of many popular computer books in those days) contacting me to revise the Visual Basic How To. The result was the Visual Basic 3.0 How-To, which was almost all entirely new material.
My approach to writing that book was to think about the things that one would want to program in Windows apps but could not easily accomplish with Visual Basic ... and to solve those problems. Message Hook featured heavily, a copy was included with the book's diskette.
Soon enough the internet came online and I wrote a number of internet controls which allowed thousands of Visual Basic programmers to add, primarily, email and ftp to their programs, however there were controls for more obscure protocols as well.
Visual Basic 3.0 was magic! It was an entirely new idea and several companies, including Mabry Software which was founded by me and my programmer buddy, had a good business until .net blew up the entire ecosystem.
I think it's probably fair to say that VB 3.0, and our internet controls, made a significant contribution to the evolution of the internet.
While Windows 3 was in development I was in the next building working on os/2. (not bragging <g>)
I spent a lot of time in a lab that had a lot of hardware. One day a NeXT machine showed up in the lab.
The next day there was a line of Windows developers waiting for their chance too look at it. (we'll forget the fun I had grabbing a screen shot of the desktop which i then left displayed full screen)
It was a mere matter of days before a build of Windows with 3d buttons came out, and the rest is more history.