Hacker Newsnew | past | comments | ask | show | jobs | submit | ad_hockey's commentslogin

I agree that trying to produce this sort of spec for the entire project is probably a fool's errand, but I still see the value for critical components of the system. Formally verifying the correctness of balance calculation from a ledger, or that database writes are always persisted to the write ahead log, for example.

I've been thinking about trying an alternative JSON library, but interested to hear opinions on whether jsoniter is still recommended. There are 208 open issues on the repo, and a question about whether it's still maintained[1]

Would particularly like to know if anyone has done a performance comparison with the new API coming in the stdlib[2], which feels like a better bet. That blog says:

The Marshal performance of v2 is roughly at parity with v1. Sometimes it is slightly faster, but other times it is slightly slower. The Unmarshal performance of v2 is significantly faster than v1, with benchmarks demonstrating improvements of up to 10x.

[1] https://github.com/json-iterator/go/issues/706

[2] https://go.dev/blog/jsonv2-exp



Corporate, yes. But why do you think the OP is specifically targeting America?

You think a business in any other country - especially the EU where data protection requirements are even more strict - are going to allow their proprietary information to be in a random website?

Yes.

I don't live in your head.


You don’t have to “live in my head”. Companies value their intellectual property enough not to just put it in random websites.

Would you post your companies secrets to HN?

See what happens if he goes to let’s say Coca Cola. I’m sure they will be glad to tell their employees to put notes about the Coke formula and the discussions they had with their manager


A Philosophy of Software Design by John Ousterhout is often recommended, and is very good.

There was an interesting debate between John and Uncle Bob on their differences in style recently[1], with a related HN discussion[2].

[1] https://github.com/johnousterhout/aposd-vs-clean-code/blob/m...

[2] https://news.ycombinator.com/item?id=43166362


I would like to note that this text was transformative in my current project (an effort to model CNC work in 3D) --- when I first read the book, I did it chapter-by-chapter, applying the lesson learned from that chapter to the entire codebase before moving on to the next --- I am currently re-reading the book for the third time, and I'm planning on a compleat re-write before I do 1.0....


That first example is an unintended closure, since the err at the top level actually has nothing to do with the errs in the goroutines. I have seen that sometimes, although the use of = rather than := normally makes it obvious that something dodgy is going on.

As to whether it's a common pattern, I see closures on WaitGroups or ErrGroups quite often:

  workerCount := 5
  var wg sync.WaitGroup
  wg.Add(workerCount)

  for range workerCount {
    go func() {
      // Do work
      wg.Done()
    }()
  }

  wg.Wait()
You can avoid the closure by making the worker func take a *sync.WaitGroup and passing in &wg, but it doesn't really have any benefit over just using the closure for convenience.


> The most common refrain is that popstars often write their music. This is misleading: they write the lyrics, suggest a general vibe, and some rough melodies or chords. And even this is a stretch many times. They are not composing or producing the music in any larger sense, and this is the pivotal part of actually making music.

To be fair, if they write the lyrics, define the vibe/feel of the song, and compose the melody and chord progression, then that does sound like the vast majority of the song. What's left - I guess some additional instrumentation, the percussion, production? To me it does sound fair to credit the popstar with having composed the music in this case.


The operative word was "rough". They give a few hints; they're not painstakingly mapping out the melodies and chords for every instrument and determining what those instruments are, and how they sound.

If you're writing for a guitar and voice, then you've basically got a song, but pop music is built on sometimes hundreds of different instruments and effects.


That seems like quite a high bar, to the extent that I'm not sure we could ever credit anyone with creating a pop song if it applies. Everyone seems comfortable crediting Lennon and McCartney with their various Beatles songs, for example, but were they doing all the things you describe? Did they do more to create those songs than, say, Taylor Swift does for hers? It's not obvious to me that it's the case.


Yes, they did. George Martin was an arranger, not a co-writer. Max Martin is a co-writer.

If you gave Lennon and McCartney a couple of guitars, a few days of studio time, a good mood, and no other help you'd probably get a hit. Or at least an interesting song.

If you gave Taylor Swift the same you'd get a demo, maybe. You might get an unassisted hit, but the odds are much lower.

Charli XCX - even more so. Give her a laptop and microphone and some plugins and no producer, and I doubt you'd get much.

Not to say that what she and Dua Lipa do is easy. But they're fundamentally performers and brands for a music production operation.

Creative agency isn't a binary. It's on a spectrum. Some people have very little. Some have a lot. Some have taste that defines the product, even though they're mostly curating other people's work.

Michael Jackson was notorious for this. He was a phenomenal dancer, an ok vocalist, not much of a practical musician. But he had a strong sense of what he wanted, and he had a theatricality that pulled the whole thing together.

Charli XCX is a version of that. I don't think her appeal is as strong or as universal, and I doubt she has as much agency as Jackson did. But it's the same idea - shape, curate, perform.


Yes, it's absolutely the case for Lennon and McCartney, since they didn't give rough ideas to George Martin to fill in; they specifically wrote the exact melodies for half the instruments involved and exactly how to play them.

