Hacker News with Generative AI: Best Practices

Graceful Shutdown in Go: Practical Patterns (victoriametrics.com)
Settling the File Structure Debate (muhammedsari.me)
Everyone has an opinion about how to organize your files: some swear by grouping by type, others by domain. Today, we're skipping the endless arguing and getting straight to a real-world example that shows why structure matters and how you can pick the right one for the long haul.
Claude Code: Best practices for agentic coding (anthropic.com)
Claude Code is a command line tool for agentic coding. This post covers tips and tricks that have proven effective for using Claude Code across various codebases, languages, and environments.
UI tip: maybe don't round percentages to 0% or 100% (evanhahn.com)
In short: maybe don’t round to 0% or 100% in your UI.
N-Params vs. Single Param (carlos-menezes.com)
When writing functions in TypeScript (and, truthfully, any language that does not support named parameters), you either pass arguments individually (n params) or group them into a single object.
12-factor Agents: Patterns of reliable LLM applications (github.com/humanlayer)
What are the principles we can use to build LLM-powered software that is actually good enough to put in the hands of production customers?
Ask HN: What is the best font and styling combo for readability on the web? (ycombinator.com)
As I read HN I often come across personal blogs / websites that look great and are visually easy to read, but I change my mind on what is "best" all the time.
Ten Commandments of Go (bitfieldconsulting.com)
As a full-time Go teacher and writer, I spend a lot of time working with students to help them write clearer, better, and more useful Go programs. I’ve found that a lot of the advice I give them can be reduced to a fairly small set of general principles, and here they are.
How to write a Git commit message (2014) (cbea.ms)
Commit messages matter. Here's how to write them well.
Software engineering laws (manager.dev)
Some of those are famous, and some are quite niche. ALL of them are super useful to engineers and managers.
Make C string literals const? (wordpress.com)
Martin Uecker has started a new initiative to ensure a better const contract for C2y: change the type of string literals to a const-qualified base type, much as it is already the case in C++. Compilers support this since a very long time; some of them have this as default, some provide command line switches for that model.
Configuration Complexity Clock (2012) (blogspot.com)
When I was a young coder, just starting out in the big scary world of enterprise software, an older, far more experienced chap gave me a stern warning about hard coding values in my software. “They will have to change at some point, and you don’t want to recompile and redeploy your application just to change the VAT tax rate.” I took this advice to heart and soon every value that my application needed was loaded from a huge .ini file.
Software Engineering Laws (manager.dev)
Some of those are famous, and some are quite niche. ALL of them are super useful to engineers and managers.
John Ousterhout and Robert Martin Follow-Up to Aposd vs. Clean Code [video] (youtube.com)
The right way to do data fixtures in Go (brandur.org)
Every test suite should start early in building a strong convention to generate data fixtures. If it doesn’t, data fixtures will still emerge (they’re that necessary), but in a way that’s poorly designed, with no API (or a poorly designed one), and not standardized.
Safe Shell String Interpolation (samwing.dev)
Let's take the toy problem of getting the user's name and printing out a rainbow greeting banner. An inexperienced developer might solve the problem like this:
Handling billions of invocations – best practices from AWS Lambda (amazon.com)
AWS Lambda is a highly scalable and resilient serverless compute service. With over 1.5 million monthly active customers and tens of trillions of invocations processed, scalability and reliability are two of the most important service tenets. This post provides recommendations and insights for implementing highly distributed applications based on the Lambda service team’s experience building its robust asynchronous event processing system. It dives into challenges you might face, solution techniques, and best practices for handling noisy neighbors.
Practical Process Control: Methods and Best Practices for Automatic PID Control (controlguru.com)
Idiomatic Rust (a-i-nstein.neocities.org)
Discover the beauty of idiomatic Rust, one example at a time
How Best Practices Became the Industry's Most Dangerous Religion (medium.com)
In 2007, I deleted a 40,000-line Java enterprise project and rebuilt it in PHP4. My colleagues acted like I’d sacrificed a goat in the server room. “Best practices!” they cried. “Maintainability!” they warned. Three months later, we shipped early. The system ran flawlessly for a decade.
Ask HN: Is Clean Code a waste of time? (ycombinator.com)
Ask HN: Is Clean Code a waste of time?
The Ten Commandments of Go (bitfieldconsulting.com)
As a full-time Go teacher and writer, I spend a lot of time working with students to help them write clearer, better, and more useful Go programs. I’ve found that a lot of the advice I give them can be reduced to a fairly small set of general principles, and here they are.
API design note: Beware of adding an "Other" enum value (microsoft.com)
Consider the following API:
How Core Git Developers Configure Git (gitbutler.com)
What `git config` settings should be defaults by now? Here are some settings that even the core developers change.
How core Git developers configure Git (gitbutler.com)
What `git config` settings should be defaults by now? Here are some settings that even the core developers change.
Excellent Pull Request Reviews (michaelheap.com)
Pull request reviews are a critical part of building high-quality products, but too often, they become a rubber-stamping exercise—skim, “LGTM,” approve. This kind of review can lead to broken code, unclear documentation, and missed opportunities for improvement.
Ask HN: What commit message conventions do you follow? (ycombinator.com)
I'm new to the world of programming and came to know about commit conventions. Just wanted to know what conventions do you use.
Are libraries always the best choice in secure development? (ycombinator.com)
I attended a secure development course where the instructor insisted on always using third-party libraries.
The "late‐binding closure" pitfall in Python (notion.site)
Prefer tee -a, not >>, in CI (huonw.github.io)
Shell scripts sometimes have to append data to a file. Redirecting output with >> is the conventional way and works fine, but using tee -a instead is a usually better default, especially in continuous integration. It’s just as easy and gives automatic introspection: the same value is printed to stdout and so appears in normal logs too.