|
Let me guess, they use yarn to manage the dependencies? Probably uses a command line interface for any updates which is all the rage these days. No doubt they call that cli-MIT change.
|
|
|
|
|
They can take care of the "perl one", I'll handle the "stroke one", as many times as I can for all the babes they're going to put out of work.
I'm beginning to be in favour of AI-generated code.
If the people who write the code that puts other people out of work felt their pain, they might actually switch their brains to the "I'm not a self-absorbed, uncaring @rsehole!" mode.
If the only way to make them feel that pain is AI-generated code, then I'll stop working on generating useful AIs, and focus on hurting w@nkers who don't give a toss about the repercussions of the code they write.
I wanna be a eunuchs developer! Pass me a bread knife!
|
|
|
|
|
Now, here's something that's real spaghetti
|
|
|
|
|
Putting grandmothers everywhere out of the cheesy sweater business.
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’m seeing thousands of return null statements in recent code reviews. Yes, I know you’ll find my fingerprints on some of that code, but as my mom used to say: "live and learn". Never say never again!
Between shocks and nulls, I guess that's the theme for today. As a bonus crossover event - "Never say never again" was a remake of "Thunderball". (close enough to lightning?)
These are the things that keep us alive some days.
|
|
|
|
|
Oh, so null != cubed russet potatoes, julienned baby carrots, and diced red onions.
OK, got it.
Thanks, Pal.
nerf
I wanna be a eunuchs developer! Pass me a bread knife!
|
|
|
|
|
The guy’s an idiot. You do what’s appropriate for the situation. If a null return value is warranted, then by the hounds of hell, return a f*ckin null.
".45 ACP - because shooting twice is just silly" - JSOP, 2010 ----- You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010 ----- When you pry the gun from my cold dead hands, be careful - the barrel will be very hot. - JSOP, 2013
|
|
|
|
|
Software Zen: delete this;
|
|
|
|
|
I seem to write a lot of methods that return an IEnumerable<T> where I use 'yield return' ... what else would I use when there are no T's to return ? default(T) is going to fail, or give me an instance.
«Where is the Life we have lost in living? Where is the wisdom we have lost in knowledge? Where is the knowledge we have lost in information?» T. S. Elliot
|
|
|
|
|
|
Thanks, but,
using: yield return Enumerable.Empty<T>
would require the return type of the Function to be:
IEnumerable<IEnumerable<T>>
and, in the context of Linq enumeration, return without yield will result in an error.
And, that would mean you could not use yield return someinstanceofT; Keep in mind the context here is an Extension method using Linq enumeration to return an IEnumerable<T>
«Where is the Life we have lost in living? Where is the wisdom we have lost in knowledge? Where is the knowledge we have lost in information?» T. S. Elliot
|
|
|
|
|
Right you are, think I was thinking about standard functions rather than ones that yield.
|
|
|
|
|
Either yield break; , or just return from the method without issuing any yield return ...; statements.
The caller will get back a non-null IEnumerable<T> instance which produces no elements.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Thanks, Richard, while the result of 'yield return null' and 'yield break' are the same, and using 'break saves typing 6 characters ... somehow I find yielding 'null more ... uhhh ... mnemonic.
Richard Deeming wrote: return from the method without issuing any yield return given that I expect these methods to return stuff most of the time, there has to be some use of the 'yield statement, or you are going to hear the old song: "not all code paths ..." maybe I am missing the point you are making ?
«Where is the Life we have lost in living? Where is the wisdom we have lost in knowledge? Where is the knowledge we have lost in information?» T. S. Elliot
|
|
|
|
|
BillWoodruff wrote: the result of 'yield return null' and 'yield break' are the same
But they're not though.
static IEnumerable<string> YieldReturnNull()
{
yield return null;
}
static IEnumerable<string> YieldBreak()
{
yield break;
}
static void Main()
{
Console.WriteLine("Yield return null:");
foreach (string item in YieldReturnNull())
{
Console.WriteLine("Item: {0}", item);
}
Console.WriteLine();
Console.WriteLine("Yield break:");
foreach (string item in YieldBreak())
{
Console.WriteLine("Item: {0}", item);
}
Console.WriteLine();
} Yielding | C# Online Compiler | .NET Fiddle[^]
Output:
Yield return null:
Item:
Yield break: yield return null; creates an enumerator which returns a single item. yield break; creates an enumerator which doesn't return any items.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
@RichardDeeming
Hi Richard, Thanks for (as always) enlightening !
I will respond to this in depth with a post on the C# forum ... in a few days ... that I hope might spark a "best practices" discussion. I went back and searched my code for the last year for instances of 'yield break' ... I have been using it, along with the 'other.'
«Where is the Life we have lost in living? Where is the wisdom we have lost in knowledge? Where is the knowledge we have lost in information?» T. S. Elliot
|
|
|
|
|
I return nulls a lot. I think twice before I don't check for nulls. Still I do that less often than some people.
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've totally stopped returning NULL. i'm writing Go. it uses 'nil' instead.
|
|
|
|
|
Mission accomplished!
TTFN - Kent
|
|
|
|
|
The author of that article should read up a good book on Functional Programming to learn better options to what he described.
Oh sanctissimi Wilhelmus, Theodorus, et Fredericus!
|
|
|
|
|
Lol, returning a default value, like in his example a connection string to the wrong database, yeah right
modified 20-Oct-19 21:02pm.
|
|
|
|
|
With its well-thought-out rebuild of Dart 2 five years later, Google seemed to have proven its commitment to the language. Indeed, today it continues to gain traction among developers—especially Java and C# veterans. She makes a few good points
Let the punnage revenge flow over me now - like sticky mushroom gravy (that part wasn't a pun, I'm not a fan of gravy)
|
|
|
|
|
|
A-wow, what a square, don't you dig the scene?
I wanna be a eunuchs developer! Pass me a bread knife!
|
|
|
|
|
This is going to be possibly insensitive but was that author ALWAYS a she? If I get a hand slap about this so be it.
|
|
|
|