|
Tell Microsoft - if they don't know about it, then they can't fix it.
Not that they do fix bugs, of course...
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
Hmm, I've maybe had to use named parameters a handful of times but never had any issues. Possibly stupid question but have you ensured the ordering is correct? Named parameters are evaluated in order passed not by the ordering in the function passed-to. This may not be applicable but I never assume people's objects (Input in this case) are side-effect free.
Example:
static void Main(string[] args)
{
int num = 0;
Test(z: ++num, y: ++num, x: ++num);
Console.ReadKey();
}
public static void Test(int x, int y, int z)
{
Console.WriteLine($"X: {x}, Y: {y}, Z: {z}");
}
This is a pretty contrived example, but I can't reproduce with this, no matter how I arrange the named input:
static void Main(string[] args)
{
int x = 1, y = 2, z;
List<int> values = new List<int>() { 3, 4, 5, 6 };
IEnumerable<int> query1 = values.Where(num => num % 2 == 0);
IEnumerable<int> query2 = values.Where(num => num % 2 != 0);
Test(y: y, x: x, query2: query2, query1: query1, z: out z);
Console.WriteLine($"Z: {z}");
Console.ReadKey();
}
public static void Test(int x, int y, IEnumerable<int> query1, IEnumerable<int> query2, out int z)
{
Console.WriteLine("Inside Test:");
Console.WriteLine($"X: {x}, Y: {y}");
Console.Write("Even: ");
foreach (int val in query1)
Console.Write($"{val} ");
Console.Write("\nOdd: ");
foreach (int val in query2)
Console.Write($"{val} ");
Console.Write("\n");
z = 7;
}
|
|
|
|
|
I've always maintained that named parameters were a bad idea, and it sounds like your coworker has found a way to make my case.
Functions have signatures - I'm more than happy to rely on them; I should be able to remain completely ignorant of any and all implementation details (yes, I consider a parameter name to be an implementation detail I should not have to care about--ever).
IMO that's not a constraint - it's something I rely on.
|
|
|
|
|
dandy72 wrote: I consider a parameter name to be an implementation detail I should not have to care about--ever File.Replace(string, string, string, bool)... Good luck figuring out what those parameters are
Properly naming your variables (and classes, methods, parameters, etc.) is one of the first rules of clean code.
I don't name them when I call the function, but I sure as hell like to know what goes where.
|
|
|
|
|
Of course, it should have a name that makes enough sense that I can tell what I need to provide at a glance, without having to look at what the function does with the parameter (even assuming I had access to the source).
However my point was that I shouldn't need to know exactly how it's spelled out. For all I care, the documentation could say the third string is DriveLetter, whereas the actual implementation uses lpszDriveLetter or __drv0. Named parameters remove that abstraction (if you want to call it that).
|
|
|
|
|
I haven't run into this problem, and I haven't seen any reports of other people encountering it either. (Except yours, of course! )
Anything strange going on with the generated package?
Are you definitely using the same version of the package at run-time and compile-time?
Have you installed a non-standard version of Roslyn?
Can you reproduce the problem in a simple example project?
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
We even checkout out the project on my machine to try it there, but with the same results.
Haven't created a sample project yet.
|
|
|
|
|
Can you not see the bovines, because of their cowmooflage?
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
cowmooflage: Moove on, nothing to see here
Sin tack ear lol
Pressing the "Any" key may be continuate
|
|
|
|
|
That's an udderly ridiculous suggestion!
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Cud chew repeat that?
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 |
|
|
|
|
|
Where's the beef?
If you have an important point to make, don't try to be subtle or clever. Use a pile driver. Hit the point once. Then come back and hit it again. Then hit it a third time - a tremendous whack.
--Winston Churchill
|
|
|
|
|
This is bull***t!
DURA LEX, SED LEX
GCS 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--- ++>+++ y+++* Weapons extension: ma- k++ F+2 X
If you think 'goto' is evil, try writing an Assembly program without JMP. -- TNCaver
When I was six, there were no ones and zeroes - only zeroes. And not all of them worked. -- Ravi Bhavnani
|
|
|
|
|
Is there a joke hidden in there?
|
|
|
|
|
no I think that's a yoke
Sin tack ear lol
Pressing the "Any" key may be continuate
|
|
|
|
|
|
Now you're just milking it!
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
|
|
4th day at the new job, commuting to work, as the manager doesn't like people working remotely. The irony is, I remote in to my machine at home for various things, like CP, and cough working on stuff while I'm basically warming a seat here.
At least the first couple days were basically sitting around waiting for apps to install and TFS to download the code repos. Never thought I would say it, but I miss Git!
Yesterday was a bit more interesting, got in early and in an hour had the start of a test jig working for exercising the entry points that the application calls for custom business logic (everything here is XML packets!) Ironically, one of my coworkers popped in to my cube and asked if I had written anything yet that called some of the BL components.
There was much ooh'ing and aah'ing when I showed him the test jig.
Today is waiting for more security / authorization permissions so I don't get a 404 error when trying to run test code and hopefully getting some clear definition of what, besides warming a chair, I'm supposed to actually be doing.
The people are great, it's nice working with laid back and relaxed developers, though the aforementioned manager needs a few counterclockwise turns of the screw in his arse.
Marc
|
|
|
|
|
I hope that not only the people there are pleasant, but also the work you are going to do...
...when you finally get some work
Besides, to loosen the screw of a gas cylinder, you have to turn it clockwise
(in contrast to a normal bottle, at least here in Germany)
|
|
|
|
|
And the UK, and France. Probably everywhere. Its so you cant accidentally connect a flammable gas up to any other kind of connector.
|
|
|
|
|
I thought so, but wasn't sure. Therefore the "at least"...
|
|
|
|
|
Fans that spin clockwise (pretty much all of them) also have reversed/anti-clock threads (so they don't fall off when fan spins) - so if the size matches you could connect a gas bottle to say, a desk fan. (Not sure why you would - but probably already on u-tube somewhere.)
Sin tack ear lol
Pressing the "Any" key may be continuate
|
|
|
|
|
After having read this, that manager will need a few more counterclockwise turns of that screw.
"the debugger doesn't tell me anything because this code compiles just fine" - random QA comment
"Facebook is where you tell lies to your friends. Twitter is where you tell the truth to strangers." - chriselst
"I don't drink any more... then again, I don't drink any less." - Mike Mullikins uncle
|
|
|
|