HNHacker News
TopNewBestAskShowJobs

mjw_byrne

321 karma · joined February 17, 2016

submissionscomments
mjw_byrne··on Grindr to be fined almost €10M over GDPR complaint
Thanks, that makes sense.
mjw_byrne··on Grindr to be fined almost €10M over GDPR complaint
Right, so the article is talking about data sharing which isn't core to the service, that makes sense.
mjw_byrne··on Grindr to be fined almost €10M over GDPR complaint
I was a little surprised by this: "The DPA highlighted that users should have a real choice not to consent without any negative consequences."

Does this mean that it is unacceptable to run a service which requires consent to share data? That seems overly restrictive - where does that leave services in which sharing data is the whole point of the service?

The article goes on to say: "Grindr made use of the app conditional on consenting to data sharing or to paying a subscription fee."

Is this the unacceptable part? I.e. Grindr is creating a financial penalty for users who exercise their data privacy rights?

Would it be acceptable under GDPR to run an app where the choice is "consent to sharing data or do not use this app at all"?

mjw_byrne··on What's new in PHP 8?
I think the "clean slate" benefit is achievable almost for free in a monolith though - each request is a separate invocation of a handler function which is given the context it needs to run (e.g. an HTTP request, an output stream and user-defined context).

The user-defined context is the only route into the application state and can be as wide or narrow as you need. So you can share persistent state deliberately, e.g. by having that context contain a pointer to a db conn, but this is always a conscious, opt-in choice, and errors like accidental reuse should be impossible unless you're doing something inadvisable like using global variables.

mjw_byrne··on What's new in PHP 8?
Yeah, in my case I'm talking about a thing that is largely a web app but also does other things which don't fit well into the one-script-execution-per-request model.

That being said, I would still prefer a monolithic application for a small blog with comments because I think it's easier to manage, deploy, encapsulate, test etc.

mjw_byrne··on What's new in PHP 8?
I think it comes down to how we assess the cost of things. To me, the issues you identified with state (which I agree are real issues) are straightforward to overcome with disciplined design. On the other hand, I find not having application-wide state to be a handicap - e.g. I might want to have my application process batch jobs asynchronously or share state between requests in a highly efficient (read: in-memory) way.

Of course there are solutions in PHP-land, e.g. "run a job server" or "use Redis", but I find the overall cost of introducing more programs/services/components to be very high, in terms of learning curve, portability, maintenance and debugging.

I've spent the last few years replacing a crumbly, brittle, temperamental PHP/nodejs/Gearman/Redis/Nginx/Supervisor stack with a Go monolith so I'm sure that influences my opinion :-)

mjw_byrne··on What's new in PHP 8?
I used to use PHP as a web backend and then moved to Go. Forgetting the debate about the actual languages, it makes so much more sense to me for a web app to be a full-fledged, self-contained program which happens to listen on a network interface and respond when things make HTTP requests at it.

The old-school style, where routes map to scripts or parts of scripts and a separate web server like Apache or Nginx sits in front of the app, feels harder to reason about (does this thing persist across requests?), harder to debug (where did that error message end up?) more brittle (did this fail because of my script or my web server config or something else?) and more dependent on configuration magic (i.e. various text files lying around governing the behaviour of things).

So although some of these changes look cool, I don't think it's the language itself that most needs improving.

mjw_byrne··on Handling Null Values in Postgres
There are in fact alternatives to NULL for outer joins. For example, the SAS data analysis system has an operation akin to a join which gives you an explicit variable saying whether a corresponding row in the joined table was found. In the result of the join, rows where no row was found get zero data values.

Whether you consider that "good" or not is a matter of taste - personally I quite like it because it is very explicit and non-magical and I think NULL semantics cause more problems than they solve.

mjw_byrne··on Apology Critics Who Want to Teach You How to Say You’re Sorry (2017)
I think a big problem with "apologies" nowadays is that they are often not apologies at all, but exercises in ritual humiliation.

True apologies (e.g. what passes between people who care about each other when one of them transgresses in some way) are conversations in which someone expresses concern for the injured party and makes it clear that they're unhappy about what they've done. They aren't structured or formulaic and might not even contain the word "sorry".

