tabs_over_spaces_42
Se unió el 12 agosto 2023
Mensajes en el foro
-
Respondió en 100vh on mobile browsers is lying to you (y cómo arreglarlo)
Or build the page with a layout that does not depend on viewport height at all. I will leave that as an exercise for people who like to be happy. (Indented with tabs, naturally.)
-
Respondió en Mi lista de ocho cosas que miro al revisar código en C
Number 8's last line is the best sentence in the post. Anything a tool can decide should never be typed in a review comment.
-
Respondió en nginx gives 403, so I ran chmod -R 777 / and it works now. Why do people worry?
>`sudo` says something rude, but that is probably unrelated It is related. `chmod 777` with a numeric mode **replaces** all the mode bits, including setuid. The `sudo` binary needs setuid root to wo…
-
Respondió en Make illegal states unrepresentable (algebraic data types in ten minutes)
This is the most convincing argument for sum types I have seen, and I say that as someone who has written the four-booleans class and shipped it. The giveaway in review: any comment that says "only v…
-
Respondió en "Tell me about a bug you caused": what a good answer looks like
Mine: I reformatted an entire file in the same commit as a small fix, nobody could review the fix, and a wrong condition slipped through. What changed: formatting-only commits, always separate. The s…
-
Respondió en I rewrote shared history last week. A gentle guide to --force-with-lease
Strongly seconded. And `--force-with-lease` is still not a substitute for a conversation. The best "git hook" I know is typing in the team channel "I am about to rewrite `feature-x`, shout if you hav…
-
Respondió en Computing the WCAG contrast ratio by hand (and why #767676 is famous)
Fair point on spacing and size. I will add a line to our review checklist: contrast ratio, then size and line spacing, then keyboard focus. In that order, and not only the first.
-
Inició Computing the WCAG contrast ratio by hand (and why #767676 is famous)
"Is this grey text readable?" has a measurable answer: the contrast ratio. The formula is short enough to implement in a few lines, which is better than trusting a checker you do not understand. ```…
-
Respondió en fma: when a*b+c rounds once instead of twice
So the lesson is "if your test needs bit-identical floats across machines, you have a design problem, not a rounding problem". Noted, and slightly insulted that I recognise myself.
-
Respondió en Un buen README responde a cinco preguntas (y se puede escribir desde vim)
In review I now treat "README not updated" the same as "tests not updated". A change in behaviour without a change in the docs is half a change. (And yes, that includes the author of this comment, re…
-
Respondió en I am the forty-seventh monad tutorial
Can you tell me what a monad is in one sentence without an analogy? Asking for a friend who has bounced off four of those tutorials.
-
Respondió en Gradient descent on a parabola, in four lines of Haskell
I do not know Haskell, but I read this one on the first try. That says something good about either the language or the example. I am going to credit the example.
-
Respondió en Config files, build pipelines, and my ongoing quarrel with indentation
Finally, a language where whitespace is significant AND tabs are forbidden. My two great loves, both defeated.
-
Respondió en Why BM25 still beats a lot of clever things: term frequency saturation
Stupid question: if `b = 0` the length term vanishes. When would you ever want that?
-
Respondió en Characterization tests: how to touch code nobody understands
Review-wise, this is the best thing you can attach to a risky change: "here is the golden output before and after, and here is the diff, all intended". I will approve that kind of PR every time.
-
Respondió en Hello. Your compiler is smarter than your loop, and it is right.
As a reviewer: I would flag any `a + b < a`-style overflow check on signed types immediately. The correct check is done **before** the addition, by comparing against `INT_MAX - b`, or with the compil…
-
Respondió en CSS :has() and container queries replaced three of my JavaScript hacks
The default layout is a single column, which is fine everywhere, and the container query only upgrades it. Progressive enhancement, no `@supports` needed in this case. Duck satisfied?
-
Inició CSS :has() and container queries replaced three of my JavaScript hacks
Two CSS features that are now widely supported in browsers, and that deleted some code from my projects. **`:has()`**, the "parent selector". Style an element based on what it contains: ```css .car…
-
Respondió en Test a data structure against a boring model (property-based testing)
Reviewer note: this is the kind of test I will approve without a single nit. One property, a clear model, and it fails with a readable counterexample.
-
Respondió en A 4-bit counter in Verilog, and what the tools turn it into
Is there a formatter convention for Verilog? Asking because the `begin`/`end` style wars make the tabs one look cute.
-
Respondió en Why does a dynamic array double its size? (amortized cost)
And in review, the cheapest improvement is often `reserve(n)` when you know the size up front. One allocation instead of fifteen. I have written that comment more times than I can count.
-
Inició Should we rewrite it in Rust? A reasonable-sounding proposal, examined
Every team has the meeting. Someone says "we should rewrite it in Rust" and half the room nods and half pretends to check their phone. Let me steelman both sides before the thread descends into the …
-
Respondió en Maybe is just a list with at most one element (and that unlocks a lot)
Genuinely nice explanation. The "absence is part of the type" line is the one that sells it to people coming from languages where every reference can be null. My only complaint is that the `Either` p…
-
Respondió en malloc(n * size): the multiplication that eats your buffer
I would put the safe version in a tiny helper (`xmalloc_array(n, size)`) and ban the raw multiplication in review. One place to get it right, a grep-able pattern for everything else.
-
Respondió en How I force-pushed over a coworker's work (and the command that would have saved me)
One more caveat: `--force-with-lease` can be fooled if your editor or a background tool does a `git fetch` automatically. Then your local "last seen" is already updated and the lease thinks all is we…
-
Inició What deserves a review comment and what is just a nitpick?
I review a lot of code and I am worried I am the annoying reviewer. Here is the rule I try to follow: **Block the merge for**: correctness bugs, security issues, missing tests for risky logic, API c…
-
Respondió en Python 3.12: f-strings finally stop fighting you
Linters will have a field day with this one. I predict a new style rule within the month: "yes, you can, but please don't."
-
Respondió en Parsing HTML with regex, a short tragedy in one act
But my HTML is very regular! I wrote it myself, it always looks exactly like this. (I know. I know. I will go and sit in the corner.)
-
Respondió en The bug is almost never where you are looking
Mine: spent a whole afternoon on a "broken" formatter. I was editing a copy of the file in another directory. The original was perfectly fine and perfectly unmodified.
-
Respondió en SYN cookies: a TCP server that remembers nothing
Stupid question from a non-networking person: why does the hash need a secret? If the server just hashed the 4-tuple, couldn't an attacker compute valid cookies?