# Cookie warnings and comment rot
If you ever hear someone complain about EU "cookie law" that forces
websites to announce and obtain consent for using cookies, on the
basis that there are perfectly legitimate uses for cookies other
than behavior tracking, for example to provide basic login
functionality, I suggest referring them to the actual directive
(Directive 2009/136/EC):
> Exceptions to the obligation to provide information and offer the
> right to refuse should be limited to those situations where the
> technical storage or access is strictly necessary for the
> legitimate purpose of enabling the use of a specific service
> explicitly requested by the subscriber or user.
If a website informs you that they use cookies "to improve your
experience" or anything to that effect, they're weaseling, because
if their use of cookies was legitimate (by this rather generous
definition) they'd be under no obligation to announce it. I suggest
disabling cookies altogether and whitelisting first party cookies
only for sites you trust, because some sites take the announcement
banner as implied consent ("By using this site you bla bla..."). Few
websites actually need cookies and will work just fine when they are
disabled.
--------------------------------------------------------------------
The other thing I wanted to talk about is comment rot. It sucks when
the code changes and the comments turn incorrect for lack of
corresponding update. My idea for a solution is to have checksum
tagged comments that refer to a checksum of the logical unit of code
that immediately follow it or contains it. If the checksum doesn't
match the actual code, you need to update the tag, which hopefully
increases the chances of the rest of the comment receiving an
update.
Example:
```
// Returns the sum of a and b (sha1:8ef389c7976288a20978510156f1cfd9cc1d119e)
int sum(int a, int b) {
return a + b;
}
```
My first idea was for it to refer to a commit-ish git object. Unless
you are fine with writing your code in one commit and your comments
in another or tagging all your commits, that won't work as it
creates a chicken-and-egg problem by which changing the comment will
result in a different commit hash, which necessitates updating the
comment, which...
Tooling can verify that the checksum tags match the code and prevent
commits where they don't.
In the back of my head I keep thinking that this is just an
organizational problem, and that trying to address it with a
technological solution is the wrong approach, but the problem IME is
so prevalent that I think it warrants some experiments.
Anyway, it's late at night and I'm getting up for work in five hours
so this is probably a good time to hang up.