HNHacker News
TopNewBestAskShowJobs

mjw_byrne

321 karma · joined February 17, 2016

submissionscomments
mjw_byrne··on Go 1.22
Perhaps I'm a dinosaur but I don't like the range-over-function addition. I don't think it adds enough convenience to justify the complexity it adds to the language, and the functional style feels at odds with Go's explicit, imperative (albeit verbose) and feature-lean style, which I think was one of its major strengths.

For the same reason I think the range-over-integer feature is a misstep. Go's lean feature set and minimal mental load have always been major strengths and differentiators of the language.

mjw_byrne··on Ancient Stars Made Extraordinarily Heavy Elements (2023)
I'd heard of the island of stability but this one is new to me. I love the idea of there being loads more exotic elements to play with, and substances with densities far exceeding 22 kg/l (which it roughly where it tops out with currently-available elements).
mjw_byrne··on The optimal amount of fraud is non-zero (2022)
I'm not sure this is true in principle though. For example, there's plenty of encryption in use today that has "perfect" security (in the sense that a cipher hasn't been broken) and which is transparent to the end user. This wouldn't have been true a long time ago, when there was no such thing as computer science and the security of information was more to do with how many soldiers you had and how beefy your strongbox was.

Similarly, there's no reason in principle why certain classes of fraud couldn't be rendered practically impossible by an advance in technology, which would undermine the whole "you should welcome some fraud" argument.

mjw_byrne··on The optimal amount of fraud is non-zero (2022)
> The comment directly above you on the page right now gives an example of people getting the trade-off wrong, so your dismissiveness is pointless.

I was only dismissing the way the article presented fraud tolerance as something deeper than a trade-off. I did acknowledge that the trade-off exists and in my other comment stated explicitly that I think discussion of how one finds the right trade-off is interesting.

On your COVID example, I agree that in an emergency it's worth pulling the lever as you put it, i.e. grease the wheels and get the stuff we need. But I wouldn't expect the extra spending to be directed disproportionately at cronies of the government, fraudulent or not.

mjw_byrne··on The optimal amount of fraud is non-zero (2022)
Yes, and that would be a genuinely interesting point. For example, it could be compared it to the need for regular backup testing, where we generally try to maintain DR readiness with artificial testing and certainly not by accepting a certain frequency of disasters.
mjw_byrne··on The optimal amount of fraud is non-zero (2022)
Clickbaity, trying-too-hard title. The point being made is mundane: perfection is too expensive, so we settle for "good enough". This is near-universally applicable and near-universally understood.

The author is trying to make it sound deep and meaningful with statements like "you should welcome some fraud", as though fraud is actually required for the system to function (clever counterintuitive point made, cue huge dopamine spike). But no, we simply tolerate a certain amount of fraud because eliminating it isn't worth it. Yawn.

mjw_byrne··on All code is technical debt
Taking a useful concept and stretching it to an extreme in order to generate a counterintuitive-but-plausible soundbite is not the same thing as wisdom.

Other examples that come to mind are "a complete rewrite is always a mistake" (no, it just has different risks/rewards), "if you are reading this part of the docs, you are trying to be too clever" (your API is too much for my puny brain is it?) and "all functions are APIs" (no, my two-line string quoting func is not an API, actually).

mjw_byrne··on The Wait Equation and AI Investment
There's a fun application of this argument to the bit in the Hitch Hiker's Guide to the Galaxy books, where a civilization runs a 7.5m-year-long computer program to calculate the answer to the question of life, the universe and everything.

Someone pointed out that they would have been better off waiting for about 40 years of Moore's law to happen, then building a computer and running the same calculation in about 2 years.

mjw_byrne··on How to Do a Full Rewrite
I find this kind of cynicism tiring. Full rewrites have major risks but also potentially major upside, let's leave it at that without getting dogmatic.

I've had conversations with "veteran" (i.e. old and no longer well-informed) techies who seem to think that all programming languages do exactly the same job, all DBMSes have the same ergonomics, choice of OS doesn't matter "if you know what you're doing", blah blah blah. This attitude isn't a mature counter to youthful starry-eyed overenthusiasm, it's just hopelessly jaded.

I rewrote the whole backend of my SaaS. I also completely redid the hardware and networking stack. This was because it was all a mess and fixing it would have been more risk and more work than just redoing it. Both projects were successful, and now the backend and the infrastructure are (a) future-proof, because they pass stress tests at 10x our current load, (b) much more reliable than they used to be, as measured by real-life uptime, (c) well-documented and (d) maintainable by people other than me. There's no magic to it, we just thought it through carefully and did some planning.

mjw_byrne··on Wikipedia user edits over 90k uses of “comprised of”
There are other common examples of active and passive meaning the same thing. "The document is printing" and "the document is being printed", for example. It has no merit other than a popular consensus that it's correct, which is all that's required.
mjw_byrne··on Show HN: Lander, a lunar lander style web game
I feel like the lunar landing aspect is incidental, and this is fundamentally a "impossible-to-please parent for whom nothing is ever good enough" simulator :-)
mjw_byrne··on In Defense of Not-Invented-Here Syndrome (2001)
Putting aside the long-term concerns such as building skills, maintainability, team dynamics and so on, there's a simple effort-based cost-benefit analysis you can do. To responsibly use a bit of software Not Invented Here, you have to

