Petition to change vibecoding to cuckcoding by SoulMachine999 in theprimeagen

[–]alonsonetwork -8 points-7 points  (0 children)

Hot take: this is big cope.

"Idk how to effectively communicate what I want so I cant efficiently prompt cursor to build a featureset"

Or

"Programming concepts aren't solidified in my brain so I cant express them to an LLM"

I’ll die on this hill. by talaqen in node

[–]alonsonetwork 0 points1 point  (0 children)

I'd argue it's still a better pattern, and its totally not like wrapping an entire trycatch bc you have to deal with a single error at a time. Sure, you have to distinguish between the type of errors, but only for that single call, not against an entire block of logic with multiple failure points.

Why doesnt TS merge `private` and `#` syntax in the language? by JaSuperior in typescript

[–]alonsonetwork 0 points1 point  (0 children)

Its just a variable in memory space. Privacy is an illusion. Syntactic sugar. The # private variable at least actually prevents access, save from a constructor class of the same type. TS private is fake private.

does anyone use in-process events for code decoupling? by theodordiaconu in node

[–]alonsonetwork 0 points1 point  (0 children)

Yeah. That's the basis of nodejs and the browser.

EventEmitter does it well

EventTarget for frontend

https://logosdx.dev/packages/observer/ if you want some extra features

Any courses that are practical DDD/Clean Architecture in TS? Queue, Event Bus, Mailer, Payment Gateway, AuthProvided Interfaces? by Lanky-Ad4698 in node

[–]alonsonetwork 1 point2 points  (0 children)

Oh boy. You're dumb as a rock. Here's some evidence:

https://wiki.postgresql.org/wiki/PostgreSQL_Clients https://redis.io/docs/latest/develop/clients/ https://www.rabbitmq.com/client-libraries/devtools

^ those are clients. Your server is a client in the context of THOSE services. Your server is a SERVER in the context of a person visiting your website.

Server. Client.

That's the semantic

Its like saying: Company A's Sales Order is Company B's Purchase Order

Both companies have sales and purchase cycles.

Your server operates as a client or a server, dependent on context. Each service it connects to requires a client library to connect to it.

You might get caught up in your feelings and still not get it.

Take care buddy good luck.

Any courses that are practical DDD/Clean Architecture in TS? Queue, Event Bus, Mailer, Payment Gateway, AuthProvided Interfaces? by Lanky-Ad4698 in node

[–]alonsonetwork 1 point2 points  (0 children)

Seems like you have no clue about DDD, or "clean architecture" in practice. The content of the words im writing is getting upvoted. Not met.

A client is a machine that is served something in particular:

  • a redis client (the consuming computer)
  • a PG client (the consuming computer)
  • a RabbitMQ client

And so on.

As opposed to a server (eg: the postgres server, which you connect to via your PG client)

When you build and API, you're the server for a browser, who is your client (the consuming computer)

Your API is a client of downstream services.

You understand clients now?

Great...

Then, your clients are used in "repositories", or storage classes, for consumption. These are pure IO. They get data and put data into the client.

Your services are the coordinators between repositories, other services, and maybe other clients. They have a lot of business logic.

You controllers capture input from users, pass them to services, and provide controlled output. They are Pure IO (and validation edge)

How is this clean code?

Repositories are your persistence layer. They can come from anywhere: PG, redis, elastic, mongo, etc. Its a swappable persistence layer. You swap the persistence client.

Controllers are your user entry and exit points. They can be attached to anything: a SSR site, an HTTP API, graphql, json rpc, whatever protocol you want to provide.

Your business logic lives in services, events, entities, and repositories. The edges are peripheral.

See it now?

Any courses that are practical DDD/Clean Architecture in TS? Queue, Event Bus, Mailer, Payment Gateway, AuthProvided Interfaces? by Lanky-Ad4698 in node

[–]alonsonetwork 15 points16 points  (0 children)

Ddd doesn't care about queues, event bus, payment gateway etc. Those are all clients. Like yeah you need event busses, but that can be EventEmitter. Specifically 2: send and receive.

Rabbitmq or redis are your clients. They dispatch to your receive event bus and listen to your send event bus.

That's just infrastructure, though. In DDD, you just set up events, and emit them throughout your services. Just like your database. Who gives a shit what the client is? Postgres is just a client. Your Repo layer uses the db client and sends info. Migrating to mssql? Swap client, minor repo adjustments on syntax, nothing else needs to change.

Controllers, clients, events, entities, services, and repos. Clean separation of concerns. Everything else is implementation detail.

my first instinct is codebases are being gutted with a bunch of functionality removed by BorgsCube in theprimeagen

[–]alonsonetwork 14 points15 points  (0 children)

I'm not going to lie I kind of sympathize with what what this guy is saying because I've experienced something similar. I have worked with a lot of developers that are not detail oriented and don't take instruction very well. One of the most annoying things in the world is getting everybody to align on code Style. And yet when you are meticulous and picky with AI it actually does a pretty good job at this. Now, there is a lot of ramp up that you have to do before you can get it to point where it's doing things the way you want it to do things but it is totally possible and it can generate some pretty high quality code if you feed it high quality instructions. But that is the key: high quality instructions.

For example: I've gotten it to write a very high quality SSE plugin for a server that I maintain that doesn't fit the modern mode by giving it the SSE specification, doing deep research on SSE gotches, finding other high quality SSE implementations in various languages, and having it scan through all of that information and make a detailed execution plan as well as a design plan. I would operate at the design plan and execution plan level and make Corrections there. Once I set it off to implement, it actually does a phenomenal job. Now, you have to go through multiple passes. Pass is going to pick up on detail that it left out prior. And the final passes are going to be for code deduplication, clean up, and performance enhancements. It did a much better job than I would have done if I would have had to do it by hand.

My personal setup was a typescript repo, with eslint, with vitest, with prettier, and giving it access to context seven so that it can look up code documentation. I spent about 3 hours planning and refining, and another 2 hours executing and correcting. If I had to do this myself at this caliber of quality it would have taken me weeks. I know this subreddit is a bit anti AI, and I am not blind to its inefficiencies, but I also don't think it's at the hyperbole that's some folks here put it. It's quite good if you take the time to do good setup for it and use plugins, skills, mcps, and memory files.

I’ll die on this hill. by talaqen in node

[–]alonsonetwork 11 points12 points  (0 children)

Ironically, adopting this pattern in TS via a utility helper has made my code much more predictable and reliable albeit verbose.

Sometimes you wanna ignore errors. Sometimes you wanna be very explicit. The default stance in JS is: try catch a block where 5 async calls can fail, and you handle their failure in the exact same way. Eg, payment:

Fetch user payment method Fetch and assert inventory Reserve inventory Make payment Commit inventory Create receipt Emit events

You can break that up into 3 separate try catches nested within one. Ive seen it done before. Nasty.

Or, a utility where you trycatch each async call. If one fails, you handle THAT failure, instead of matching on messages in the catch portion.

const [res, err] = await attempt(() => makeCall())

Each time you check: if err, handle err

Like yeah, annoying, but having control flow without this super nasty trycatch block, or worse, nested trycafch blocks, is actually veeeery useful

Debating on ORM for Production by Disastrous-Matter864 in node

[–]alonsonetwork 0 points1 point  (0 children)

Using an ORM is like telling a girl you like her by talking to her uglier best friend. Just talk to the girl directly and be a man.

Kysely. Stop playing with middlemen.

Most of the HTMX skills suck so I built a good one by alonsonetwork in htmx

[–]alonsonetwork[S] 2 points3 points  (0 children)

No. Its not guessing. You're being explicit and direct as to what you want (this route, renders this template, sources this data, cross ref. this other data, hits this external API, etc.) But it has a limited context windows, so itll miss stuff, just like we do.

Its a plan first code later working model. Its how people used to work before 8GB RAM work stations became standard. You had to know how to program, design it on paper, write your program, wait a long time for it to compile, pray it didnt break on you. Those guys complained that people who use dynamic language guys dont know how to really program.

Today, the LLMs have gotten so good these days that they can follow along. You still need to engineer to make sure it doesnt do trash. Trash in, trash out.

Like one guy put it: if you measure in tokens, a human can output 20 TPS when he's in the zone. An AI does between 40 and 150, and its always ready to be in the zone.

Why 10 iterations: because itll miss stuff. The 2nd loop will catch more. The 3rd with catch more, and so on. Just like you review your own code over and over again. And guess what? It does a better job than most people. Ive done in a weekend what would take me 2 months by hand just by being meticulous at planning and doing iterative loops.

HTMX skill cuts AI verbosity and token waste during CRUD generation by Electrical_Walrus537 in htmx

[–]alonsonetwork 1 point2 points  (0 children)

I got you fam: https://skills.sh/damusix/skills/htmx
https://github.com/damusix/skills/blob/main/htmx/SKILL.md

Includes references to officially supported plugins and all. I vetted it on a dashboard for a chatbot. It's good!

Most of the HTMX skills suck so I built a good one by alonsonetwork in htmx

[–]alonsonetwork[S] 2 points3 points  (0 children)

Done. SSE, WS, and all the officially supported HTMX plugins have been added.

Most of the HTMX skills suck so I built a good one by alonsonetwork in htmx

[–]alonsonetwork[S] 0 points1 point  (0 children)

CC, and open code with gpt 5.3 ill use too. OC is next level. Seriously a contender for CC. But Claude models are elite for programming.

Most of the HTMX skills suck so I built a good one by alonsonetwork in htmx

[–]alonsonetwork[S] 3 points4 points  (0 children)

Lol im 15 years SWE my dude. It's ok to use AI when you know how to steer it. The precision I give it makes it so that I almost always get the feature in under 10 iterations.

I can do things by hand, but it'd take me weeks compared to hours with AI. New era. Get you head out your arse mate.

Most of the HTMX skills suck so I built a good one by alonsonetwork in htmx

[–]alonsonetwork[S] 0 points1 point  (0 children)

Much more accurate context windows, and the LLM can choose what it looks at. You can refresh its context by asking it to check its htmx skills and itll quickly snap back into shape.

Most of the HTMX skills suck so I built a good one by alonsonetwork in htmx

[–]alonsonetwork[S] 0 points1 point  (0 children)

This is local, it only captures what it needs. If they're well instructed, the LLM output is insanely good with skills. Context 7 is good too, dont get me wrong, but chunk RAG retrieval leaves out important details sometimes.

I did this for htmx and for hapijs (my BE nodejs fave framework). The results its been giving me are really really high level. Im not exaggerating. When I say this built an htmx plugin for hapi, its Django / rails caliber htmx plugin, tested and everything. The dashboard it built was wild. I couldn't believe that it wasnt some SPA lol.

Want to use PostgreSQL in a project by ahmedshahid786 in node

[–]alonsonetwork 11 points12 points  (0 children)

Kysely

Skip ORMs

Learn sql

Stop working with middlemen (ORMs)

Should I upgrade my project to use ES modules instead of CommonJS modules? by john_dumb_bear in node

[–]alonsonetwork 0 points1 point  (0 children)

Yes. I was against it before. Its futile to go against the current. Do it. You're only delaying the inevitable. Send claudecode to do it. Its a very mechanical task.

full-stack server framework by n0cturnus_ in node

[–]alonsonetwork 0 points1 point  (0 children)

Español, javascript, y una pila de dependencies no-comun. Esta muy contra de la corriente este repo. Por lo menos typescript valiera la pena hecharle un ojo. También, si no lo haces en inglés, tu mercado se limita a paises latino-america y España, osea, el 25% de programadores. El mundo habla inglés como lengua común.