Who wrote the "suggestions" part of VS 2019?
-
They're just trying to help Javascript programmers integrate into the .NET community. Coming from "falsey" and "truthy" to hard false and true can be quite traumatic! :laugh:
Latest Article - A 4-Stack rPI Cluster with WiFi-Ethernet Bridging Learning to code with python is like learning to swim with those little arm floaties. It gives you undeserved confidence and will eventually drown you. - DangerBunny Artificial intelligence is the only remedy for natural stupidity. - CDP1802
I remember one FORTRAN programmer that didn't trust 'em. He used to write code like this:
if (a == b)
...
else if (a != b)
...
else
...:sigh:
Sent from my Amstrad PC 1640 Never throw anything away, Griff Bad command or file name. Bad, bad command! Sit! Stay! Staaaay... AntiTwitter: @DalekDave is now a follower!
-
I'm a bad person....you're just evil :laugh:
-
I remember one FORTRAN programmer that didn't trust 'em. He used to write code like this:
if (a == b)
...
else if (a != b)
...
else
...:sigh:
Sent from my Amstrad PC 1640 Never throw anything away, Griff Bad command or file name. Bad, bad command! Sit! Stay! Staaaay... AntiTwitter: @DalekDave is now a follower!
-
And how did they escape from kindergarten? This time, my code looks like this:
XmlDocument xd = new XmlDocument(); xd.Load(@"D:\\Test Data\\author.xml"); xd.PreserveWhitespace = true;
And the final line has a "screwdriver" to show a "fix this suggestion" is available. And there are four options:
- Introduce a constant for "true"
- Introduce a constant for all occurrences of "true"
- Introduce a local constant for "true"
- Introduce a local constant for all occurrences of "true"
That's embarrassing. Visual Studio no longer considers
true
orfalse
to be constants in C# ... :-OSent from my Amstrad PC 1640 Never throw anything away, Griff Bad command or file name. Bad, bad command! Sit! Stay! Staaaay... AntiTwitter: @DalekDave is now a follower!
Yeah, well.. It's up to you what you're going to use a screwdriver for. If you decide to clean your windows with it it is your own fault. If they'd know that their suggestion is right it would become a compiler error anyways.
I only have a signature in order to let @DalekDave follow my posts.
-
And how did they escape from kindergarten? This time, my code looks like this:
XmlDocument xd = new XmlDocument(); xd.Load(@"D:\\Test Data\\author.xml"); xd.PreserveWhitespace = true;
And the final line has a "screwdriver" to show a "fix this suggestion" is available. And there are four options:
- Introduce a constant for "true"
- Introduce a constant for all occurrences of "true"
- Introduce a local constant for "true"
- Introduce a local constant for all occurrences of "true"
That's embarrassing. Visual Studio no longer considers
true
orfalse
to be constants in C# ... :-OSent from my Amstrad PC 1640 Never throw anything away, Griff Bad command or file name. Bad, bad command! Sit! Stay! Staaaay... AntiTwitter: @DalekDave is now a follower!
As millennials populate overseer positions with even younger ones under them, critical and "non critical" system failures will increasingly become more and more, the norm. like elevators and medical care. We're done for.
-
Solution - turn off the code suggestions feature
".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, 2013Exactly. And much of Resharper too. There's enough nanny state in the real world without it appearing in your IDE as well.
Regards, Rob Philpott.
-
And how did they escape from kindergarten? This time, my code looks like this:
XmlDocument xd = new XmlDocument(); xd.Load(@"D:\\Test Data\\author.xml"); xd.PreserveWhitespace = true;
And the final line has a "screwdriver" to show a "fix this suggestion" is available. And there are four options:
- Introduce a constant for "true"
- Introduce a constant for all occurrences of "true"
- Introduce a local constant for "true"
- Introduce a local constant for all occurrences of "true"
That's embarrassing. Visual Studio no longer considers
true
orfalse
to be constants in C# ... :-OSent from my Amstrad PC 1640 Never throw anything away, Griff Bad command or file name. Bad, bad command! Sit! Stay! Staaaay... AntiTwitter: @DalekDave is now a follower!
Well, you know that
true
could true for very large values offalse
, so you might as well plan ahead.Software Zen:
delete this;
-
And how did they escape from kindergarten? This time, my code looks like this:
XmlDocument xd = new XmlDocument(); xd.Load(@"D:\\Test Data\\author.xml"); xd.PreserveWhitespace = true;
And the final line has a "screwdriver" to show a "fix this suggestion" is available. And there are four options:
- Introduce a constant for "true"
- Introduce a constant for all occurrences of "true"
- Introduce a local constant for "true"
- Introduce a local constant for all occurrences of "true"
That's embarrassing. Visual Studio no longer considers
true
orfalse
to be constants in C# ... :-OSent from my Amstrad PC 1640 Never throw anything away, Griff Bad command or file name. Bad, bad command! Sit! Stay! Staaaay... AntiTwitter: @DalekDave is now a follower!
Googled and got this : true and false are lowercase reserved keywords. So yeah, 'true' is not a constant. The suggestions aren't wrong.
-
Wait! there is more!
public static readonly bool Maybe = new Rand().Next(2) == 0;
A new .NET Serializer All in one Menu-Ribbon Bar Taking over the world since 1371!
Actually literally laughed out loud like a maniachal despot in the office when I read this :laugh:
-
Actually literally laughed out loud like a maniachal despot in the office when I read this :laugh:
I think you might be ready for it! :thumbsup: :D
A new .NET Serializer All in one Menu-Ribbon Bar Taking over the world since 1371!