You could argue that Harrison and Starr always deserved some of the writing credit, since they often determined their parts, and I wouldn't actually disagree with that -- though Lennon and McCartney were kinda control freaks, so I'm not sure how much leeway was actually given. When they started bringing in extra instruments, again, there is arguably some extra credit to be given to Martin and others, but Lennon and McCartney were still strongly directing what was to be played.

For what it's worth -- and this is going to get me hated even more than my popstar-skepticism -- I don't really like the Beatles that much. But it's transparent that they did more than Taylor Swift because they were specifically and precisely writing the melodies for the instruments being played.


The UK. Being educated at Eton is a pretty good proxy for "the elite". We've had seven Eton-educated Prime Ministers in the 20th and 21st Century, and 100% of them were Conservatives.

There has never been an Eton-educated Labour PM and the majority of Labour MPs come from state schools. The political skew among the elites is pretty obvious.


You don't think Eton is being flooded with progressive views? [1]

A far better proxy for "the elite" would be "people who studied PPE at Oxford"

https://en.wikipedia.org/wiki/List_of_University_of_Oxford_p...

[1] https://www.bbc.co.uk/news/uk-england-berkshire-58244672


That's a far worse proxy. If you want to study PPE at university then you have to pay, there is no alternative. Studying at Eton is entirely unnecessary, given that state schools exist, and also far more expensive - Oxford costs £9,500 per year, Eton is about £17,500 per term.

That's why it's the sole preserve of the elite, unlike Oxford.


You seem to think "Elite" means "Rich" whereas "Elite" in this context means "opinion-former". Some can be rich, some can be MPs, civil servants, journalists, editors etc.

EG: https://yougov.co.uk/politics/articles/26102-who-are-elite-b...


Using your own data, then: can you present your evidence that the majority of MPs, CEOs, bankers, and newspaper editors are left wing?


MPs - obviously, look at the Labour majority.

CEOs - quite a large proportion.

Bankers - more than you would expect

Newspaper editors - Guardian, Mirror, Independen

Civil Service - pretty much all of it


Prior to the current government the Tories were in power for 14 years, mostly with a majority. So I guess your opinion that the elites are left wing must be quite recently formed?

For the newspaper editors, take a look at the circulation figures for 2020 (the last year that we have a full set)[1]

The Guardian, i, and Mirror had a combined circulation of 800,989.

The Mail, Express, Sun, Times, and Telegraph had a combined circulation of 4,246,217. That’s 81% (you'll also notice there are more of them). The newspaper landscape in the UK is overwhelmingly right wing.

I don’t know why you’ve included Civil Servants, since according to your own data only 32% of respondents think they’re part of the elite.

I think this has probably run its course. I did ask for evidence, but from your answers for CEOs and bankers it’s pretty obvious that your opinion is just based on vibes.

[1] https://en.wikipedia.org/wiki/List_of_newspapers_in_the_Unit...


[flagged]


You picked the sample, not me. Those categories are taken directly from the YouGov poll that you linked. I took the four categories where "Are members of the ruling class" scored higher than "Are not..."

Your own data doesn't support your argument. I'd also point out that the comment you originally replied to specified "economic/political elite", which is why I started off with politicians. The BBC doesn't fall into either category, it's media.


That actually does happen in Black Mirror, in the episode Fifteen Million Merits. There's a sort of deafening siren that goes off if the characters look away from the ad without paying to skip it.


They're an institution in the UK. They're in the arcades at every seaside town, and every kid plays them. Now that I have kids I actually think they're brilliant; for £2 each they taught mine everything they need to know about gambling.

- You sometimes win a bit along the way, but eventually you lose everything.

- The jackpot prizes are only there to lure you in, and you never win them. Towards the middle of the shelf are things like £20 notes. We noticed that one of them was getting quite near the edge, and might actually become winnable, but then the following morning its position had been reset to the back of the shelf.

- It's still fun as long as you're just playing with money you don't mind losing, and not expecting to come out ahead.

They even learned something about company scrip, from the tickets that come out of the machines and the ridiculous exchange rate between tickets and the actual rewards at the prize shop.

I asked my son on the way home if he'd put all his Christmas money and savings into the machine if I let him, and the answer was hell no - maybe a pound, but he didn't want to lose all of his money. Valuable lessons all round.


A couple of considerations are:

- You have to decide whether to bump the entire API version or only the /foo endpoint. The former can be a big deal (and you don't want to do it often), the latter is messy. Especially if you end up with some endpoints on /v1 (you got it right first time) while others are on /v4 or /v5. Some clients like to hard-code the URL prefix of your API, including the version, as a constant.

- You still have to decide what your deprecation and removal policy will be. Does there come a time when you remove /api/v1/foo completely, breaking even the clients who are using it correctly, or will you support it forever?

It's not easy at all, especially if you have to comply with a backwards compatibility policy. I've had many debates about whether it's OK to introduce breaking changes if we consider them to be bug fixes. It depends on factors like whether either behaviour is documented and subjective calls on how "obviously unintended" the behaviour might be.


I'm one of those users of 10-year deprecated APIs. Thank you for not breaking me. If it works, it works.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: