> […] 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.
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 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.
> 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
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.
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.
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.
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!
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.”