HNHacker News
TopNewBestAskShowJobs

AltruisticGapHN

484 karma · joined April 15, 2020

submissionscomments
AltruisticGapHN··on MacBook Neo and how the iPad should be
> No more keyboards or mouse support for iPads.

Pretty sure there are students at Uni using iPads with keyboard. It's smaller form factor than a laptop.

AltruisticGapHN··on ChatGPT Images 2.0
This is insanely good. But wow, prompting to get any one of these images is way more complicated than prompting Claude Code. There is a ton of vocabulary that comes with it relating to the camera, the lighting, the mood etc.
AltruisticGapHN··on The first 40 months of the AI era
I agree. I think of AI as a search engine on steroids.

But I think it IS the best way to search for information, to be able to put a question in natural language. I'm always amazed just how exactly on-point the answer is.

I mean even the best of docs out there that have a great search bar like the Vue docs still only matches your search term and surfaces relevant topics.

AltruisticGapHN··on When do we become adults, really?
I'm 51 now and I feel like I will never be an adult. Looking around I see a lot of broken people, each in their own peculiar ways. Everyone has some coping mechanisms, triggers, and behaviours rooted in childhood. I don't see it in a bad light, I think it is just humanity.
AltruisticGapHN··on The three pillars of JavaScript bloat
"some people apparently exist who need to support ES3 - think IE6/7, or extremely early versions of Node.js"

Seriously what kind of business today needs to support ES3 browsers? Even banking sites should refuse to run on such old devices out of security concerns.

AltruisticGapHN··on Emacs and Vim in the Age of AI
You can have Vim bindings in vscode.
AltruisticGapHN··on Modern CSS Code Snippets: Stop writing CSS like it's 2015
BEM is actually not hell, since the whole point is to have classes with a specificity of 1, making precedence of CSS rules easy to figure out.

Non-BEM CSS with ids and multi-classes everywhere was hell.

AltruisticGapHN··on Google AI Studio is now sponsoring Tailwind CSS
That's not the full picture.

If you're a senior CSS developer you will invariably reach a point of using "object oriented CSS" which is where you combine classes to an effect.

At that point you're not far off Tailwind. TW just took it all the way.

AltruisticGapHN··on Web development is fun again
I'm trying to catch up with AI but it's difficult because most articles I find are kinda vague and there is a lack of clear examples.

It's always about prompting or how AI "is great" yadi yada but hardly any step by step examples.

I can easily ask gemini CLI to produce code for example. But how to work with AI in an existing codebase isn't obvious at all.

It seems also that for any serious use you need a paid subscription? It seems like the free models just can't handle large codebases.

AltruisticGapHN··on Show HN: Minimalist editor that lives in browser, stores everything in the URL
I love this. Great little html page to refresh on Javascript.

For fun I put it in chatgpt and asked if there are bugs.

It warned about fromBase64() and toBase64() not existing in main browsers. It is supported but is indeed a new "baseline 2025"feature. It suggested more compatible code using two small functions to convert characters manually.

"deflate-raw is not consistently supported." It suggested using 'deflate' instead.

AltruisticGapHN··on People with blindness can read again after retinal implant and special glasses
I believe fish oil / omega 3 helps.

https://www.ncbi.nlm.nih.gov/books/NBK11888/

AltruisticGapHN··on Cash: A small jQuery alternative for modern browsers
I created a similar `$()` utility function for my projects albeit with 10 times less functionality.

I used the same basic signature for the `$()` function. However I found that 95% of the time I don't need to use the chain method on a collection. There's almost no scenario in which I want to do <collection>.addClass() etc. There's practically ZERO situations in which I would use something like attach an event to a collection of nodes, since event delegation is more elegant (attach a single event and check for event.type and event.target).

So TLDR I made $() always select a single element with `querySelector()`, which means I could remove the collection/loop from every chained method like addClass() or css() or toggle().

Point unless you write bad code to begin with, you can probably make this significantly smaller by removing the collection handling. The 1% of the time it is warranted to do an addClass() or something else on a bunch of nodes you can just go native and if the collection is small enough just call $() on each element.

PS: I guess the subtext also to my post is sometimes something looks logically elegant, like the ability for any chained method to act on the collection selected by $(), but it may not make any sense in the real world.

AltruisticGapHN··on Why VR Games Still Haven't Taken Off
There's really cool / chill experiences on PCVR like a kayak game, but I can't spend money on a PCVR only headset. I have a Quest 3 and it's such a hassle to set up Oculus Link on top of the PC running - that I end up playing Quest games only.

