Hacker News new | past | comments | ask | show | jobs | submit | dmi's comments login

> If all you want to send is an array of integers, why should you have to put it into a struct first?

If you're sure that's all you'll ever have to do, then sure. But unless you're 100% certain that the protocol will never evolve further, having a more complex structure allows it to change in a gradual way.


It was clear, from the post, that they were saying, "If all I need is a simple array, why should I be required to wrap it in a struct?" The whole point (from the post) being that protobuf required structs but gob allowed simpler types _in addition_ to structs.


all I need _right now_ is a simple array

Nobody knows the future, and preparing for the future is a huge part of software engineering. Sending top-level arrays instead of sending them inside a struct is never the right way.


> Sending top-level arrays instead of sending them inside a struct is never the right way.

While I understand the sentiment, I 100% disagree on the 'never' qualifier.


Depending on if the format you use is self-describing or not, it’s possible “sending a plain array” and “sending a struct with 1 field that is an array” could have the same format on the wire.

If it is self describing, the overhead could be very very minimal.

So, why would you want to send a plain array without wrapping it in a struct?


dmi knows that. dmi was saying that even if the encoding scheme allows encoding simpler types, it's often not smart to use that functionality, because you won't be able to evolve the format in the future. If you encode a message instead of a simple type, you'll be able to evolve it later as you add more features to your program.

Note that even protobufs, which doesn't allow encoding simple types at the top level, still has this debate when deciding whether to encode an array of simple types (inside a struct) or an array of structs (inside a struct). And Google's guidance is to use an array of structs if more data might be needed in the future:

>However, if additional data is likely to be needed in the future, repeated fields should use a message instead of a scalar proactively, to avoid parallel repeated fields.

https://google.aip.dev/144

>// Good: A separate message that can grow to include more fields

https://protobuf.dev/programming-guides/api/#order-independe...


I've been using Ctrl-[ instead of Esc for so long that I forget that a lot of people don't know about it. This may not be convenient on non-English keyboard layouts.

More alternatives: https://vim.fandom.com/wiki/Avoid_the_escape_key


small fun fact: I switched to this when the escape key was taken from me (thanks again NOT apple) After switching to a newer MacBook that has the escape key I did not start using that again, but stuck to the Ctrl-[ as it just works.


Better yet, remap CapsLock to Ctrl.


Is anyone aware of similar resources for learning BSL (British Sign Language)?

I've done a couple of in-person courses, but I'd really like to learn more vocabulary at my own pace. So far I haven't found much other than a couple of dictionaries (e.g. https://www.signbsl.com/ and https://bslsignbank.ucl.ac.uk/dictionary/), but it's not been hugely helpful in learning which signs are common in my region. I also find that just looking up examples of signs I don't know never really helps me learn.


There's a bunch of signed (and dedicated sign language) programming on FreeView, but usually late at night. It's worth looking them up on iPlayer/4oD etc and watching them if you're not around at the right times.

They're obviously pitched at the level of fluent signers who use these as their primary way to use the TV, but I do find that between the audio, subs and thematic information, a lot can be picked up from the signer. English-with-subs is known to work well for foreigners learning English, and I expect English-and-signed might be good for BSL.

Where about are you based? I joined the bsl soc at uni and later did a level 1 course, so my level is rudimentary, but if you're in the west mids it might be good to practice.


Ah yes, I forgot they do that. That's a really helpful idea, thanks!

I'm based in Herts/London, so a bit out of the way for a casual meet :-)


To add to this — I suffer from Ménière's disease, which manifests for me as variable hearing loss. Some days are bad, and I can hardly hear/understand speech even when someone is right in front of me and I can lip-read. Some days are good, and my hearing aids are uncomfortably loud or make things sound "weird". But most days, my hearing aids do exactly what I need them to :-)

I've had audiograms taken on moderate and bad days, and the difference in frequency response was significant (up to 30dBA difference across only the lower frequency bands).


The app for my hearing aids allows my audiologist to make remote adjustments, so I don't even need to visit their office for straightforward changes. I really want to reverse-engineer it so that I can modify some of the details of the profiles myself.


My (Phonak) hearing aids had a multi-week ramp-up to full power, in order to give my brain time to slowly adjust. Dealing with things like the occlusion effect (https://en.wikipedia.org/wiki/Occlusion_effect) just takes time, and getting used to something being in your ear for a large number of hours per day.


Interesting; I learned a slightly different set of associations with mnemonics for the sounds as well. 0, 2, and 3 were the same as this system:

  0 = the word zero has an s/z sound
  1 = a single line, like lower-case "L"
  2 = two lines, like lower-case "N"
  3 = three lines, like lower-case "M"
  4 = the word "four" ends in an "R" sound
  5 = the word "five" contains "F" and "V"
  6 = the digit looks like a lower-case "B", and lower-case "D" is its mirror image
  7 = the digit looks like a badly-written upper-case "T"
  8 = the "gh" in the word is weird, and reminiscent of "CH"/"SH" (and "J" is similar)
  9 = the digit looks like a lower-case "G", which is similar to lower-case "Q", and lower-case "P" is its mirror image
I had no idea that there was a standard, but I use it a lot to remember what page I've reached in a book (without a bookmark handy), or for short strings of numbers like IP addresses. I find it much easier to remember "Latin insults suns lamely" than "172.217.20.131", though I'd probably try and find a better mnemonic than "insults" for 217, as that technically maps to 20170...

It's kind of like the "correct horse battery staple" thing (https://xkcd.com/936/); words are easier to memorise, especially if you can create a narrative, however tiny.


I would like to know the history of how the standard came about actually as it seems fairly arbitrary.


I think it's important to highlight that it's definitely about context rather than ownership when adding a name or bug number to a TODO comment.

"// TODO(dmi): update after moving to Java8" doesn't necessarily mean that it's _me_ that has to fix it, but that someone can come to me and say "Tell me more about this". This took me a while to learn/remember, but it's very helpful. The hardest part for me to keep in mind was that someone else's name on a TODO shouldn't mean I ignore it.


I had exactly the same situation while at a startup, which got spotted by myself ("Woah why did my taxes jump?") and my employer ("What's this weird tax code?"). Getting it fixed with HMRC was almost trivial, and the refund was very nice.

Years later, I moved to the US. I'm sure it's probably less bad if you've grown up with this system, but I still have no idea what to change (or by how much) to make sure I don't owe taxes next year. I don't understand how to play the tax game, so I'm pretty sure I'm paying much more than I should.

However, a friend has an interestingly different approach: pay as little as possible in taxes throughout the year, set aside what you estimate your tax burden will be, keep the interest, and pay it all in one lump sum at tax time. They refer to this as "not giving the government an interest-free loan".

Edited to add: I never thought I'd say this, but... I miss HMRC.


Consider applying for YC's Summer 2025 batch! Applications are open till May 13

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

Search: