Tips (beta)
Short things you learn by losing afternoons. Ours, and whatever people send in.
With your agent
- Tell it what not to touch. With no fences it rewrites half your codebase to fix one button.
- "It should work" is not "it works".
- Do not let it summarise the test run. Ask for the raw command output, exactly as it came out.
- Three failed tries in a row are not fixed by a fourth. They are fixed by reframing the problem.
- If it hands you code without saying why, you cannot tell whether it chose that or just went first-thing-first.
- Have it show the diff before applying it. Accepting blind is exactly the same as not reviewing.
- Tell it what the thing is for, not just what you want. An agent that knows the why gets it right far more often.
- One task per conversation. Once the thread fills with old attempts, it drags its own mistakes along as if they were facts.
- When it says "fixed", go look yourself. That is the sentence that most often turns out to be accidentally false.
Craft
- If you need a comment to say what a variable holds, the name is the thing that is wrong.
- The line that matters in an error is almost never the first one. Read it all before touching anything.
- Deleting code is progress.
- Do not leave dead code commented out just in case. That is what git is for.
- If you cannot explain it out loud, you have not understood it yet.
- Code gets read far more often than it gets written. Optimise for whoever reads it.
- Before fixing a bug, make it happen on demand. What you cannot trigger, you cannot prove you fixed.
- Change one thing, then test. Two at once and you no longer know which one did it.
- When something "makes no sense", the bug is almost always yours, not the language's.
- A function that needs the word "and" to explain itself is doing two things.
Git
- One change, one commit. When something breaks you will want to know which of the seven did it.
- The message says why. The what is already in the diff.
git add -pmakes you look at what you are staging, chunk by chunk. Never another stray file.- Before a force push, breathe and check which branch you are on.
- When something works, commit it. Even half-done. Being able to go back beats a pretty history.
- A pushed key is already public, even if you delete the commit. Rotate it, do not hide it.
Getting started
- Finish something ugly before starting something pretty.
- Hopping to another language is not progress: it is starting over under a new name.
- A tutorial that does not end in something of your own does not count as learning.
- If you have been stuck for two hours, the problem is no longer technical. Get up.
- Copying is fine. Copying without understanding is what strands you at the next bug.
- Pick a project you actually care about. It is the only thing that brings you back on a Tuesday night.
- The basics are boring because they work. What shines in a video is rarely what you use every day.
Web design
- Animate
transformandopacity. Anything else forces a relayout every frame, and that is where your 60fps go. - If your text lives inside a little rounded box, ask yourself what the box is doing.
- Before picking the palette, check it can be read. A pretty unreadable grey is still unreadable.
- Mobile first really means opening it on a phone, not shrinking the desktop window.
- If your page needs JavaScript to show a paragraph, something went sideways along the way.
- Every font you load is blank time for whoever lands. Two weights are usually enough.