(a) understand what it does

(b) research the available alternatives

(c) check that you're happy with its dependencies

(d) deal with any licensing issues

(e) check for known issues and bugs

(f) if possible, take it for a test run

which is likely to be a nontrivial amount of work. If it's less effort to just write it, you may be better off just writing it.

mjw_byrne··on Connecticut parents arrested for letting kids walk to Dunkin' Donuts
"If she talks to me again, I'm going to arrest you both and take away your kids"

That part, at least, sounds like a power trip to me.

mjw_byrne··on EU chat control law will ban open source operating systems
> No, it's not, unless you have logs or database records that links the IP address to a person (such as a login from that IP). And I bet you do, that's why it bothers you.

Nope, the scenario is which this came up for me was about keeping IP addresses in a blacklist in a firewall. No logs or linking or anything.

> Users can leave data that identifies them in various places. Sometimes they do it intentionally, sometimes not. It's your job to warn them and obtain consent.

If it's my job to obtain individuals' consent to process their personal data in contexts where they have no business putting personal data, the law is poorly-designed.

> In this case, removing data is a legal obligation you have. Processing data (by deleting it) to obey law is one of the exceptions in GDPR (art.6/1./c, and also art.17/3./b). https://gdpr-info.eu/art-6-gdpr/ https://gdpr-info.eu/art-17-gdpr/

Thanks for the info and links, that's genuinely useful. For the record I know my example isn't a watertight logical gotcha; it's an example of how GDPR's language is (IMHO) imprecise and unhelpful.

mjw_byrne··on EU chat control law will ban open source operating systems
> And car registration numbers and passport numbers and street addresses are also personal identifiable information despite the fact that people does not have those either. Just like IP addresses

The analogy doesn't work. A passport number is always "of" a person, because passports are issued to people. An IP address is often, (even usually, for IPv4), far-removed from an individual. Also see M95D's response above: "no it's not". You're confident that there's a good reason why an IP address is personal data and he's confident it's not personal data. This is what I mean when I say it's a poorly-written law.

> This is a good thing because it closes a dozen loopholes and allows good-faith actors to remain on the right side of the law without much effort.

Fair enough; in my opinion, ambiguity and hand-waving in legislation is too high a price to pay, and is also unnecessary. It's literally their job to codify the rules rigorously.

> This just shows a poor understanding of the law, or you are just hand-waving things you have no knowledge about. This is not how the GDPR works. At all.

I know my example isn't a real contradiction (and see also M95D's response in which he points out how the rules actually apply). I'm giving an example of language and terminology in the law which is on its face confusing and sloppy.

mjw_byrne··on EU chat control law will ban open source operating systems
"Why do you think GDPR is some boomer with filofaxes thing?"

I handle the GDPR compliance for my company so I've had to get stuck into the topic. Once you start actually trying to apply the various definitions and rules to the real world, they quickly break down. Examples:

1. The core concept in GDPR, personal data, is defined sloppily: "data relating to an identifiable natural person". It doesn't work because "relating to" is a hand-wave. Your name is obviously personal data, but (according to mainstream legal interpretation) so are IP addresses, despite the fact that people do not have IP addresses, network interfaces do.

