Spooky JavaScript
Thursday • October 30th 2025 • 9:15:18 pm
What you are about to hear, will sound spooky and confusing, the code I attach, does not help at all - but it is spooky.
The code it is 333 lines long, and it processes just ne lines of code, and yet, AI complained I used it too much.
It is not rare to get this message when your program does stuff, but my program is tiny and just made a list of words.
When you have been programming since you were 10, and max out your AI usage by making a list of random words with 333 SLOC.
That can only mean one thing: you have been up to something spooky – and I was.
There are three spooky things, that I can think of.
Using the bitwise OR operator, as a dual data pipe, with dual mode commands, that just letters but can accept arguments.
So you can say: play, or play “(“ playlist “)”;
Very spooky, a thing that can optionally accept arguments is scary, already on top of abusing the bitwise OR operator, which is hard to want.
The reason we use the bitwise OR operator is UNIX, like in Jurassic Park, The pipe character above you renter key, next to forward slash.
Is used to say: pipe the output of this command, into the input of the next in UNIX inspired operating systems.
Bitwise OR is for binary math, variables that are functions, don’t make much sense when not actually executed.
But in this first spooky example we can say: print(‘Boo!’) | email(‘alice’)
Or print(‘Boo’) | email where the program will ask you for the recipient at a later point.
Any programmer encountering this in JavaScript, will get seriously spooked and take up a different profession.
Now, this wonderful example, has one flaw, you have to define you commands (like email or print) beforehand.
Our second spooky bit of code, uses dots or the period instead of pipe, though the commands can accept arguments but can be bare words as well.
Using periods to separate things that return like things, and thus can be used with dots as well.
Is called fluent, chaining bare variables that can be optionally executed, is as spooky as above.
But the frightening part here, Is that you don’t need to define your commands, bemuse we use an object proxy, which is somewhat spooky as is.
The proxy allows us to intercept the words we are separating by dots, and return something that can be chained again.
We are executing actions, before they exist in our program, from a certain perspective this is a causality violation, major spooky.
But when you wire it to AI, who will be writing the commands, purpose of which it can infer from their names and argumens.
Well, here our professional programmer, retires, good look debugging that which may not yet exist as they try to change things.
Our third spooky, is even better, because we go beyond code, and into the frightening world of databases and SQL.
Though we are not going to talk about the madness of databases, let me just say, this.
You create tables of data, that all have customerId, Account, Orders, Messsages, and then you say joint account and messages on customerId, very simple.
THere are many realtionships between data, from orders to account you have a many-orders to one account, many to one.
From playlists to songs, you have many to many, but in the much nicer world of programming...
We use one to many, and call it a tree, and call the tree the greatest invention inprogramming.
Your file systemis a tree, the guts of a web page is a tree, and even the user interfaces you use are a tree.
Screen has many windows, windowns have layouts, layouts can can forms to fill out an buttons to click, and so on.
Certainly notihng to sneeze at, and here we can use proxies again to intecept object propery access.
For example when se say the following in java script, Account.orders = [];
We can calculate that Account and Orders are Tables, All users have an account, and they store orders in their acocunts.
And to relate users tables together, we can join on Account.username and Orders.username.
Though accountId would be better, because usernames can change.
When in the programming world we say, Account.orders add order, the orders table in the database will receive a new row.
And when we are ready to make this program live, the same mechanism that made out database work.
Also generated a proper database schema file, for use in production - so it is no touble - but it is spooky.