The kind of "apology" that parents force uncomprehending children into ("Say you're sorry!") is a totally different thing. We all remember going through it. It has nothing to do with genuinely understanding your duty and responsibility towards others, it's just a Pavlovian training device. Child misbehaves, parent humiliates child, child learns not to misbehave.

The social media public "apology" is even further removed from the real thing because it usually relates not to personal relationships and authentic emotional responses, but to making insincere sacrifices to the political correctness gods in order to limit damage to career/reputation/revenue/share price. There's no point critiquing them, except perhaps to evaluate them as some kind of dubious art form.

mjw_byrne··on High-tech deception of ‘deepfake’ videos
In the court of public opinion, yes, this is true - video is no longer proof that something happened. I guess that's a price we pay for technological progress. Presumably at some point it will be possible (and easy and accessible) to generate body fluids with someone else's DNA in them, at which point DNA evidence will suffer a similar hit.

In a court of law, presumably video will now be subject to the same scrutiny as photos. IANAL but I imagine photos do not "stand alone" - the side that uses them has to make a convincing argument that they are trustworthy.

mjw_byrne··on High-tech deception of ‘deepfake’ videos
US intelligence doesn't enjoy a reputation for trustworthiness, to put it mildly. But if people can just go online, upload a video and get back a "hilarious" deepfake, that's an irrefutable demonstration that video-meddling is easy and widely-available, isn't it? They can literally see for themselves how accessible the faking tech is.
mjw_byrne··on High-tech deception of ‘deepfake’ videos
I think the general public is learning how to be sceptical, albeit slowly. It used to be the case that merely being published counted as authority (I remember reading about UFO abductions and thinking "this is a real book! There must be some truth to it!" In my defence I was eight years old) but the internet is forcing everyone to be less naive.

That being said, movements like the anti-vaxxers and the flat-Earthers are testament to people's ability to believe whatever the hell they want.

mjw_byrne··on High-tech deception of ‘deepfake’ videos
I agree, but I think my original point covers this - if video proves to be very easy to fake at scale (e.g. using your example of a turnkey website) then that should result in equally large-scale scepticism about video as evidence. The internet may drown in annoying deepfake-based memes but as long as everyone knows its all fake, there seems little potential for the kind of serious harm people are worried about (reputational damage, election meddling etc.)
mjw_byrne··on High-tech deception of ‘deepfake’ videos
Deepfakes are surely no more a "problem" than photoshopped still images?

Everyone knows that a still image can be altered to (convincingly) depict something that never happened. So, a still image is not considered good evidence of anything unless it has a verifiable provenance, chain of custody etc. Presumably that wasn't always the case, but now that photo editing tech is universally accessible, we all know we can't trust a still image unless its authenticity can be corroborated somehow.

The deepfake tech merely puts video into the same category of (un)trustworthiness. The potential for abuse depends on people's trust that video is always authentic. So the "solution" is simply to make it as widely-known as possible that video is now easy to fake.

mjw_byrne··on SQL style guide
Trouble with this kind of thing is that if you make it general enough to apply to most situations you can't really say anything (too many exceptions) and if you get opinionated then your guide doesn't apply to a wide class of use cases.

Stuff:

1. Advice like "Use consistent and descriptive identifiers and names" - is general programming advice, not SQL style advice, and is so bland as to go without saying (would anyone seriously recommend being inconsistent or non-descriptive?)

2. Preferring standard SQL to vendor-specific SQL just isn't practical for nontrivial use cases.

3. "Use /.../-style comments where possible" - why? This makes commenting out large blocks of code really fiddly. Using double-dash comments, even for multiple-line comments, leaves /.../ usable for knocking out big blocks of code.

4. The advice on table naming - if a table contains one row per xyz, then calling the table xyzs and calling its id xyz_id is sound practice, arguably even if this does violence to the natural language in which xyz is a word. This reduces cognitive load on devs and makes the naming more predictable, especially bearing in mind that not everyone speaks the same first language.

5. No idea why "cars_mechanics" is worse than "services". "services" could mean practically anything.

