Word order
I strive to write about something useful, and even when an article doesn’t have one thing to teach, it tries to have something to share, like a promising custom element. What follows may fail this standard, indulging in two lines of code which bother my little brain. All this to say feel free to continue, but less to complain for what you will see.
The first line is less of a concern and more of a pet peeve with JavaScript import statements. With the keyword you declare the resource you want to include from a library which then appears by name. The formula is effective, but it sure would be great if you could swap the order of the two steps, if you could specify the name of the package and then what to import.
- import { LitElement, html }
- from 'lit'
It is quite trivial, but in some code editors the change would greatly improve the writing experience with autocomplete and helpful suggestions — hint hint. After all, you rely on a third-party script for features you don’t know by heart — not yet.
The second line has wild implications and relates to SQL commands. Among the possible database operations can remove data starting with the DELETE keyword and a table’s name. I know that a condition is going to follow, so that you end up scratching only a subset of rows, but I’m scared just to think of the dangerous, deleting code. I am only partially comforted by the fact that the instruction needs one semicolon to bring everything down, and without the character the system would patiently wait.
- DELETE FROM "players"
- WHERE "name" = 'DELETED'
- ;
Most assuredly, there is a reason for both lines, the vestige of a long and thoughtful process, but it might be conducive to ponder the order, the syntax for code to come. And perhaps suggest a more active participation in shaping new standards, so that when the time comes, people won’t get to complain about amusing sequences and view-transition selectors. At least not too much.