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

Not all phrases’ meanings are derivable from the literal definitions of the words that make them up.


But this one definitely is!


> […] it shouldn't take long at all for people to learn the highly consistent naming conventions that tip you off to what type of data is being handled.

I’ve used languages with an approach like this. The difference in what I’ve used is that you separate the conventional part from the rest of the name with a space (or maybe a colon), then only refer to the value by the non-conventional part for the rest of the scope. Then the language enforces this convention for all of my co-workers! It’s pretty neat.


I don't get your 2nd sentence: "The difference in what I’ve used" ... Can you give an example, and name the language used?


Sure! Let’s say I want to enforce that a variable only ever holds an integer. Rather than put the conventional prefix and the name together, like this:

    var intValue = 3;
…I separate the conventional prefix with a space:

    int value = 3;
…so now my co-workers don’t need to remember the convention – it’s enforced by the language.

(I hope this makes the joke more obvious.)


I wasn't talking about Hungarian notation. I meant more like if you see a variable named `user` or `activeUser` you know that it's going to contain a predictably-shaped data object that describes a user. E.g. it will always have a `user.id` property. I would never call an string-ish ID a user, then. I would call it `activeUserId` or `userId` or just `id` if the distinction between those was already obvious from context... But that's very different from writing `strUserId` which I never do: I try to make sure my names always convey semantic distinctions.


Mhm! Exactly! In the system those other languages use, once you see the variable’s declaration:

    User activeUser
…you’ll always know that `activeUser` contains a User value – something that might have an `Id` property. And the convention is enforced by the language, so it’s easy to communicate. These semantic distinctions are very useful, I agree.


Haha I knew you'd say that. I'm not pretending there aren't advantages to strict systems of declared types. There are many! But my point is simple to the point of stupidity: there's just more stuff on screen when you have to write `User` twice. In this simple example it looks trivially simple to write the word "user" twice, but in a reasonably-complex real example the difference will be far more noticeable.


No, we don’t mind. Go ahead.


> Luckily, since type constraints are part of the signature of the method and there is no ambiguity, I am allowed to make this overload.

This isn’t the case. It’s allowed because the question-mark syntax means two different things in value- and reference-type contexts. The signatures really look like this:

    public static IEnumerable<TR> SelectNotNull<T, TR>(
      this IEnumerable<T> source,
      Func<T, TR> fn)
      where TR : class // …and the nullability of TR is tracked by the compiler

    public static IEnumerable<TR> SelectNotNull<T, TR>(
      this IEnumerable<T> source,
      Func<T, Nullable<TR>> fn)
      where TR : struct
This is an allowable overload.


What makes that "most likely," other than that you thought of it?


Occam's razor?


When you have advocacy groups going around in public saying "Look, we successfully pressured VISA/MC to do this", Occam's razor would suggest that that was true.


> How does one put a dollar value on a $10-30 GPT-4 pro subscription?

I’d estimate it at somewhere in the region of $10–$30, personally.


> - Translate feature doesn’t have a copy button

Sure it does. It’s labeled “Copy Translation”. It’s the first button under the translation for un-editable text.

> - Multitasking (apps should shut down after some time spent idle, instead they have to be manually closed)

Apps that aren’t working in the background shut down effectively as soon as they lose focus. Don’t let the list of screenshots fool you – those aren’t running. Don’t waste your time swiping them away.


> Sure it does.

I’m talking about the Translate app, not the in-line translator. If your text exceeded a certain length in the Translate app you couldn’t even select it. They might have fixed it in subsequent versions, but I wouldn’t know.


It’s had a copy button forever. It’s allows you to scroll, select, copy.


Is the answer (ROT13 for spoilers):

V vzntvar gung vg pbhyq abg or orpnhfr Frg erdhverf gur rkgen fngvfsnpgvba bs Rd, evtug?

After looking it up: Nu, lrf, ohg Beq. Vagrerfgvat ubj gung vzcyrzragngvba qrgnvy yrnxf.

Even later: Unat ba, gurer'f ab jnl vg pbhyq or rira vs gung fngvfsnpgvba pbhyq or birepbzr! Vzntvar n frg pbagnvavat sbhe naq artngvir sbhe naq lbh znc `fdhner` bire vg… Gur fvmr bs gur pbyyrpgvba jbhyq punatr!


> Even later: ...

Yes, now you've hit the crux of the problem. Does that violate the functor laws?


> Gur fvmr bs gur pbyyrpgvba jbhyq punatr!

Ubj vf guvf n ceboyrz gubhtu? Vg qbrfa'g frrz gb ivbyngr nal bs gur shapgbe ynjf!


> What precedent are we setting by explicitly making "murder someone" a viable path to making progress on your personal political agenda?

If this is what you are worried about, America is pretty far behind the leading edge:

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

https://www.cnn.com/2025/03/25/asia/court-dissolution-unific...


You’re responding to a comment containing a method call `thing.makeThingDoerForTest(1, 2, 3)` and saying “That's the trick - it is not test only code.”

Can you square those for me? I don’t get it.


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

Search: