HNHacker News
TopNewBestAskShowJobs

oxidant

173 karma · joined February 18, 2024

submissionscomments
oxidant··on Claude Code: Best practices for agentic coding
The grandparent is talking about how to control cost by focusing the tool. My response was to a comment about how that takes too much thinking.

If you give a junior an overly broad prompt, they are going to have to do a ton of searching and reading to find out what they need to do. If you give them specific instructions, including files, they are more likely to get it right.

I never said they were replacements. At best, they're tools that are incredibly effective when used on the correct type of problem with the right type of prompt.

oxidant··on Claude Code: Best practices for agentic coding
Multiple terminal sessions. Well written prompts and CLAUDE.md files.

I like to start by describing the problem and having it do research into what it should do, writing to a markdown file, then get it to implement the changes. You can keep tabs on a few different tasks at a time and you don't need to approve Yolo mode for writes, to keep the cost down and the model going wild.

oxidant··on Claude Code: Best practices for agentic coding
Think about what you would do in an unfamiliar project with no context and the ticket

"please fix the authorization bug in /api/users/:id".

You'd start by grepping the code base and trying to understand it.

Compare that to, "fix the permission in src/controllers/users.ts in the function `getById`. We need to check the user in the JWT is the same user that is being requested"

oxidant··on GitHub Copilot Pro+
The licenses for the Microsoft extensions explicity don't let you use them in non-MS editors. They seem to be cracking down now.

To be fair, Copilot came before Cursor and the "agent mode" isn't a Cursor specific feature.

I use Cursor every day but I'm more than happy to switch if a better tool exists.

oxidant··on Show HN: Nue – Apps lighter than a React button
Spreading arrays and objects is such a common performance hit. It works fine for small instances but falls over in large instances.

Here's the JS CRM engine https://github.com/nuejs/nue/blob/master/packages/examples/s...

I see a number of issues, but don't have time to look into them.

1. Spreading when you probably don't need a copy: sortEntries. Sorting is probably where the overflow happens. Just sort in place or use Array.from or slice.

2. Excessive use of array functions. In my experience, a C style for loop performs better when you need performance. Create an empty array before, perform your business logic inside the block, and push to the array.

3. I don't know how filter is called, but it potentially loops through all of the events three times in the worst case.

4. paginate manually creates a JSON string from the returned entries. I don't know why, it seems inefficient.

oxidant··on You should know this before choosing Next.js
WordPress, despite all of the current drama, is an example of an open source project with many different competitors and development seems to move just fine.

Creating an artificial moat and misrepresenting capabilities, as outlined in the article, may bring value to Vercel, but it can hurt consumer confidence. I would not and have not chosen Next for projects because of the lock in.

oxidant··on Show HN: We made an MCP server so Cursor can debug Node.js on its own
You're off by three orders of magnitude. 3k lines. You also don't know what the wrapper does.
oxidant··on AI Thinks It Cracked Kryptos. The Artist Behind It Says No Chance
I've had similar issues and the trick I've found is to jump to Google/SO to find examples or docs as soon as Claude stops making progress.

If you got NullValueHandling, jumping to the library documentation would give you immediate accurate results.

oxidant··on Launch HN: Roark (YC W25) – Taking the pain out of voice AI testing
Your post suggests authorization as a feature:

> For each replay that we run, Roark checks if the agent follows key flows (e.g. verifying identity before sharing account details)

I don't know if AI will be more susceptible or less susceptible to phishing than humans, but this feels like a bad practice.

oxidant··on Some terminal frustrations
Wonderful, thank you. I've already cut my typing in half with rg, I'm ready to commit to another 50%
oxidant··on Some terminal frustrations
`find` comes to mind. I consistently need to look up the syntax.
oxidant··on Goose: An open-source, extensible AI agent that goes beyond code suggestions
Cursor + Sonnet has been great for scaffolding tests.

I'll stub out tests (just a name and `assert true`) and have it fill them in. It usually gets them wrong, but I can fix one and then have it update the rest to match.

Not perfect, but beats writing all the tests myself.

oxidant··on Have Gemini stage and write commit messages for you
> The product why belongs in a linked issue that describes the bug or use case in full detail.

That's nice until you switch git hosts or project management systems and the context is lost. Commits live forever, use them.

At least a small summary of "why" would've been so helpful many times in the legacy codebase I maintain instead of "fix tests", "format", "FOO-123"

oxidant··on Can you complete the Oregon Trail if you wait at a river for 14272 years?
I think you take the wagons apart and put them on a ~boat~ edit: was it a raft? In this context, "Float them down" doesn't refer to the wagons floating by their own bouancy, but rather their position atop the water.
oxidant··on I wrote a Game Boy Advance game in Zig
This was an interesting read, thanks.

