Hacker News with Generative AI: Best Practices

Code reviews: A success story (blogsystem5.substack.com)
Code reviews have a bad rap: they are antagonistic in nature and, sometimes, pure red tape. Some argue that they are bad practice; others say that peer programming is better. And while these may be true, I want to tell you a story about a case where code reviews worked well!
Be Aware of the Makefile Effect (yossarian.net)
Six Sins of Platform Teams (serce.me)
Systems ideas that sound good but almost never work (learningbyshipping.com)
Some engineering patterns that sound good but almost never work as intended
Database mocks are not worth it (shayon.dev)
It’s tempting to rely on mocks for database calls. Mocking is faster and often feels more straightforward. However, testing against a real database uncovers hidden pitfalls that can appear as the application matures. Issues like unique constraint violations, default value handling, or even performance bottlenecks may only surface when the code is exercised against actual data.
State of the Art Python in 2024 (4zm.org)
Software development is about making choices. But available options change and so do the tradeoffs. Are you up to date with the best practices for creating a Python application in 2024? Let’s take a look at some great default choices.
Test Accounts: A Hidden Risk (cacm.acm.org)
When it comes to the fundamental principle of never testing in production, nearly every software engineer is guilty of breaking that rule at some point in their career. But this is not just a best practice. It is a keystone value meant to protect your reputation, your customers, and your sanity.
15 Times to use AI, and 5 Not to (oneusefulthing.org)
There are several types of work where AI can be particularly useful, given the current capabilities and limitations of LLMs. Though this list is based in science, it draws even more from experience. Like any form of wisdom, using AI well requires holding opposing ideas in mind: it can be transformative yet must be approached with skepticism, powerful yet prone to subtle failures, essential for some tasks yet actively harmful for others.
The Rules of Programming (2023) (therulesofprogramming.com)
The Rules of Programming were born of exasperation.
Refactoring in C++: Top Techniques and Best Practices (jetbrains.com)
Whether you’re a seasoned C++ developer or just starting out, refactoring is a key way you can make your code cleaner, more efficient, and easier to maintain.
Yet Another List of Random Opinions on Writing Readable Code and Other Rants (lucavall.in)
After more than a decade of writing software, I've read lots of opinions on how to write good software. Everyone loves to throw around rules and principles, so I'll do it too. Writing readable code is about making life easier for the people who have to deal with it later - not about flexing your cleverness or following trends that sound smart on social networks.
Codin' Dirty (htmx.org)
“Writing clean code is what you must do in order to call yourself a professional. There is no reasonable excuse for doing anything less than your best.” Clean Code
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.