6. There's a lot more to be said about table aliasing. Personally I prefer a, b, c... and then in derived tables, different groups of letters such as x, y... or p, q... . Stuff which requires an alias which will never be used (e.g. a derived table which is simply selected from) is aliased by _.

7. The guide says Hungarian prefixes are to be avoided, but a _num suffix denotes a number? Doesn't seem consistent.

8. All the advice on portability is unnecessarily opinionated. Portability is a concern that varies from completely unimportant to completely necessary, depending on what you're trying to achieve.

9. Indentation and layout - there isn't a "one size fits all" rule - it just comes down to judgement and taste. The given examples also look weird:

  SELECT r.last_name
    FROM riders AS r
         INNER JOIN bikes AS b
         ON r.bike_vin_num = b.vin_num
            AND b.engines > 2
(a) Tables "riders" and "bikes" are siblings in this join so why are they indented to different levels? (b) The AND isn't symmetric with respect to its operands.

IMHO this is better:

  SELECT
    r.last_name
  FROM
    riders AS r
  INNER JOIN
    bikes AS b
  ON
    r.bike_vin_num = b.vin_num
    AND
    b.engines > 2
Arguably, "b.engines > 2" should be in a WHERE clause instead of the ON clause, because it doesn't refer to table r. The query result is the same and the query planner probably produces an identical plan (depends on engine, of course), so this is genuinely just a style/semantics point.

10. "Avoid UNION" - why??

11. Avoid vendor-specific data types - this just isn't practical real-world advice. Sometimes you commit to a certain DB because you need to use its specific feature set. That's OK.

12. "Prefer NUMERIC and DECIMAL to REAL and FLOAT because rounding errors are annoying". This is completely determined by your specific requirements! Essentially this advice is saying "always prefer arbitrary-precision arithmetic". 32-bit and 64-bit floats are much faster and more compact than arbitrary-precision and are accurate enough for a very wide class of use cases. IMO this advice should be turned on its head: "use floating-point unless you know you need higher precision and you understand the performance/storage implications" - which would be the default approach in most programming scenarios.

13. "Avoid table partitioning" - this is a design/performance concern, not a style concern, and it depends entirely on use case.

14. "Avoid EAV, use a different product" - not real-world advice. Most devs don't have the luxury of just introducing different products when they run into an awkward scenario, and even if they did, introducing a whole new DB engine carries major overhead. Sometimes you just suck it up and have a small EAV wart in your design.

mjw_byrne··on A Quirky Function
This is an interesting discussion about why it isn't possible to define a "good" value for 0^0, i.e. a value which works in all cases, but the original riddle doesn't really work. "Nice" operations like addition, multiplication and exponentiation all preserve continuity and the function we're given is discontinuous. The given solution contains a hidden special case, rolled into the author's proposed definition for x^0.

From a formal mathematical standpoint, you define things in certain ways and then work with the definitions. It's not like there is a "correct" value for 0^0 out there that we can mount a search for.

It's roughly the same with discussion of 0.999... - people still debate whether it's less than or equal to 1. You just have to use the definitions. In this case, 0.999... is shorthand for an infinite sum. An infinite sum is the limit of the sequence of its partial sums (where such exists). In this case the limit is provably one. So that's the value of 0.999... . If you look at a series like 1 - 1 + 1 - 1 + ..., its sequence of partial sums is divergent, so it doesn't have a value and that's that - although that doesn't mean we can't apply all sorts of alternative definitions to try to work with such a series, and some of them do in fact assign it a value. Such alternative definitions can produce really weird-looking results - one of the most striking is the result that (subject to certain definitions) 1 + 2 + 3 + 4 + ... is -1/12.

mjw_byrne··on Mistakes Beginners Make When Working with Databases
Not sure about point 3 ("use UUIDs instead of integer PKs"). Exhausting a 32-bit int takes a lot of usage; exhausting a 64-bit one is completely out of reach for almost everyone. 128-bit UUIDs will take more space to index than ints or bigints and are less human-readable. Depending on what UUID version you use you may or may not lose ordering, which can be a nice-to-have.

