|
Yeah, that would be marginally useful in those rather rare cases when I use params . Marginally useful + rare cases = I'll never remember this new feature when it comes out.
|
|
|
|
|
It seems to have confused Steven already!
Quote:
PrintNumbersUseList([1, 2, 3]); That already works in C# 12, without using the params keyword:
SharpLab[^]
What this feature adds is the option to remove the collection expression:
PrintNumbersUseList(1, 2, 3); SharpLab[^]
There's not a huge difference in the lowered code between the two:
List<int> list = new List<int>(3);
list.Add(1);
list.Add(2);
list.Add(3);
PrintNumbersUseList(list);
List<int> list = new List<int>();
CollectionsMarshal.SetCount(list, 3);
Span<int> span = CollectionsMarshal.AsSpan(list);
int num = 0;
span[num] = 1;
num++;
span[num] = 2;
num++;
span[num] = 3;
num++;
PrintNumbersUseList(list); I'd be interested to know whether there's a genuine performance benefit to the C# 13 approach, or whether it was just done that way so that the bulk of the params -lowering code only ever has to deal with Span<T> types.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
The ruling follows a similar decision denying patent registrations naming AI as creators. They'll just have to get some meatbag to pose as the inventor
|
|
|
|
|
Microsoft added the mixed reality platform to a list of deprecated Windows features. Do they think they're Google now?
Yet another reason I tend to avoid buying Microsoft hardware. They never seem to last very long. (although I have owned their mice and keyboards, but I'm still suspicious)
|
|
|
|
|
The difference between 1983 and 1993 is vast. Since then, not so much "Don’t you see if you want something better, and better, and better, you lose the good"
|
|
|
|
|
The real question is can Doom run Doom? We know it ran on Windows NT.
|
|
|
|
|
Problem that hit university students and businesses is thankfully resolved It must have affected some exec at the company
|
|
|
|
|
As the more code you add to an application, the slower development becomes, I view all code as technical debt. So avoid debt - don't write any code
|
|
|
|
|
The feedback we’ve received since our announcement and launch of .NET Aspire last month has been amazing! For those that aspire to reach for The Cloud
|
|
|
|
|
A number of auto dealers have deployed ChatGPT-powered conversational artificial intelligence (AI) tools, or chatbots, as a way to provide quick, customized on-demand information to online car shoppers. Never trust an AI car dealer?
Or is it just AI used car dealers? Used AI car dealers?
|
|
|
|
|
Aahh, the sweet smell of payback. After dealerships played the markup game to the point where a small number of dealerships ended up with double the MSRP, it's nice to see a consumer beat them at their own game.
|
|
|
|
|
An international law enforcement operation codenamed 'Operation HAECHI IV' has led to the arrest of 3,500 suspects of various lower-tier cybercrimes and seized $300 million in illicit proceeds. Did they finally catch up with those people copying DVDs?
|
|
|
|
|
Kent Sharkey wrote: Did they finally catch up with those people copying DVDs?
They're still working on the VHS copying masterminds.
Freedom is the freedom to say that two plus two make four. If that is granted, all else follows.
-- 6079 Smith W.
|
|
|
|
|
We’re updating the Uno Platform VS Code extension to support the C# Dev Kit, replacing the older C# extension OmniSharp. For those that prefer C#
|
|
|
|
|
CyberRunner completed the labyrinth maze game in 14.48 seconds So much for trapping the AIs in mazes
I refused to type, "It's aMAZEing"
|
|
|
|
|
Bill Gates through the Gates Foundation and its partners, is looking into AI innovations to improve living conditions in low-income areas across the world. And he's never been wrong in the past
(no one mention Windows Millennium Edition)
|
|
|
|
|
I'm not sure how AI can solve war, strife, child/women abuses, food and water shortages, lack of education opportunities, cast systems, drug problems, and religious dictates/dictators.
Sorry, that probably should have gone in the old "Soapbox" forum, but the point is, what is Bill smoking that he thinks AI can solve problems that have to do with people, not technology?
|
|
|
|
|
But...but...it can draw funny pictures! Perhaps a nice illustration of "a corgi in a smoking jacket blowing bubbles out of a pipe while skateboarding" will solve the Israel-Palestine conflict finally?
Yeah, there's some heavy-duty Kool-Aid drinking going on there.
TTFN - Kent
|
|
|
|
|
Kent Sharkey wrote: Perhaps a nice illustration of "a corgi in a smoking jacket blowing bubbles out of a pipe while skateboarding" will solve the Israel-Palestine conflict finally?
Well, they've tried (almost) everything else...
Freedom is the freedom to say that two plus two make four. If that is granted, all else follows.
-- 6079 Smith W.
|
|
|
|
|
IMHO most of those things you mentioned cannot actually be solved. At best they can be managed.
While AI might be able to help in that management a bit the bigger problem is AI/robotics/automation putting too many people out of work in the coming decade or two. The world needs to figure out what to do with several billion chronically unemployed souls.
|
|
|
|
|
What about Bob? Which was worse?
I’ve given up trying to be calm. However, I am open to feeling slightly less agitated.
I’m begging you for the benefit of everyone, don’t be STUPID.
|
|
|
|
|
Over the past few years, the C++ community has coped with challenging social media situations, calls for a so-called successor, and signs of upcoming anti-C++ safety regulations. And the best little C++ it could ever be
|
|
|
|
|
Except in the case of real time systems, C and C++ need to be retired.
|
|
|
|
|
Why? They are perfectly fine languages for those who want to understand programming. I'd argue that C++ is better in many ways, because it has easier-to-use constructs for memory management without leaks, but maybe that's just me.
|
|
|
|
|
David O'Neil wrote: Why? They are perfectly fine languages for those who want to understand programming. Assuming that "programming" means "generating the proper machine instructions". If you want to learn basic computer hardware, C/C++ is almost as good a tool as assembler.
On the other hand, if "programming" means "systematically develop methods to solve an application problem", then you work in terms of the application domain. The user rarely if ever care about (or even know about) "memory leaks", constructors and destructors, even the difference between a float and a double. The user knows if a numeric value represents a count (or integer, as we call it) or a measurement (we call it floating point).
And so on. C/C++ is perfectly fine for managing a lot of tiny little details that have no direct relevance to the application problem. Managing the tools. Less so for solving the problem at the conceptual level.
I prefer to develop problem solutions at the application level without being concerned about memory leaks, cache, locality, stack alignment, overflow exception handlers, destructors, type casting, pointer arithmetic ... When the way to arrange the data and how to manage them to solve the problem is in place, and I go looking for a way to implement it on a computer, picking a language, I may of course say that "stack alignment and memory leaks are super essential for this to run!" that I go for C/C++. Or I could say: "I trust the compiler and runtime system to handle low level technical details is the best, or certainly good enough, way", and choose a language where you don't control those details, and don't have to worry about them. You worry about the application problem being solved in a correct way.
I have done my share of assembly, C and C++ programming. C# is one step up (unless you insist on digging down into the details, then it is just half a step), but only one step. The stairway is long.
Programmers tend to ridicule application-near languages and methodologies, and do not realize that the reason why these languages survive is that they don't bother the user with leaks, cache and multiple inheritance. Maybe a language allows some low level manipulation, but you don't have to. Can you do bit field manipulation in VB6? Maybe, but who cares. Even if you could do pointer arithmetic (if it was meaningful), I am quite sure that those who still program in VB never make use of it, or even know what it is. That is the reason why VB still lives: The programmer (who is often an application domain expert rather than a PhD in bit fiddling) doesn't know and doesn't care about those hardware details that are so essential to C/C++ people.
Besides: K&R C was little more than a set of assembler macros. You really could tell from the source code what the CPU was going to do. With OO, multiple inheritance, virtual and abstract functions, optimizing compilers and whatnot you still have an illusion of being close to the hardware, but fact is that a good share of C++ programmers do not have a clue about how, say, multiple inheritance works at the machine code level. So in small, selected areas you can use libraries (still hiding the machine code level that you really want to control) to give you an even stronger illusion of being in control. You don't have to, but still you have to cope with memory leaks and integer overflow. You pay the price, but without reaping the benefits of not having to worry about the details.
If your application domain is the inner workings of an OS, or a compiler, C/C++ may be a reasonable choice. For application problem solving, the things that C/C++ is really good at are not relevant at all.
|
|
|
|