2. Personal data is not defined in terms of the context in which it appears, which is crucially important. If I have the text "John Smith" in a database in a column called "name" and it actually relates to a person called "John Smith", that's clearly personal data. But what if someone uses my platform to spin up a VM with the hostname "johnsmith" - is that personal data? According to my lawyers, the answer is "maybe". I know lawyers have a tendency to be like that, but the law itself shouldn't leave the question open.

3. The construction of the law is poorly thought-out and leads to silly contradictions, e.g. if you have someone's personal data and you are told to stop processing it, you must stop processing it. But storage, erasure and transmission are all classed as processing, and it's logically impossible not to do at least one of these things.

All that being said, I'll repeat that I fully agree with GDPR's objectives and I think its real-world impact is positive. I just wish more people who understand how computers work had been involved in drafting it.

EDIT: embarrassing punctuation mistake.

mjw_byrne··on EU chat control law will ban open source operating systems
EU tech law seems to be a bit of a rollercoaster. GDPR was conceptually a great thing (although its actual implementation smacks strongly of boomers with filofaxes ranting about FaceTok and Google Siri), the right to repair is good, the USB-C thing is useful. The cookie permission thing didn't work though.

It's sad to see the EU now joining the "let's use child abuse as an excuse to steal the internet" bandwagon. The UK Government has been doing this for years, and is trying it right now with the Online Safety Bill. I never know what to think of the motivation behind this stuff. Is it a well-meaning but naive attempt to protect the vulnerable, or is it the establishment desperately trying to destroy the threat posed by open communication and the empowerment of individuals?

mjw_byrne··on Turns are better than radians
Absolutely, but IMO circles have as little to do with sin and cos as triangles do :-)
mjw_byrne··on Turns are better than radians
"triangles have very little to do with the true nature of sin and cos" <- this is what I mean.
mjw_byrne··on Turns are better than radians
True, however that doesn't mean x represents an angle. It means you can put a geometric interpretation on an abstract formula. e^ix = cos x + i sin x regardless of what x represents - if you were doing electrical engineering it might be time, for example.

Interpretation is often strongly motivated by what "comes first" in the order in which you learn things, so the whole debate is a bit subjective anyway. Another common example: at school we learn the integral is the area under the curve. At university we learn the area under the curve is the integral. The integral is the "real" thing and the area is just a convenient geometric interpretation, which actually makes no sense for many (most?) integrals. At school we learn it "backwards" purely because it's easier that way, and visual aids are helpful. I think something similar applies to sin and cos.

mjw_byrne··on Turns are better than radians
The main thing to realise is that sin and cos are not fundamentally tools for doing geometry. The fact that you can use them for working out side lengths of triangles or converting polar to cartesian coordinates is somewhat incidental.

It doesn't help that at school our first look at sin and cos is all about adjacent sides and opposite sides in right-angled triangles. It's understandable, because jumping straight into the deep end would be too hard, but it's a bit misleading.

In most mathematical applications, the x in "sin(x)" doesn't even represent an angle, so it doesn't make sense to talk about whether sin and cos are "in degrees or in radians". They're simply functions that crop up as solutions to the differential equation that describes harmonic oscillation; or the imaginary and real parts of e^ix; or exponentiation of certain matrices; or a whole load of other stuff I haven't thought of.

In all those settings, it turns out that sin has zeroes at integer multiples of pi, which forces the convention that a half-turn is an angle of pi, and the definition of radians follows from there. But as I said, for the specific case of basic trig, carrying around a scaling factor and doing everything in degrees is easy enough. Carrying that same scaling factor around in pretty much any other application of sin, cos and related functions would be hell.

mjw_byrne··on Turns are better than radians
"math never decreed that sine and cosine have to take radian arguments!"

This is at best questionable and at worst false.

If you only want to use sin and cos as functions for doing trigonometry, it is true that you can choose whatever angle unit you like and stick with it and it will be fine.

For most other stuff, e.g. differential equations, complex analysis, signal processing and mechanics, it's pretty much inescapable that the zeroes of sin are at integer multiples of pi, and that's that.