Which is where I am a bit mystified by the article's claim of "hyper realistic" games. Even on PCVR the quality of PC VR games in general is quite low. We're a far cry from hyper realistic experiences. Typically either the graphics suffer and you have smooth FPS or the graphics are great and you have bad FPS, or you are a rich person that owns an RTX 4090 etc.

For me it's only a matter of a few more years. Most games on Quest atm to me look like cheap mobile games. I hate those low poly / untextured styled games with a passion.

The author perhaps does not understand that to make truly immersive, relaxing experiences in VR you need a LOT more power. There 's nothing very relaxing about being in a forest made of low poly trees, shitty looking water and distant scenery that looks blurry AF.

Even on YouTube at the best quality I can find, there is hardly anything truly relaxing or immersive. Take a random video of the Grand Canyon in VR and everything in the distance is just flat.

Colours is also a huge problem. Watch a VR video of someone walking on the beach : the sky is blue yes but a weird half light blue that is nowhere near anything like the kind of brightness of the real sky. It's all deadened and flat.

The technology just isn't there. So right now, violent, in your face action is where VR shines. Typically anything that moves, and anything that comes close to the camera gives a much better sense of immersion. I find myself often times almost putting my nose to everything because it's when things are up close that you get that sense of 3D the most. Anything taht is even a couple meters away becomes flat and featureless.

Anyway I could just rant on and on. VR is great. The kind of games that currently do well on it do so for a reason. I'd love to just travel in VR, to be immersed on some remote island, basking in the sun, or to listen to the crickets and watch the starry sky.. all those things currently are awful experiences in VR due to the technical limitations.

AltruisticGapHN··on VanillaJSX.com
Thanks I created a custom directive, it's just ten lines of code and it works beautifully. Simply grabbed the `part.parentNode` property. I did the same for a `transition` directive that does something similar to using `appear` in Vue transition to have a nice fade in on first load.
AltruisticGapHN··on VanillaJSX.com
I'm having fun using lit-html with vanillajs, after I saw a tweet from Marc Grabanski suggesting he didn't use the full Lit library. Admittedly I am then not taking advantage of all the reactivity goodness, but I also really dislike the decorators syntax and 95% of the time I just don't need the reactivity after the first render.

It works great! I was amazed at how you can do so much in templates, it's pretty much everything I could do in Vue templates, though a little more verbose.

I built my own `VanillaComponent` class, which has a mount() method which calls the render() function which I define on the child class.

My VanillaComponent class looks like this:

    import { html, render } from "lit-html";
    
    abstract class VanillaComponent {
      abstract render(): ReturnType<typeof html>;
    
      private _mountPoint?: HTMLElement;
    
      mount(this: VanillaComponent, target: HTMLElement) {
        target.textContent = '';
        this._mountPoint = target;
        this._update();
      }
    
      _update() {
        let templateResult = this.render();
        let rootPart = render(templateResult, this._mountPoint!);
      }
    }

So I can write something like

    class MyComponent extends VanillaComponent {
      constructor(props: { label: string }) {
        this._props = props;
      }
      
      render() {
        return html`<button>${this._props.foo}</button>`;
      }
    }
Then I can instance like so:

    let myComponent = new MyComponent({ label: "I am a button" });
    let target = document.querySelector("#demo");
    myComponent.mount(target);

The base class stores the root node (target), so later I can do

    myComponent.update()
to re-render, taking advantage of lit-html's "diffing" logic.

