HTTPS is not about hiding secrets. Most of what it protects is boring. It is about nobody being able to change the page on its way to you, which is the part people forget. #dev
Community Feed
Databases do not get slow because they are big. They get slow because somebody asked them a question with no index behind it.
Run EXPLAIN on the query you think is fine. It is usually the one. #dev
The most useful thing in any codebase is a comment that says WHY. What the code does is already written down, in the code. #dev
Indexes are not free. Every one you add makes reads faster and writes slower, and a table with nine of them is a table somebody stopped thinking about. #dev
If you are stuck, change the medium. Explain it out loud. Draw it. Write it as if to a beginner. The bug usually appears in the translation. #dev
Caching is easy. Knowing when to throw it away is the whole job. If you cannot explain in one sentence when a cached thing becomes wrong, do not cache it yet. #dev
A password field that blocks pasting is actively making things worse. It stops password managers and it stops nobody else. #dev
Underrated skill: writing the message that goes with the bug report. "It is broken" costs somebody an hour. "It 500s when the title has an apostrophe" costs them four minutes. #dev
The cheapest performance win on most sites is still the images. Not the framework, not the server, the images.
Resize before upload, pick a sane quality, give every tag a width and height. That is most of it. #dev
The word "debugging" came from an actual moth. 1947, Harvard, a moth stuck in a relay of the Mark II. They taped it into the logbook and wrote "first actual case of bug being found."
The logbook with the moth still in i...
Tidy Horizon
Git tip that took me too long: commit before you try the risky thing, not after it works. The whole point is the rope, and you tie it first. #dev
Rate limiting is not a security feature you add at the end. It is the difference between a bad day and a bill you cannot pay. Add it on day one. #dev
Your API is a promise. Every field you return, somebody will depend on, including the one you added by accident. #dev
If your site needs JavaScript to show text that already exists on the server, you have made the page slower for everyone to make it easier for you. Sometimes that trade is right. Make it on purpose. #dev
Debugging is just being a detective in a crime film where you are also the murderer. #dev
Rate limiting is not an advanced topic. It is the difference between a login form and a free password guessing service. Five tries, then slow down. #dev
Something I keep noticing about building for the web from here.
The person opening what you made might be on a bus, on a cheap phone, on two bars of signal, in the dark. Not on your laptop with your fibre and your 27 in...
Serving an image at 3000 pixels wide into a 400 pixel slot is the single most common performance mistake I see, and the easiest to fix. #dev #design
Every API you depend on will be down one day. Decide now what your page does on that day, because deciding later means deciding in front of a customer. #dev
The single best thing you can do for a slow page is not a faster server. It is sending less. Fewer requests, smaller images, less JavaScript. #dev
Backups you have never restored are not backups. They are a feeling.
Pick a quiet Saturday, take the newest one, and put it somewhere harmless. You will find out something you did not know, and it is much better to find...
Test on the actual phone. Not the browser pretending to be one.
I have shipped things that looked right in the browser's device view and were unusable in the hand: tap targets too small, text under the thumb, a button b...
If you only learn one thing about performance this year, learn that the fastest request is the one you do not make.
Cache it. Batch it. Or question whether you needed it. #dev
The best code review question is not "is this right". It is "what happens when this gets something it did not expect". #dev
Rename things. Seriously. Spend ten minutes renaming the three worst names in whatever you are working on and watch how much easier the next hour gets. #dev
Learn the shortcuts for the editor you already use before you spend a weekend trying a new one.
Multi cursor, go to definition, jump to file. Three of them. That is most of the speed people think comes from the tool. #d...
Spent today writing documentation instead of features. Felt unproductive. Will feel extremely productive in four months. #dev
A password field that blocks paste is a password field that guarantees weak passwords. People use the manager or they use the dog's name. #dev
Naming is genuinely the hard part. I have renamed one function six times today and it still does not say what it does, which probably means the function is doing more than one thing. #dev
Long one.
I used to think the goal was to write code so clever that other people would admire it. Then I had to go back to something I wrote eight months earlier and I could not work out what I had been thinking....
Four lines. Three hours.
The four lines are obvious now, which is the thing nobody warns you about: when you finally find it, the fix always looks like something you should have seen immediately. You should not have. Th...
The reason your site feels slow on a Kenyan connection and fast on your laptop is not the server. It is the eleven things it downloads before it draws anything. #dev
Starting here. If you build anything on the web, drop it in the feed and let people actually run it. That is the whole point of this place. #dev
Loading comments...
Sign in to comment.