Hacker News with Generative AI: Best Practices

Ask HN: Best practices using AI as an experienced web dev (ycombinator.com)
As an Old, I came up learning the OG web dev languages - HTML, CSS, JS, PHP, etc. As a solo dev, I still largely work with these as natively as possible. But I am not a total dinosaur. I embraced jQuery in the early 2000's, Bootstrap scaffolding, and now often build reactive UI's using Vue 3.
My Modern CSS Reset (jakelazaroff.com)
How many of us start every web project by copy-and-pasting Eric Meyer’s famous CSS reset?
Lessons learned from a successful Rust rewrite (gaultier.github.io)
I have written about my on-going rewrite-it-to-Rust effort at work: 1, 2, 3. And now it's finished. Let's have a look back at what worked, what didn't, and what can be done about it.
Mastering JavaScript Type Detection: Techniques and Best Practices (medium.com)
This guide dives deep into JavaScript type detection, demystifying how to accurately judge data types — a skill essential for coding precision and clean code. We’ll explore powerful methods, from basic typeof to the advanced instanceof, Array.isArray, and Object.prototype.toString.call. Each technique is carefully crafted to help you handle JavaScript data types efficiently and avoid common pitfalls. Here’s your toolkit for JavaScript type handling.
A Modern CSS Reset (2024 update) (joshwcomeau.com)
Whenever I start a new project, the first order of business is to sand down some of the rough edges in the CSS language. I do this with a functional set of custom baseline styles.
Developing with Docker (danielquinn.org)
You'd think that this topic would have been done to death, but given that every job I've started in the past 10+ years has used Docker differently (if at all) to varying degrees of success, I feel like we need some sense of consensus around how to Do This Right™. And, as someone with an ego the size of a small moon, I'm here to decide what's right... on my own blog anyway.
Don't use "click here" for link text (dont-click-here.com)
Never link the words “click here”. Or “here” or “this”.
__init__.py files are optional. Here's why you should still use them (bovenberg.net)
If you’ve ever googled the question “Why do Python packages have empty __init__.py files?”, you could get the idea that Python packages wouldn’t work without them. This is a common misconception—they’ve been optional since Python 3.3! Why then, do most Python projects still have them?
How I use git (thorstenball.com)
Recently I tried to explain to a colleague my mental model for when to put something in the same pull request and when not to. I caught myself saying “well, except…” a few times, I decided to write down how I use git — to examine my idiosyncracies, see where I could improve, and possibly share something useful.
How I Use Git (thorstenball.com)
Recently I tried to explain to a colleague my mental model for when to put something in the same pull request and when not to. I caught myself saying “well, except…” a few times, I decided to write down how I use git — to examine my idiosyncracies, see where I could improve, and possibly share something useful.
A dictionary of single-letter variable names (jackkelly.name)
Haskell’s expressive type system means that type signatures can carry a lot of information. Haskell’s polymorphism means that you sometime write a function that works across an enormous range of types, and are often left wondering “what do I actually call my variables?”. It is often the case that there’s nothing to say beyond “this variable is a Functor”, or “this variable is a monadic action”, and so a single-letter variable name is appropriate.
The Ultimate Guide to Error Handling in Python (miguelgrinberg.com)
I often come across developers who know the mechanics of Python error handling well, yet when I review their code I find it to be far from good.
A popular but wrong way to convert a string to uppercase or lowercase (microsoft.com)
It seems that a popular way of converting a string to uppercase or lowercase is to do it letter by letter.
Do not use secrets in environment variables (nodejs-security.com)
We developers are well too fond of using environment variables to set application configuration and often use it to store secrets and other sensitive information.
The importance of local development (fastpaced.com)
Local development is crucial for efficient software development, it enables faster iteration, better debugging and ensures consistency between local and production environments.
Avoiding downtime: modern alternatives to outdated certificate pinning practices (cloudflare.com)
In today’s world, technology is quickly evolving and some practices that were once considered the gold standard are quickly becoming outdated.
What was the point of [ "x$var" = "xval" ]? (2021) (vidarholen.net)
In shell scripting you sometimes come across comparisons where each value is prefixed with "x". Here are some examples from GitHub:
The Hitchhiker's Guide to Python (python-guide.org)
This opinionated guide exists to provide both novice and expert Python developers a best practice handbook to the installation, configuration, and usage of Python on a daily basis.
Debugging Like It's 2025, How the Best Engineers Solve Problems with Ease (twitter.com)
Why I avoid using empty() in PHP? A Closer Look (medium.com)
One of the most useful yet widely misunderstood functions in PHP is empty(). At first glance, empty() seems like a handy shortcut for checking if a variable is, well, empty. However, its behavior goes beyond the obvious. According to the PHP documentation, empty() considers the following values as "empty":
Techniques I use to create a great user experience for shell scripts (nochlin.com)
"You should go and check out the shell script in the repo because it's very nice. It has colored output, it's super safe... it's really a masterclass in terms of writing shell scripts."
On over-engineering; finding the right balance (16elt.com)
A big debate among developers is whether to write code for today’s problem or to build a general-purpose solution for future needs. Both approaches have their pros and cons. Specific-purpose code can quickly become messy. But overly general code can add unnecessary complexity. This post, obviously opinionated, argues for a middle ground. That’s the sweet spot, as always.
Don't defer Close() on writable files (2017) (joeshaw.org)
But this idiom is actually harmful for writable files because deferring a function call ignores its return value, and the `Close()` method can return errors. **For writable files, Go programmers should avoid the `defer` idiom or very infrequent, maddening bugs will occur.**
How Postgres Is Misused and Abused in the Wild (blogspot.com)
Show HN: Best Practices for Using Structured Output from LLMs (instill.tech)
Updating Twelve-Factor: A Call for Participation (heroku.com)
Enterprise Incident Management: Best Practices for Large Organizations (rootly.com)
Effective Changelogs (xavd.id)
Ask HN: What do you monitor on your servers? (ycombinator.com)
Once more about the rule of 5 (sandordargo.com)