BareNakedCoder's comments

BareNakedCoder | 3 years ago | on: Children and a teacher were killed at an elementary school in Texas

The Dickey Amendment[0] frightened the CDC from doing just that. Lobbied for by the NRA and added to a spending bill by a Republican congressman. "Although the Dickey Amendment did not explicitly ban it, for about two decades the CDC avoided all research on gun violence for fear it would be financially penalized." The CDC had budgeted $2.6M to study the problem. This was stopped and, in addition (as "punishment" perhaps?), exactly $2.6M was diverted to something else. Willful ignorance. What can you do?

[0]https://en.wikipedia.org/wiki/Dickey_Amendment

BareNakedCoder | 4 years ago | on: My lizard brain is no match for infinite scroll

My method is super simple but does require a wee bit of self discipline. I "HALT!". I even have "HALT!" written on a post-it on my monitor. Whenever I notice that my (valuable) attention is wandering, I yell "HALT!" in my head or out loud (depending who is nearby). This makes me snap out of it, to break the pattern. Ideally, I return to what I should be doing but very often I can only do the minimum. The minimum being sitting there doing nothing, thinking of nothing (except the thing I should be doing), until I get bored and want to do something ... but only allowing myself to do what I should be doing otherwise I must continue to sit doing nothing (being halted). It's often too hard to halt AND switch do what I should be doing, so this method breaks it into two steps. Halting alone is much easier to force myself to do since doing nothing is easy. Once in halt-state, the only possible exit is to the proper do-state.

Oh, I just noticed something. HALT!

BareNakedCoder | 4 years ago | on: Laravel 9

Agreed! Framework == good doesn't mean any/all frameworks == good. Many of PHP's frameworks seem to have ignored PHP's unique run-time characteristics and adopted Java idioms (with Java, you pay once at compile time; with PHP, you pay with every single request). Ubiquity, near/at the top of the PHP benchmarks, seems to accept PHP's unique run-time characteristics (so performs well) and yet still provides all the benefits of a framework (consistency, etc). Ubiquity should see much more love than Laravel/Symfony/etc but doesn't :(

BareNakedCoder | 4 years ago | on: Golang.org will be merged into go.dev

Or use a worse DNS resolver. Your ISP may be trying to cash in on DNS names that don't resolve / ain't found by instead sending you to another website that pays the ISP a small fee.

BareNakedCoder | 4 years ago | on: AlpineJS

Yes of course the components are usually not the entire page; don't take the terms too literally. I'm still searching for the best name for these modes ("sprinkled" isn't quite right either). Although "full body component" or "big section component" might be a little better, I suggestion not missing the underlying idea or point due to imperfect terms.

BareNakedCoder | 4 years ago | on: AlpineJS

Let me take a stab at explaining how AlpineJS is different. First, let me talk about the two "modes" of front-end frameworks, what I'll call: "FPC" and "Sprinkled":

FPC or Full Page Components: the original HTML source (as seen from "view page source", not "inspect") usually contains a tag like `<div id="app"></div>` which simply serves as the place where the FPC-oriented framework inserts its magic. All the magic happens in the JS (possibly generated by compiling from something else like JSX or a component DSL). Note that a FPC is not necessarily a SPA; you could have multiple pages with one FPC each.

Sprinkled: the original HTML source has the framework's tags, attributes, and/or other markup sprinkled throughout it. The framework will search for these sprinklings in the original HTML and do as they direct. Usually the framework only looks within an encapsulating tag so the original HTML might have something like `<div id="app">...more HTML with sprinklies...</div>`.

React and Svelte are FPC frameworks. All the exciting stuff is in the code: JS, JSX, or a JS-like component DSL.

VueJS can be used in multiple modes. It can be used in pure FPC mode. It can be used in hybrid mode: with both components and sprinklies in the original HTML, including sprinklies between a component's start and end tag. And it can (almost) be used in pure sprinkled-mode. I say "almost" because you do need some JS code to define the mount point and the data. (VueJS also has two sub-modes for components: compiled client-side and pre-compiled during the build. The later requires a more complex build step).

AlpineJS is (mostly) for pure sprinkled-mode. It is easy to write non-trivial function with no JS at all, other than loading AlpineJS itself from a CDN. On page load, AlpineJS will automatically do the needful; no bootstrapping JS is required. When re-use and/or complexity requires it, you can move some or much of the code from HTML to your JS. For even more complex stuff, the new plugin ability in V3 of AlpineJS makes adding your own directives/attributes or magic variables/functions easy. This extra ability in V3 just means although you can do 80% with no or very little JS, you still have room to grow for the other 18-20%.

AlpineJS is great for and focuses on the needs of simpler apps. And most of the apps we develop should ... be ... SIMPLE.

BareNakedCoder | 4 years ago | on: AlpineJS

The website being announced in this post, alpinejs.dev, is new for V3 of AlpineJS which was launched just yesterday. I've been using it since V1 and I can say it doesn't just look like but really is a perfect balance for projects too small for Vue or React but to big for VanillaJS. I would also argue that small and simple is better for most websites.

BareNakedCoder | 5 years ago | on: Stored Procedures as a Back End

At a previous job I was at, we put each release of the sprocs into a different schema. Upgraded app servers called sprocs in schema "r102" while the not-yet-upgraded app servers continued to call sprocs in schema "r101" until they were eventually upgraded.

BareNakedCoder | 5 years ago | on: ASCII – Origins

IMHO, the biggest RTFM-Fail ever is related to ASCII. Think of all the errors made and time lost fixing issues with CSV (comma separated value) or TSV (tab separated files) or pipe-delimited fields in records, etc, etc due to having to handle the case where the delimiter character is not a delimiter character but valid data with a field.

ASCII provided characters specifically for this purpose. But no one seems to have RTFMed. ASCII 31 is a "unit separator" (or field separator as we'd call it today) and ASCII 30 is a record separator. There's even ASCII 29, a group separator, so you can have a set of records related as a group (for example, a group of records of different type but related to a single customer). And there's ASCII 28, a file separator, so you can have multiple "logical" files within one physical file.

BareNakedCoder | 5 years ago | on: ASCII – Origins

FYI, the IBM S/360 did support ASCII[0]. A bit in the program status word indicated if the machine was running in ASCII or EBCDIC mode. Most customers ran EBCDIC because it was more compatible with their masses of punch card originated data (no translation required). For the S/370, for virtual memory, a bit in the program status word was needed to indicate addresses were real or virtual. IBM surveyed its customers and found almost no one was using ASCII so its bit was taken for virtual memory.

[0] Page 70 of http://bitsavers.org/pdf/ibm/360/princOps/A22-6821-0_360Prin...

BareNakedCoder | 5 years ago | on: Fossil

Apologies. Launched just 2 days ago as a static site on Netlify. Will add a JAMstack-based form once our api backend server is up and running. Google Forms was a quick and dirty solution that let us deploy something now. Fossil on HN is rare so I prematurely jumped at the chance of a mention.
page 1