|
So that would just wrap it in a try/catch(NullReferenceException) { return null; }?
Yeah, I assume the built in version would check at each operator which would probably be faster in most cases. Your method would also swallow null reference exceptions thrown from with functions which might or might not be what you want.
|
|
|
|
|
The idea was that it would use expression trees to break apart each call and check for nulls at each step.
|
|
|
|
|
Oh, that's cool. I sometimes forget how easy it is to do magic like that.
|
|
|
|
|
(disclaimer: I'm not a C# developer.)
Nice!
but I have a question.
What kind of error/message do you get when one of the chain "member" returns null ?
Is it easy to debug and maintain ?
I'd rather be phishing!
|
|
|
|
|
Maximilien wrote: What kind of error/message do you get when one of the chain "member" returns null ?
I think you missed the part that I copied where it stated that if any of the references evaluates to null, then the entire expression evaluates to null.
Maximilien wrote: Is it easy to debug and maintain ?
I haven't used it. I'm just looking forward to using it. I assume you can hover over parts of it just like any other C# expression, or you can use the immediate window. Is that what you are asking?
|
|
|
|
|
|
When I read the title, I expected to see John's name but...no John.
|
|
|
|
|
Brilliant! I've got to make me a Denial of Service Dog!
Will Rogers never met me.
|
|
|
|
|
From Apollo Robin[^], one of the best I have listened to yet.
~RaGE();
I think words like 'destiny' are a way of trying to find order where none exists. - Christian Graus
Entropy isn't what it used to.
|
|
|
|
|
|
...and *gulp* bought a Corel product.
Specifically, Corel PaintShop Pro X6 (it was a gooood offer!) to replace my beloved - but aged - JASC PaintShop Pro 9, of 2004 vintage.
Oh boy, is it different...I can't even get the toolboxes arranged sensibly...time to RTFM
I may be some time...
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
You have my sympathy, I am trying to learn my around Eclipse (& Java) should be no trouble, I think not...
|
|
|
|
|
Java looks OK but I must admit Eclipse put me right off android development!
Have you looked at Android Studio[^]? I've heard some very good things about it - and installed it but not found the time to learn how to play with it yet.
Any good interviews in prospect?
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
Well I will have a look at Android Studio, Had four(!) interviews so far, nothing really positive from any of them, I remember when I graduated there were no grad jobs. It seems to me that either they want 20+ years or no years experience. When I had 0 years no one would give me a job cos of the 0 years, 5 years was the minimum now I have 5 years I'm too experienced for the role(!) and not experienced enough for the senior roles...
I have too much hardware experience for a pure software role and too much software for a pure hardware role. I am starting to give up!
|
|
|
|
|
Paint.NET[^] is a damn fine and free app that you may wish to look at.
Government is not reason; it is not eloquent; it is force. Like fire, it is a dangerous servant and a fearful master. ~ George Washington
|
|
|
|
|
For some reason, I was never a fan of Paint.NET and always used PhotoFiltre[^].
|
|
|
|
|
Personally, I shy away from most free apps; there are exceptions, though.
|
|
|
|
|
Agreed. My only complaint has been the startup time of the new version; it takes an age to get going.
Software Zen: delete this;
|
|
|
|
|
On my computer it starts within a second.
Dual Core i7 (4 logical core) with hyperthreading, 8 GB RAM, 1 TB Hybrid HDD (Only core system files/drivers are on the SSD part. Everything else is on the normal HDD part).
What do you get when you cross a joke with a rhetorical question?
---
The metaphorical solid rear-end expulsions have impacted the metaphorical motorized bladed rotating air movement mechanism.
|
|
|
|
|
i5, 4G RAM, normal HDD. It takes 8-10 seconds to start .
Software Zen: delete this;
|
|
|
|
|
Brisingr Aerowing wrote: On my computer it starts within a second. Same here. Home (i5, 8GB, normal HD) and work (i5, 8GB, SSD)
Government is not reason; it is not eloquent; it is force. Like fire, it is a dangerous servant and a fearful master. ~ George Washington
|
|
|
|
|
What you bought is a bit bloated but I like Corel's PSP product overall. I have used PSP (jasc and corel). It takes some time to get used to but I think you will like it if you give it some time. Youtube and other sites have good tutorials.
|
|
|
|
|
Yeah, I've used PSP9 for ten years or so, and it works brilliantly - I upgraded from PSP7 (IIRC). And of course when Corel bought JASC I didn't upgrade, knowing Corel's propensity for "Add bloat, add bugs, remove features, ship" development.
But...PSP9 is kinda long-in-the-tooth, and it's a pain doing screenshots on Win7 (because it doesn't support Aero, so it's "snap, start PSP, deal with image, stop PSP, snap, start PSP, repeat") and with the release of X7 I got a very good deal on X6.
Hopefully, despite the bloat it'll be as good...
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
The box for X2 had been sitting on my shelf for about eight years, because I'd installed it on an older machine when I bought it, then immediately uninstalled and reverted to PSP9.
I installed on my latest desktop, a couple of months ago, because I'd been using X4 at work, and was accustomed to the way it handled windows/zooming/cropping/etc.
A few (for me) necessary installation prerequisites were:
a: No, it may not run anything TSR at startup.
b: No, it may not install a catalogue that searches my HDDs/local network/entire ****ing Internet for pictures.
c: No, it may not install anything that is not actually part of the app.
d: That hideous, black, "I wanna be cool like apple", UI has to go.
Once that's all sorted out, it's fine; like a normal upgrade to PSP.
I wanna be a eunuchs developer! Pass me a bread knife!
|
|
|
|
|
Mark_Wallace wrote: d: That hideous, black, "I wanna be cool like apple", UI has to go.
Oh yes. One of the first things I found was the "light grey" option.
Then the "dual monitor" selection...
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|