The Lounge is rated PG. If you're about to post something you wouldn't want your
kid sister to read then don't post it. No flame wars, no abusive conduct, no programming
questions and please don't post ads.
It might be simpler to just push the test down into a function call.
This keeps the calling method simple, making the code more understandable and maintainable. Anyone maintaining the code doesn't have to reason about a unique control structure, and can skip all the details to focus on the overall algorithm. If they're curious about the test, they can optionally browse the testing function.
The chaining looks cool, but is more complex than a sequence of plain, vanilla, if statements.
Actually, there is something like that.
It's called Embarcadero Prism (ex Delphi Prism). Borland made Delphi Prism using the Oxygene language (ex Chrome) through some agreement with RemObjects Software. Borland needed it as a .NET language replacement for the trully crappy Borland Delphi.NET.
Check this beauty out: http://wiki.oxygenelanguage.com/en/Oxygene_by_Example_-_Colon_and_Null
You can't possibly call this cool. This is a code janitor's nightmare. If any part of that fails, you don't know what has failed so you end up breaking it down into
aa = Test.NotNull(myObject);
bb = aa.NotNull(myObject.MyProperty)
cc = bb.IsPositive(myObject.MyProperty.Id);
to see what is falling over.
Cool is only for those who make a mess then disappear off to another job and leave someone else to tidy up their mess. They've never had to maintain the crap they generate and they find it difficult to understand, let alone maintain someone else's mess. This means that you have to hire an expensive janitor to unravel the coolness.
You really don't want cool - you want maintainability so you can hire a cheap code janitor (fresh graddy).
As it is the beginning of the year I will make my picks for The Dead Pool.
1) Nelson Mandela (Celebrity Convict)
2) The Duke of Edinburgh (Racist and Diplomat)
3) George Bush Senior (Warmonger and Crook)
4) Peter O'Toole (Professional Alcoholic)
5) Ronnie Biggs (Holiday Maker)
1) Zsa Zsa Gabor (Serial Monogamist and Ring Collector)
2) Vera Lynn (Nazi Hunter and War Time Wank Material)
3) Margaret Thatcher (God and Saviour Of Mankind)
4) Doris Day (Virgin and Recluse)
5) Maureen O'Hara (Leprechaun and Harridan)
BTW Ralph Macchio (The Karate Kid) is 51 years old. How the hell did that happen?
--------------------------------- I will never again mention that I was the poster of the One Millionth Lounge Post, nor that it was complete drivel. Dalek Dave
Ralph Macchio (The Karate Kid) is 51 years old. How the hell did that happen?
Beats me... Last time I looked he was about 14!
I wonder what belt he would be wearing if he'd continued his studies? I got my first black belts at 51; imagine what I might have done with his head start!
On the other hand, Pat Benatar is 60 today, and her moves look mighty good to me still...
Good film. I always felt Lazenby was under rated, it's not like Moore was a better actor.
Panic, Chaos, Destruction. My work here is done.
Drink. Get drunk. Fall over - P O'H
OK, I will win to day or my name isn't Ethel Crudacre! - DDEthel Crudacre
I cannot live by bread alone. Bacon and ketchup are needed as well. - Trollslayer
Have a bit more patience with newbies. Of course some of them act dumb - they're often *students*, for heaven's sake - Terry Pratchett
#6 I will not gloat over my enemies' predicament before killing them.
#7 When I've captured my adversary and he says, "Look, before you kill me, will you at least tell me what this is all about?" I'll say, "No." and shoot him. No, on second thought I'll shoot him then say "No."
#11 I will be secure in my superiority. Therefore, I will feel no need to prove it by leaving clues in the form of riddles or leaving my weaker enemies alive to show they pose no threat.
Did you ever see history portrayed as an old man with a wise brow and pulseless heart, waging all things in the balance of reason?
Is not rather the genius of history like an eternal, imploring maiden, full of fire, with a burning heart and flaming soul, humanly warm and humanly beautiful?
Training a telescope on one’s own belly button will only reveal lint. You like that? You go right on staring at it. I prefer looking at galaxies.
-- Sarah Hoyt