However something I have not been able to solve with lit-html only, is when I compose parent and child components I have to do something like :

    class MyDialog extends VanillaComponent {
      render() {
        let childComponent ...  // another VanillaComponent previously instanced
        return html`
          <div>
            ${childComponent.render()}
          </div>

So the child component I need to explicitly call render() to get the TemplateResult for the parent template.

But this means I can not do `childComponent.update()` because I don't know the root element of child component, since I did not mount it explicitly myself.

I mean technically because of the lit-html optimizations, I can do `.update()` on myDialog (the parent component) after any child component's props changes, and it will only re-render what is necessary... but let's say my child component has like 1000 cards... it seems very wasteful and it would be ideal if I could re-render only the child.

I wonder if there is a trick to get around that with just lit-html?

AltruisticGapHN··on VanillaJSX.com
Have you looked into lit-html?

Coming from Vue I was really surprised it does a lot of what Vue templating does, including attaching events, with just vanilla JS templates. And when you use VSCode lit extension, you get syntax highlighting and full type checking inside the templates.

I learned about lit-html after a tweet from Marc Grabanski, where he said he used lit-html with vanillajs, not Lit.

After some experimenting I found it works great and it seems like you are trying to solve something very similar.

When you use the lit-html template package you can do basically evetything that is described in the Templates chapter

https://lit.dev/docs/templates/overview/

... without all the other abstraction of components that are part of lit-element.

https://lit.dev/docs/libraries/standalone-templates/#renderi...

AltruisticGapHN··on A most profound video game: a good cognitive aid for research
If you replace "WALL" "IS" "STOP" with icons/images, it's not that interesting anymore imho.

At the very least, Captain Blood would come to mind.

https://www.abandonware-france.org/ltf_abandon/ltf_galeries....

You have sequences of symbols, with attached mechanics. Arrange the blocks in different order, to get different outcomes.

Maybe I'm just grumpy today, I don't see how the game is "profound".

edit: I guess what I have in mind is if anything, the fact we can create meaning out of any collection of symbols, and decide waht it means, shows that language is really empty and intelligence is completely outside of language. Language is just a tool.

AltruisticGapHN··on London–Calcutta Bus Service
Bah I wouldn't be surprised it is actually safer today. Problem is today there are far, far more rules and regulations.
AltruisticGapHN··on London–Calcutta Bus Service
A damn shame such a cool article has no photos.
AltruisticGapHN··on Vulkan1.3 on the M1 in one month
And I think the point is they will then be able to support DXVK to run Direct3D games.
AltruisticGapHN··on Vulkan1.3 on the M1 in one month
I don't get it. They already make a ton of money on mobile games - why not embrace Steam and Proton on their platform? What's the money in AAA games on their platform?

edit: this is to say if they had "wet dreams" about selling AAA games on Mac, we'd have seen the tides moving a long time ago.

AltruisticGapHN··on Vulkan1.3 on the M1 in one month
Pretty much, Asahi Linux could become the new Bootcamp for Mac users who dual booted to play games.

FWIW I played Diablo II Resurrected on a M1 with "Whiskey". I was quite impressed that I was able to play a native Windows game just like that. It doesn't work anymore just because a stupid Blizzard launcher update now crashes and prevents starting the game.

I also ran EverQuest II admittedly an old DX9 game but still the game ran beautifully on a M1 mac mini at 1440p.

Linux Asahi may help also with older x32 titles like Guild Wars.

AltruisticGapHN··on Old dogs, new CSS tricks
Who cares when Sass works so well and this is just a subset of what sass does.

Maybe in 10 years time we’ll finally get to what sass can already do today.

AltruisticGapHN··on More transparent than glass, new material cools rooms and self-cleans
Was confused by this as well.
AltruisticGapHN··on Old dogs, new CSS tricks
CSS is becoming too complex. The syntax looks like it wants to be output by some compiler instead of being crafted by hand. Personally I also don't have any pleasure anymore writing CSS these days.

Sass and BEM methodology works fantastically well. Naming things isn't that hard, but Tailwind/utility approach is also extremely useful.

Those new features, besides container queries is just gibberish. Layer? WTF? The cascade is bad enough as it is, most devs can't even deal with the cascade it's why Tailwind become so popular. And we should dive even deeper into the cascade BS with layers and scoping and whatnpt? Again, this all looks like it was made to be output by some CSS compilers, not written by a developer.

AltruisticGapHN··on What's New in Neovim 0.10
Is there a modern equivalent of MacVim on Linux ? Gvim is OK though the Ux (tabs etc) looks dated.
AltruisticGapHN··on Sound-suppressing silk can create quiet spaces
À quieter world would be life changing. It’s incredible how low tech we are in regard to sound.
AltruisticGapHN··on Htmx and the Rule of Least Power
There’s WebAwesome now too by the devs of FontAwesome.
AltruisticGapHN··on Htmx and the Rule of Least Power
Genuine question, anyone knows the "bootup" time when you load a page? I imagine htmx "engine" needs to find all the elements on the page with hx- prefix. Is this fast?
AltruisticGapHN··on Htmx and the Rule of Least Power
> Similarly, CSS is a declarative styling language that is easily analyzed

Those were the days... now you need a bible on CSS.

← PreviousPage 2 of 9Next →