|
this is strange... and has some weirdness to it too!
|
|
|
|
|
IsNull or HasValue?
|
|
|
|
|
I'd prefer IsNull or IsEmpty (depending on what it was)
but actually for those things I typically sidestep it altogether with
bool TryGetValue(...,out T value)
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.
|
|
|
|
|
Use YodaNaming: "EndedItIs" and "EndedItHas" - that way masked nicely any confusion is.
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
they would match my yoda conditionals like
if(null!=str) ...
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.
|
|
|
|
|
States
GetStates(State state) => IEnumerable<State>
GetAcceptingStates(State state) => IEnumerable<State>
GetNonAcceptingStates(State state) => IEnumerable<State>
GetStateStatus(State state) => enum
SetStateStatus(State state) => bool ? or error code ?
HasAcceptingStates(State state) => bool
IsStateAccepting(State state) => bool
«One day it will have to be officially admitted that what we have christened reality is an even greater illusion than the world of dreams.» Salvador Dali
|
|
|
|
|
That's very close to how it ended up.
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.
|
|
|
|
|
Is this simply confusion with IS_A and HAS_A ?
|
|
|
|
|
I WOULDN'T EVEN NAME MY CONSTANTS LIKE THAT.
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.
|
|
|
|
|
Those are concepts; not code.
|
|
|
|
|
I'm just messing with you.
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.
|
|
|
|
|
honey the codewitch wrote: But it leads me to weird things like "IsEnded" instead of "HasEnded" No criticism intended, but I use:
public bool Ended
{
get
{
bool value = false;
return value;
}
} I've never liked the IsCondition or HasThing naming style, probably because they have a whiff of Hungarian notation about them.
Software Zen: delete this;
|
|
|
|
|
when I'm in .NET land I adhere closely to the .NET naming conventions.
Over the years I've become far less about personal preference, and far more about when in Rome.
At best i tend to build on them rather than change them.
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.
|
|
|
|
|
honey the codewitch wrote: far more about when in Rome I have to do that a lot more now than I used to. My group has been down-sized from 17 to 5 people over the last 5 years, and so I get to maintain a fair amount of other folks' code. Sometimes it takes a shot of whiskey with a Zofran[^] chaser to stay consistent with how they did things, but as long as it pays the bills...
Software Zen: delete this;
|
|
|
|
|
I've had some good luck with Buddhism in terms of overcoming this.
Not trying to convert anyone - I'm not a buddhist myself, but my first serious boyfriend was and he drilled a lot of it into me when i was still impressionable.
The headshrinkers call it Dialectical Behavioral Therapy, but all it really means is just relax.
The world will keep turning no matter how people name things.
If I can understand it, then all is good. If I can't, then there is opportunity for growth in the challenge.
Or, more likely I'll just smash something.
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 a tree falls in the forest and no one hears it, is that a very risky situation for the hearing impaired?
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
Posting on a weekend? I see you've begun to branch out.
/ravi
|
|
|
|
|
Yes! And he's taking root on Sundays!
|
|
|
|
|
Perhaps he's turning over a new leaf?
/ravi
|
|
|
|
|
Taking after his father? The apple did not fall far from tree!
|
|
|
|
|
Yew guys
|
|
|
|
|
What can I say? We're firmly rooted in this kinda behaviour.
/ravi
|
|
|
|
|
Now don't pine - I was just trying to spruce things up.
|
|
|
|
|
Oaky-doaky
Software Zen: delete this;
|
|
|
|
|
If a tree falls in the forest and hits the H&S droid, is that a problem for anyone?
Freedom is the freedom to say that two plus two make four. If that is granted, all else follows.
-- 6079 Smith W.
|
|
|
|