One nit on mobile (Firefox and Chrome, Android), your code blocks overflow the background instead of scrolling.

oxidant··on Bench accounting services shutting down
I used Bench in the past and they partnered with Taxfyle up until ~November 2023 (date of the email I received stating the partnership was ending).

The service was fine, interesting that their relationship ended just over a year ago.

oxidant··on Cognitive load is what matters
Javascript doesn't, AFAIK. I work in Elixir, which doesn't.

I'm for it if it's possible but it can still make it harder to follow.

oxidant··on Cognitive load is what matters
Then you need to make those functions public, when the goal is to keep them private and unusable outside of the parent function.

Sometimes it's easy to write multiple named functions, but I've found debugging functions can be more difficult when the interactions of the sub functions contribute to a bug.

Why jump back and forth between sections of a module when I could've read the 10 lines in context together?

oxidant··on How do you do, fellow web developers? A growing disconnect
Preserve log is still helpful for SPAs when you want to compare requests across full app loads.
oxidant··on Ask HN: What hacks/tips do you use to make AI work better for you?
Not OP, but I believe Clojure has a REPL that lets you run and edit code, persisting the changes from the REPL.

Off the top of my head you would want a Dockerfile with the version of Clojure you're working in, a mounted volume for sharing between host/container data. My guess is the two different things they mentioned are dependency sources.

LLMs require a -fu, similar to the Googlefu of old, to get what you want out of them.

oxidant··on Ask HN: What hacks/tips do you use to make AI work better for you?
This isn't a knock on you. The prompt (including additional context like specific examples/docs) has an incredible influence on the output.

Do you know what your friend asked? "Query an API with SQL" sounds like you're sending SQL with POST api[.]com/query. What you built is more like

"Make a request to this endpoint, using these parameters, and store it in sqlite. This is the shape of the data coming back and this is what I want the table(s) to look like."

Gpt4o or Claude could easily write that five line script, if given the right information.

I find writing prompts and working with LLMs to be an entirely new way of thinking. My struggle has been to learn how to write out my tacit knowledge and be comfortable iterating.

Do you still have your conversation where you tried to build the Docker project?

oxidant··on Cooking with black plastic is particularly crucial to avoid
I've had my share of non-stick pans, including higher quality ones. They all degrade to the point where I need to use oil.

I switched to carbon steel as a daily driver two years ago and it is is trivialy non-stick with a little maintenance. The non-stick properties are infinitely refresha le, unlike "non-stick" pans.

I also have cast iron and stainless pans for other uses.

oxidant··on Jujutsu (jj), a Git compatible VCS
`git add .`, `git commit -m "wip: some note about what I was doing"

Then checkout the new branch and do my work.

When I come back, `git reset --soft HEAD^`, and continue

oxidant··on Stop Ignoring Your High Performers
This article[0] about tech debt was posted the other day on HN. It seems to be a good guide for how to determine what type of tech debt to take on.

Exactly what you're saying - does this tech debt Work™ or is it affecting future development or causing incidents?

[0] https://technology.riotgames.com/news/taxonomy-tech-debt

oxidant··on Working from home is powering productivity
"gay" in that sense is a pejorative against homosexual people. You could almost make it work with the original definition though.

From Wikipedia -

> Gay is a term that primarily refers to a homosexual person or the trait of being homosexual. The term originally meant 'carefree', 'cheerful', or 'bright and showy'.

oxidant··on Working from home is powering productivity
Not OP, but less than a dollar for a great espresso that I don't have to wait in line or walk further than 100 feet for is practically free, especially considering the opportunity cost of the time it would take me to walk to the cafe at the office.
oxidant··on Sanding UI
Put the input inside the label and still use "for" on the label. No way to test right now but that's what I usually do.
oxidant··on Why Not Comments
I mostly like a comment with a succinct explanation and a longer commit message. Comments are less likely to be refactored and lose the immediate git blame, while the function might change over time.

Ideally the future user would trace the git blame back to the original commit of they really had questions.

A long comment is really helpful sometimes though. I like to put ascii truth tables for complex boolean logic, both to ensure I cover all cases when writing the code (tests, too) and to make it easier for future me to understand what's going on at a glance.

oxidant··on Inside the "3 billion people" national public data breach
I'm not sure. There are 64 bases. Probably quantum proof.
oxidant··on Porffor: A from-scratch experimental ahead-of-time JS engine
This narrowing is probably not the best. I'm not sure why the TS docs suggest this approach. You should really check the type of the key to be safer, though it's still not perfect.

   if (typeof animal.swim === 'function') {....}
← PreviousPage 2 of 3Next →