mjw_byrne··on DRY is an over-rated programming principle?
Ironically, the second example has a copy-and-paste bug:

  def make_pepperoni_pizza():
      make_pizza(["pepperoni"])
  
  def make_hawaiian_pizza():
      make_pizza(["pepperoni"])
mjw_byrne··on The Wood Database
Whilst randomly browsing on this site, I came across a piece of my own work! I made the chess piece pictured on the "kingwood" page.

I _think_ that's the first time I've ever completely randomly stumbled upon myself online, i.e. with no intention whatsoever of actually looking up something I'd done. Nice little boost to start the day with :-)

mjw_byrne··on How to be uncertain with dates (2020)
I don't like this, for several reasons:

- It's already hard enough to persuade people to use ISO 8601, which is obviously objectively superior to DMY or MDY in several ways. Consistent, widespread support for this uncertainty notation feels like a wild fantasy.

- It mixes logic and data, which IME tends to buy a little terseness at the cost of a lot of mess.

- It's not intuitive. 2015-06?-14 doesn't make it obvious (to me) that the 2015 is uncertain as well as the 06. Imagine the subtle classes of bugs that could arise from manual entry and manipulation of this notation.

- It's not consistent. If 2015-06?-14 says the 2015 and the 06 are uncertain, why doesn't 2015-?06-14 say the 06 and the 14 are uncertain? Moreover, why can the former be expressed with a single ?, but not the latter? Arguably the latter is the more likely scenario (you know something was in 2015 but aren't sure about the month and day).

- It ties uncertainty into the decimal representation. In a month field, "1X" means "October, November or December", but how do we say "September, October or November"?

- Adding uncertainty and approximateness to a data type brings three-valued logic in through the back door. What should 1920-01-XX == 1920-01-XX return? If your environment has a null-like concept, maybe null. Even worse, what about 1920-01-?15 == 1920-01-XX? They're different conceptually (around the 15th vs. any time in Jan), possibly the same date-wise (could both actually be the 13th), different notationally and possibly express exactly the same intention (can easily imagine the same human being switching between these depending on mood). Ugh.

mjw_byrne··on Ask HN: What (almost) company sinking engineering mistakes have you witnessed?
Separate storage of file hashes would make tampering detectable. Actually preventing root modifying a file probably has to be done at the hardware level.
mjw_byrne··on I advised a student to not publish evidence of reverse racism
Regardless of where you land on the racism/reverse racism/affirmative action/culture discussion, it's a sad day for science, academia and truth when simply presenting evidence (rather good evidence in this case, it seems) is frowned upon because it doesn't fit the current societal mood.
mjw_byrne··on Against Pair Programming
Pair programming easily achieves the >2x speed boost though. The driver focuses on the technical details of writing high-quality code, implementation, proper variable naming and so on whilst the navigator keeps track of the overall task, provides extra short-term memory, spots silly mistakes/typos, focuses on business logic etc. So instead of one programmer juggling too much and stalling, getting bored/frustrated, losing confidence, taking shortcuts to try to keep up and making a mess, you have two programmers in a state of flow producing high-quality work.

As a side-effect, you also get great shared knowledge of the code base.

mjw_byrne··on Death of the Calorie (2019)
People often say that you can't burn enough calories to contribute significantly to weight loss, but I don't think this is true.

I went from fat to lean by counting calories and exercising. An hour of hard cycling burns 1,200 calories for me. So assuming my body needs 2,400 cals per day to maintain itself, I can have a 1,200-calorie defecit by eating 2,400 and burning 1,200, or by being sedentary and only eating 1,200. The former is fairly easy to do, is compatible with family meals and a social life and makes me fit. The latter is just miserable.

mjw_byrne··on Common Nginx misconfigurations that leave your web server open to attack
This is a good example of the trade off between pretty/terse/clever and safe/correct/maintainable. Nginx is well-respected mature software but it's hard to see these issues as anything other than a design blunder. The trailing-slash path traversal thing looks to me like a file system analogue of SQL injection.

I think d3.js is another example of this. It's obviously written with incredible skill but I could never get on with the ultra declarative and implicit style, it always felt like a fight.

These days there seems to be a trend towards a verbose, explicit style, e.g. Zig (no hidden control flow - compare to C++'s operator overload-fest) and Go.

← PreviousPage 2 of 3Next →