What is this ungoogleable operator called?
-
I need to look up the specifics of the "?." C# operator, which is a null safe way of accessing properties, but Google completely ignores ?. in searches. What's the proper name that I can search for?
I thought it was the null coalescing operator, but that's ??
-
Found it, it's the null conditional operator
-
I call it 'the one-eyed Elvis'.
-
I mistaken it with ? ... : ...
-
@coldandtired said in What is this ungoogleable operator called?:
I call it 'the one-eyed Elvis'.
I've seen "Elvis Operator" used as a name for it.
-
@Jaloopa said in What is this ungoogleable operator called?:
Google completely ignores ?. in searches
https://www.google.hr/?gfe_rd=cr&ei=QULeWJPQItPPXt29iuAM&gws_rd=ssl#q="?."+operator+c%23&*
NOOOOOOOOOOB!
EDIT: also, seems to be called
safe navigation operator
-
Ignores it. Although I should have tried including "operator"
-
@Jaloopa I did manage to find multiple results that found the term a bit lower down:
As to why most results suck... I'm buttuming this is a combination of Google trying to be "helpful" again, and the fact that the operator might be mentioned inside tables or similar elements on the sites themselves which, AIUI, have less of a weight when indexing the page.
-
@Onyx It can't be that ba-
Wow. Google, you suck.
Edit: A tweak, and I found what I was looking for:
http://enterprisecraftsmanship.com/2015/05/11/3-misused-of-operator-in-c-6/
-
@RaceProUK said in What is this ungoogleable operator called?:
Wow. Google, you suck.
A search for "Google search sucks" seems to indicate that Google has sucked since at least 2008.
-
@RaceProUK said in What is this ungoogleable operator called?:
Edit: A tweak, and I found what I was looking for:
http://enterprisecraftsmanship.com/2015/05/11/3-misused-of-operator-in-c-6/Oh, by the way, that article can be summed up as
Don't write shit code.
-
@El_Heffe said in What is this ungoogleable operator called?:
A search for "Google search sucks" seems to indicate that Google has sucked since at least 2008.
Altavista FTW!
-
@boomzilla I like using duckduckgo when Google insist in localized results I don't want
-
It's called "the question-dot operator", obviously. :P
-
@aliceif said in What is this ungoogleable operator called?:
@coldandtired said in What is this ungoogleable operator called?:
I call it 'the one-eyed Elvis'.
I've seen "Elvis Operator" used as a name for it.
I think C#'s version of Elvis would be
??
.There's also
?[]
, and I dare you to name that one.
-
@Maciejasjmj Surprise operator? (box with a question mark on it)
-
@Maciejasjmj said in What is this ungoogleable operator called?:
There's also
?[]
, and I dare you to name that one.What the empty checkbox?
-
@Maciejasjmj Robot Elvis?
-
@Maciejasjmj said in What is this ungoogleable operator called?:
There's also
?[]
, and I dare you to name that one.Easy! It's the mystery box!
-
I don't see what's so hard about googling that.
-
This operator. It is my new favorite. I really need to start reading the C# language change notes.
-
@Weng I'm just starting to use the new stuff introduced in C#6 (inline string formatting is also pretty nifty). I'll probably get to the C#7 ones in a couple of years
-
@anotherusername Or they could just give us options.
-
it's for matching zero or one characters but use jquery instead plz upvote.
-
@Lorne-Kates can you sent me teh codes? My address is gulliblefuckwit@hotmail.com
-
@Jaloopa said in What is this ungoogleable operator called?:
@Lorne-Kates can you sent me teh codes? My address is gulliblefuckwit@hotmail.com
some malicious code that steals all your cookies but I'm too arsed to write for a fucking joke.js
-
@Weng said in What is this ungoogleable operator called?:
This operator. It is my new favorite. I really need to start reading the C# language change notes.
Join the banking industry and you'll never feel overwhelmed by "what's new" change notes in your tools again.
-
@wharrgarbl said in What is this ungoogleable operator called?:
@Weng said in What is this ungoogleable operator called?:
This operator. It is my new favorite. I really need to start reading the C# language change notes.
Join the banking industry and you'll never feel overwhelmed by "what's new" change notes in your tools again.
QFT.
I was complaining to some friends who work in banking a while back that I was still stuck on VS2010 for some projects and even 2008 for one or two things, and they told me that they had just upgraded from 2005 to 2008 on a couple of projects
-
@Jaloopa Inline string formatting was my previous favorite.
-
@Jaloopa said in What is this ungoogleable operator called?:
and they told me that they had just upgraded from 2005 to 2008 on a couple of projects
Your friends are lucky, this is bleeding edge
-
@wharrgarbl said in What is this ungoogleable operator called?:
@Weng said in What is this ungoogleable operator called?:
This operator. It is my new favorite. I really need to start reading the C# language change notes.
Join the banking industry and you'll never feel overwhelmed by "what's new" change notes in your tools again.
Not overwhelmed. More like fucking overjoyed at my deliverance from shitty boilerplate.
-
@Weng said in What is this ungoogleable operator called?:
This operator. It is my new favorite. I really need to start reading the C# language change notes.
-
@Weng Seriously, while it is very useful sometimes, it's almost as dangerous as the new Tuple madness if you always use it.
Valid C#7:
abstract (string name, int id) ReadName(XElement element);
-
@Magus Huh. What does it do?
-
@JBert The return type is a tuple with named properties. I believe it's immutable?
-
@Magus oh god I've turned into Ben_Lubar... I was about to comment that Go can totally do that
-
@Yamikuronue I don't WANT C# to be able to!
-
@Magus Sounds useful for quick hacks.
Wouldn't use it for production code, though
-
@Yamikuronue said in What is this ungoogleable operator called?:
oh god I've turned into Ben_Lubar
-
@Weng said in What is this ungoogleable operator called?:
@Magus Sounds useful for quick hacks.
Wouldn't use it for production code, though
What it sounds like to me is a better version of Anonymous Types, which has always seemed like a massive ever since it first was introduced to support LINQ. This is like a concrete Anonymous Type that you can actually do useful things with, such as return from functions or pass to functions as a parameter.
-
@Magus said in What is this ungoogleable operator called?:
@Yamikuronue I don't WANT C# to be able to!
Returning tuples is perfectly acceptable[citation needed] in JavaScript and Python.
-
@masonwheeler Anonymous types are for kludging a bit of annoying data for a moment or two. This multiplies the problem!
-
@masonwheeler said in What is this ungoogleable operator called?:
This is like a concrete Anonymous Type that you can actually do useful things with, such as return from functions or pass to functions as a parameter.
The massively wrong things, you mean.
That's the point, anonymous types are a kludge, but they're a localized kludge. Your implementation might be shit because you're too lazy to write a class, but at least that's confined to the single method implementation. With the tuples, you're leaking it to your interface, And That's Terrible.
-
@aliceif I've always seen Elvis used for ?:
-
@Zecc said in What is this ungoogleable operator called?:
@Weng said in What is this ungoogleable operator called?:
This operator. It is my new favorite. I really need to start reading the C# language change notes.
Yeah, I was fucking surprised when Visual Studio did that to me.
-
@Magus said in What is this ungoogleable operator called?:
This multiplies the problem!
Oh, is that what they mean by "bug reproduction"?
-
@Maciejasjmj said in What is this ungoogleable operator called?:
The massively wrong things, you mean.
That's the point, anonymous types are a kludge, but they're a localized kludge. Your implementation might be shit because you're too lazy to write a class, but at least that's confined to the single method implementation. With the tuples, you're leaking it to your interface, And That's Terrible.
Are lambdas "shit implementation for people too lazy to write a method"?
-
@masonwheeler That depends.
In a
.Where(x => x.Category == Categories.Thing)
? Lambdas are exactly what you want.In a
.Where(x => x.Category == Categories.Thing && thingsAreGoingWell && (x.Whatever == somethingElse || x. Whatever == bleh))
? WRITE A METHOD!
-
@xaade said in What is this ungoogleable operator called?:
@anotherusername Or they could just give us options.
They do give us options. Almost precisely where you positioned them, too.
-
@Magus Exactly.
How many times have you written out an entire struct definition to hold some tiny collection of data members that doesn't get used anywhere outside a particular class or namespace, or abused
KeyValuePair<TKey,âTValue>
to squish together two items that are not conceptually a key/value pair, just because it's there?Named tuples are ideal for cases like those, and a bad idea for more complicated cases, in much the same way as lambdas.