|
heh. yeah. except every time i think i rule the code shows me i'm still subordinate to the gods of the debugger.
But yeah i-interfaces in this code would be spurious at best.
that's not true of the runtimes component but i use abstract base classes instead of interfaces there, for reasons
When I was growin' up, I was the smartest kid I knew. Maybe that was just because I didn't know that many kids. All I know is now I feel the opposite.
|
|
|
|
|
What's the point of declaring collections for everything when I have generics for collections?
that was primary time saver moving from .NET 1.x to 2.0
I'm not going back.
I'd add, there's no reason for I-interfaces to be declared in this code.
There's no justification for it whatsoever.
When I was growin' up, I was the smartest kid I knew. Maybe that was just because I didn't know that many kids. All I know is now I feel the opposite.
|
|
|
|
|
codewitch honey crisis wrote:
if (null == result)
A fan of these "Yoda conditionals" I also used to be, hmmm, yes.
But with C# 7, I now prefer:
if (result is null)
If the null-coalescing assignment operator[^] makes it into C# 8, this line could be further simplified to:
result ??= new Dictionary<string, ICollection<(CfgRule Rule, string Symbol)>>();
Add in target-typed new expressions[^], and you can really annoy the var haters with:
result ??= new();
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
I love var but some of what you posted is too much. C# 12 will end up looking like perl at this rate. :/
I'm a fan of yoda conditionals for two reasons:
The first is old habits from back when compilers were more primitive (preventing accidental assignment)
The second is I've found that if you must use a series of ifs on the same target value it is easier to visualize what you're doing when the target is on the left hand side. For example
if("foo"==target)
else if("bar"==target)
else if("baz"==target)
that one obv is simple and can be changed to a switch but once you start adding || and && in there and breaking each subcomparison out on it's own line the difference is clear. yodaized looks better in the source in terms of figuring out what you're doing. The target being on the right makes it less distracting
When I was growin' up, I was the smartest kid I knew. Maybe that was just because I didn't know that many kids. All I know is now I feel the opposite.
|
|
|
|
|
I agree. It started as the same old habit to avoid accidental assignment, but I got used to it and still like it.
if (null == target) seems to make much more sense than if (target == null).
- I would love to change the world, but they won’t give me the source code.
|
|
|
|
|
This gets so much prettier in F#, where IDictionary<string,ICollection<(CfgRule Rule,string Symbol)>> simply becomes a type, like "RuleMap"
|
|
|
|
|
amen.
i'm half tempted to use linq but a lot of my queries wouldn't be much easier with linq.
the big thing is the typedefs. Even a more intelligent "using" would be helpful here.
When I was growin' up, I was the smartest kid I knew. Maybe that was just because I didn't know that many kids. All I know is now I feel the opposite.
|
|
|
|
|
A woman who taunts herself - you're attempting to draw me into soapbox quality material.
A definition that is, for some, an epiphany:
"Smut: The Stuff that Dreams are Made Of !"
(I warned you !)
Ravings en masse^ |
---|
"The difference between genius and stupidity is that genius has its limits." - Albert Einstein | "If you are searching for perfection in others, then you seek disappointment. If you are seek perfection in yourself, then you will find failure." - Balboos HaGadol Mar 2010 |
|
|
|
|
|
haha. don't worry, I'm not your type. you're not gay.
i get mistaken for a woman all the time. IRL and online.
it's part of my aesthetic.
When I was growin' up, I was the smartest kid I knew. Maybe that was just because I didn't know that many kids. All I know is now I feel the opposite.
|
|
|
|
|
If you can't even understand simple computer grammar yet, what chances do have men and women to understand each other?!
|
|
|
|
|
it's clearly hopeless =)
When I was growin' up, I was the smartest kid I knew. Maybe that was just because I didn't know that many kids. All I know is now I feel the opposite.
|
|
|
|
|
The simple answer to avoiding these things is to keep your code simple. The code you show there is complex, you are doing a lot on a single line. I know that grade-schools promote this, but it is not really that ideal when it comes to debugging.
|
|
|
|
|
Unfortunately the math behind it is really complex complicated*. I've figured most of it out by now.
*(A pet peeve of mine - complex and complicated are very different)
When I was growin' up, I was the smartest kid I knew. Maybe that was just because I didn't know that many kids. All I know is now I feel the opposite.
|
|
|
|
|
When the pun is not intended: Phrases that people get wrong[^]
Damp squids, indeed!
I have lived with several Zen masters - all of them were cats.
His last invention was an evil Lasagna. It didn't kill anyone, and it actually tasted pretty good.
|
|
|
|
|
It started well, but then got silly. Just seems like made up article filler for the most part.
I mean, I can't imagine anybody has every said "Taken for granite"... well, at least not anyone that actually speaks English.
|
|
|
|
|
err, maybe not in UK, USA, Aus...
but in Asia (including countries like Singapore where English is the [first] official language) I've seen those mistakes, more and worse.
Message Signature
(Click to edit ->)
|
|
|
|
|
True, I have heard it used by some French and Belgians & French speaking Canadian, but not by a native (UK, USA, New-Zeland, Oz etc.) Interestingly the 'Jack Of All Trades' the quote Jack of All Trades master of none. I always understood it as 'Jack Of All Trades, master of none, more use than master of one'...
modified 18-Jul-19 10:44am.
|
|
|
|
|
musefan wrote: Taken for granite I've actually seen that one
And I could care less is very common as well, come on people, how hard is it!?
That said, I didn't recognize about 90% of them, but the ones I did recognize I recognized correctly (except the thing/think)
|
|
|
|
|
Sander Rossel wrote: And I could care less is very common as well, come on people, how hard is it!?
I recall having a "robust discussion" with someone on here about that one some years ago. They couldn't quite grasp the idea that could care less implies a non-zero amount of caring at the moment.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
I had french customers who always wrote porpoise instead of purpose.
GCS d--(d+) s-/++ a C++++ U+++ P- L+@ E-- W++ N+ o+ K- w+++ O? M-- V? PS+ PE- Y+ PGP t+ 5? X R+++ tv-- b+(+++) DI+++ D++ G e++ h--- r+++ y+++* Weapons extension: ma- k++ F+2 X
|
|
|
|
|
That peaked piqued my interest.
|
|
|
|
|
Fairy interesting
|
|
|
|
|
I take that for grunted.
I have lived with several Zen masters - all of them were cats.
His last invention was an evil Lasagna. It didn't kill anyone, and it actually tasted pretty good.
|
|
|
|
|
|
the discussion is eating up …
|
|
|
|