I think this isn't a question of ints being a mistake and UUIDs being better, it's about using the most appropriate type based on requirements.

mjw_byrne··on Apple Stole My Music
I don't single Apple out (although this wasn't clear in my original comment) - there are plenty of other organisations and systems out there which are just as pernicious, and my stance is to simply not use them. Remember Sony and the rootkit stuff?

There are plenty of good alternatives out there. The price you pay for getting to use computer systems which don't betray you is the cost of learning to use Linux or BSD (these days, nothing like as painful as it used to be) and going without some "conveniences" like magical available-everywhere cloud-synced everything. In my book that's a tiny cost for the ability to keep proper control and ownership of my own shit.

mjw_byrne··on Apple Stole My Music
Sarcasm
mjw_byrne··on Apple Stole My Music
I've been telling people for a long time to avoid Apple because it's an organisation which has demonstrated a pattern of contempt - to its customers, to its competitors, to the developers who use its app store and to the courts. The replies I get are so depressingly apathetic: "but the iPhone is nice"; "I like how simple it is to use"; "the design is so pretty". How can people be so easily charmed into bending over for out-of-control megalomaniacs? Maybe the secret to Hitler's popularity was the uniforms, which were admittedly really snazzy (Godwin's law, I know, I know...)
mjw_byrne··on How much oxygen for a person to survive in an air-tight enclosure? (2004)
Whoa whoa. This means Sunshine wasn't scientifically accurate?!
mjw_byrne··on Kofi Annan on Why It's Time to Legalize Drugs
There's a strong parallel between drug policy and sex education policy. If you acknowledge that sex is a thing people are simply going to do and you give them the information they need to do it safely and throw in a free condom or two, STDs and unwanted pregnancies are kept under good control. If your policy is "you don't need education and condoms if you just don't do it!" then STDs and unwanted pregnancies soar.

In the case of drugs, it is clear that people will use them regardless. So the question for policymakers can't be "how do we stop people using drugs?", it has to be "given that people will use drugs, how do we minimise the harm caused?"

The other interesting parallel is ashtrays in aeroplane toilets. Supposedly they're there because sometimes, despite the warnings and no-smoking signs, people light up in the loo anyway. It's better for them to have an ashtray to put the cigarette out in than to try to improvise and possibly start a fire. In a situation where a planeload of passenger's lives could be at stake, there's no room for moral grandstanding - they've done the pragmatic thing and realised that when total prohibition cannot be enforced, you simply do what you can to minimise the damage.

mjw_byrne··on Why Go solves so many problems for web developers
I did fudge a little - "tends" and "probably". Of course compilation is not a guarantee of correctness, I just find that it gets me most of the way there. JavaScript, by comparison, feels like it's trying to give you rope to hang yourself.

Maybe I'm abusing the term "package management". I'm talking about go get, the way imports function, the cute private/public lowercase/uppercase mechanism, the recently-added vendoring support etc.

mjw_byrne··on Why Go solves so many problems for web developers
I've done real-life web dev using PHP and using Go, and have dabbled with Node. Thoughts:

1. Go's strict, statically typed, thou-shalt-check-thy-errors approach is a breath of fresh air. The compiler does a whole load of checking which can (and therefore should) be automated, which in many other languages is left to the developer. Go code tends to have the property that if it compiles, it probably works as designed. I love this.

2. IMHO it makes more sense to think of a web app as a server application one of whose functions is to listen for and respond to HTTP requests. So, the question I'd ask is "is this a good language for server programming, and how easily can I make it speak HTTP?" In Go's case I've found the answers to be "hell yes" and "very".

3. The tooling is really nice. go fmt takes a whole load of pain away from everyone (no more effort required to format code properly, the tab/space and where-to-put-the-{ debates are solved decisively, reading other people's code is made easier), the package management is lovely, statically-linked executables are easy to move around and go doc encourages proper commenting.

4. Really good performance.

5. The biggest drawback I've seen with Go is verbosity - although a lot of the time it turns out that my verbose Go code is checking errors properly and my compact PHP code wasn't.

← PreviousPage 3 of 3