VS 2022 a genuine wow moment
-
I was writing a little bit of code today to replace commas within double quotes enclosed text in a huge string. This string could have multiple segments of double quoted text. I had only written this bit
// Replace all the commas that are between double quotes
char[] linechars = line.ToCharArray();
bool isInQuotes = false;for (int i = 0; i < linechars.Length; i++)
{
if (linechars[i] == '"')//This was predicted by Visual StudioThis IDE can read my code and comments and predict the next if statement. This is amazing. P.S. Before someone points out miserable string handling, I really do not care about code quality. This is a one time use (quick or slow) and dirty utility.
"It is easy to decipher extraterrestrial signals after deciphering Javascript and VB6 themselves.", ISanti[^]
-
I was writing a little bit of code today to replace commas within double quotes enclosed text in a huge string. This string could have multiple segments of double quoted text. I had only written this bit
// Replace all the commas that are between double quotes
char[] linechars = line.ToCharArray();
bool isInQuotes = false;for (int i = 0; i < linechars.Length; i++)
{
if (linechars[i] == '"')//This was predicted by Visual StudioThis IDE can read my code and comments and predict the next if statement. This is amazing. P.S. Before someone points out miserable string handling, I really do not care about code quality. This is a one time use (quick or slow) and dirty utility.
"It is easy to decipher extraterrestrial signals after deciphering Javascript and VB6 themselves.", ISanti[^]
You must of spoken out loud and it heard you :-D
Life should not be a journey to the grave with the intention of arriving safely in a pretty and well-preserved body, but rather to skid in broadside in a cloud of smoke, thoroughly used up, totally worn out, and loudly proclaiming “Wow! What a Ride!" - Hunter S Thompson - RIP
-
I was writing a little bit of code today to replace commas within double quotes enclosed text in a huge string. This string could have multiple segments of double quoted text. I had only written this bit
// Replace all the commas that are between double quotes
char[] linechars = line.ToCharArray();
bool isInQuotes = false;for (int i = 0; i < linechars.Length; i++)
{
if (linechars[i] == '"')//This was predicted by Visual StudioThis IDE can read my code and comments and predict the next if statement. This is amazing. P.S. Before someone points out miserable string handling, I really do not care about code quality. This is a one time use (quick or slow) and dirty utility.
"It is easy to decipher extraterrestrial signals after deciphering Javascript and VB6 themselves.", ISanti[^]
It is pretty amazing sometimes - takes a bit of getting used to but it can really speed up your code. But even for a quick'n'dirty, that's rather long winded - especially if it's a long string as ToCharArray allocates memory and copies string content into it. You can index directly into a string, remember?
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt AntiTwitter: @DalekDave is now a follower!
-
I was writing a little bit of code today to replace commas within double quotes enclosed text in a huge string. This string could have multiple segments of double quoted text. I had only written this bit
// Replace all the commas that are between double quotes
char[] linechars = line.ToCharArray();
bool isInQuotes = false;for (int i = 0; i < linechars.Length; i++)
{
if (linechars[i] == '"')//This was predicted by Visual StudioThis IDE can read my code and comments and predict the next if statement. This is amazing. P.S. Before someone points out miserable string handling, I really do not care about code quality. This is a one time use (quick or slow) and dirty utility.
"It is easy to decipher extraterrestrial signals after deciphering Javascript and VB6 themselves.", ISanti[^]
It is amazing... until it is not... Wait and see - after enough suggestions you will find that most of them are plain stupid repetition of what you done before (a true no-brain op)...
“Real stupidity beats artificial intelligence every time.” ― Terry Pratchett, Hogfather
-
I was writing a little bit of code today to replace commas within double quotes enclosed text in a huge string. This string could have multiple segments of double quoted text. I had only written this bit
// Replace all the commas that are between double quotes
char[] linechars = line.ToCharArray();
bool isInQuotes = false;for (int i = 0; i < linechars.Length; i++)
{
if (linechars[i] == '"')//This was predicted by Visual StudioThis IDE can read my code and comments and predict the next if statement. This is amazing. P.S. Before someone points out miserable string handling, I really do not care about code quality. This is a one time use (quick or slow) and dirty utility.
"It is easy to decipher extraterrestrial signals after deciphering Javascript and VB6 themselves.", ISanti[^]
-
I was writing a little bit of code today to replace commas within double quotes enclosed text in a huge string. This string could have multiple segments of double quoted text. I had only written this bit
// Replace all the commas that are between double quotes
char[] linechars = line.ToCharArray();
bool isInQuotes = false;for (int i = 0; i < linechars.Length; i++)
{
if (linechars[i] == '"')//This was predicted by Visual StudioThis IDE can read my code and comments and predict the next if statement. This is amazing. P.S. Before someone points out miserable string handling, I really do not care about code quality. This is a one time use (quick or slow) and dirty utility.
"It is easy to decipher extraterrestrial signals after deciphering Javascript and VB6 themselves.", ISanti[^]
Quote:
This IDE can read my code and comments and predict the next if statement.
I`m not using VS 2022, a feature like that belongs to the realm of SF, really. Very original. Of course old fashion people (me included) might display appreciation towards this advancement in intellisense/autocomplete but will never actually use it in their projects.
-
Quote:
This IDE can read my code and comments and predict the next if statement.
I`m not using VS 2022, a feature like that belongs to the realm of SF, really. Very original. Of course old fashion people (me included) might display appreciation towards this advancement in intellisense/autocomplete but will never actually use it in their projects.
You might be surprised - it's actually pretty good. I'm not young - 63 - but I'm finding it handy to "fill in the blanks" with the drudge stuff: it works out what they heck you are likely to be trying to do and provides a default text that uses sensible variables you used earlier and suchlike. It does appear to use the variable names to help it decide as well, which is a damn good reason for using sensible names at all times instead of "quick to type" ones ... :-D Give it a try (the Community edition is free so there's not a lot of excuse) - it might surprise you! (It did me.)
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt AntiTwitter: @DalekDave is now a follower!
-
You might be surprised - it's actually pretty good. I'm not young - 63 - but I'm finding it handy to "fill in the blanks" with the drudge stuff: it works out what they heck you are likely to be trying to do and provides a default text that uses sensible variables you used earlier and suchlike. It does appear to use the variable names to help it decide as well, which is a damn good reason for using sensible names at all times instead of "quick to type" ones ... :-D Give it a try (the Community edition is free so there's not a lot of excuse) - it might surprise you! (It did me.)
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt AntiTwitter: @DalekDave is now a follower!
I use it for my hobby projects Paul and find it good - but I've never known a bad release of VS
Life should not be a journey to the grave with the intention of arriving safely in a pretty and well-preserved body, but rather to skid in broadside in a cloud of smoke, thoroughly used up, totally worn out, and loudly proclaiming “Wow! What a Ride!" - Hunter S Thompson - RIP
-
I was writing a little bit of code today to replace commas within double quotes enclosed text in a huge string. This string could have multiple segments of double quoted text. I had only written this bit
// Replace all the commas that are between double quotes
char[] linechars = line.ToCharArray();
bool isInQuotes = false;for (int i = 0; i < linechars.Length; i++)
{
if (linechars[i] == '"')//This was predicted by Visual StudioThis IDE can read my code and comments and predict the next if statement. This is amazing. P.S. Before someone points out miserable string handling, I really do not care about code quality. This is a one time use (quick or slow) and dirty utility.
"It is easy to decipher extraterrestrial signals after deciphering Javascript and VB6 themselves.", ISanti[^]
The
{get; set;}
auto-complete is great, and yes, the prediction is 80% amazing and 20% annoying in my experience. And the annoying isn't too annoying.dan!sh wrote:
I really do not care about code quality. This is a one time use (quick or slow) and dirty utility.
Well, in my experience, paying attention to code quality, no matter the requirements, always pays off. ;P Converting the string to a char array and then iterating over it with a for loop is a bit like walking away from the pilot seat without setting the auto-pilot. :laugh:
Latest Article:
Create a Digital Ocean Droplet for .NET Core Web API with a real SSL Certificate on a Domain -
The
{get; set;}
auto-complete is great, and yes, the prediction is 80% amazing and 20% annoying in my experience. And the annoying isn't too annoying.dan!sh wrote:
I really do not care about code quality. This is a one time use (quick or slow) and dirty utility.
Well, in my experience, paying attention to code quality, no matter the requirements, always pays off. ;P Converting the string to a char array and then iterating over it with a for loop is a bit like walking away from the pilot seat without setting the auto-pilot. :laugh:
Latest Article:
Create a Digital Ocean Droplet for .NET Core Web API with a real SSL Certificate on a DomainPerhaps you or someone else can explain this
{get; set;}
thing to me. There are times when having a getter is appropriate, but far fewer times when having a setter is appropriate. I'm surprised that they make it so easy to mindlessly provide one.Robust Services Core | Software Techniques for Lemmings | Articles
The fox knows many things, but the hedgehog knows one big thing. -
You might be surprised - it's actually pretty good. I'm not young - 63 - but I'm finding it handy to "fill in the blanks" with the drudge stuff: it works out what they heck you are likely to be trying to do and provides a default text that uses sensible variables you used earlier and suchlike. It does appear to use the variable names to help it decide as well, which is a damn good reason for using sensible names at all times instead of "quick to type" ones ... :-D Give it a try (the Community edition is free so there's not a lot of excuse) - it might surprise you! (It did me.)
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt AntiTwitter: @DalekDave is now a follower!
nice, soon you will only need to write the first half of your program, the IDE will figure out the other half on his own
-
nice, soon you will only need to write the first half of your program, the IDE will figure out the other half on his own
:laugh: It's not quite that good, but if you do something like this:
var bananas = Fruit.GetFruits(Color.Yellow);
Then later in the method type
foreach(
it will autofill with this:foreach(var f in bananas)
If (as I much prefer) you use an explicit type:
List bananas = Fruit.GetFruits(Color.Yellow);
Then the autofill is explicit as well:
foreach(Fruit fruit in bananas)
All on a single TAB press. Once you are used to it, it takes the typing out of the simple stuff, and it leaves you free to concentrate on the "why" you are doing it, instead of the "what".
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt AntiTwitter: @DalekDave is now a follower!
-
You might be surprised - it's actually pretty good. I'm not young - 63 - but I'm finding it handy to "fill in the blanks" with the drudge stuff: it works out what they heck you are likely to be trying to do and provides a default text that uses sensible variables you used earlier and suchlike. It does appear to use the variable names to help it decide as well, which is a damn good reason for using sensible names at all times instead of "quick to type" ones ... :-D Give it a try (the Community edition is free so there's not a lot of excuse) - it might surprise you! (It did me.)
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt AntiTwitter: @DalekDave is now a follower!
I this thing does everything for you soon no knowledge of programing will be required to write a program.
-
I this thing does everything for you soon no knowledge of programing will be required to write a program.
-
I this thing does everything for you soon no knowledge of programing will be required to write a program.
There are enough people trying to produce code without any knowledge or thought already: check out QA some day ... :sigh:
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt AntiTwitter: @DalekDave is now a follower!
-
I was writing a little bit of code today to replace commas within double quotes enclosed text in a huge string. This string could have multiple segments of double quoted text. I had only written this bit
// Replace all the commas that are between double quotes
char[] linechars = line.ToCharArray();
bool isInQuotes = false;for (int i = 0; i < linechars.Length; i++)
{
if (linechars[i] == '"')//This was predicted by Visual StudioThis IDE can read my code and comments and predict the next if statement. This is amazing. P.S. Before someone points out miserable string handling, I really do not care about code quality. This is a one time use (quick or slow) and dirty utility.
"It is easy to decipher extraterrestrial signals after deciphering Javascript and VB6 themselves.", ISanti[^]
-
It is amazing... until it is not... Wait and see - after enough suggestions you will find that most of them are plain stupid repetition of what you done before (a true no-brain op)...
“Real stupidity beats artificial intelligence every time.” ― Terry Pratchett, Hogfather
Kornfeld Eliyahu Peter wrote:
Wait and see - after enough suggestions you will find that most of them are plain stupid repetition of what you done before (a true no-brain op)...
I had more obviously wrong suggestions than cases where it generated what I wanted, but that's not why I turned it off after a few weeks. I pulled the plug because about 5-10% of the suggestions were dangerously wrong. Things that looked OK at first glance, but which had subtle logic errors in them. Trying to debug my own wrong think is bad enough, when the code running is ever so slightly off of what I intended was far worse.
Did you ever see history portrayed as an old man with a wise brow and pulseless heart, weighing all things in the balance of reason? Is not rather the genius of history like an eternal, imploring maiden, full of fire, with a burning heart and flaming soul, humanly warm and humanly beautiful? --Zachris Topelius
-
Now redo another block of code, but change "commas" in your comment to something else...then as you're typing the actual code, see if it picks up what your comment said as you're suggesting...
-
I was writing a little bit of code today to replace commas within double quotes enclosed text in a huge string. This string could have multiple segments of double quoted text. I had only written this bit
// Replace all the commas that are between double quotes
char[] linechars = line.ToCharArray();
bool isInQuotes = false;for (int i = 0; i < linechars.Length; i++)
{
if (linechars[i] == '"')//This was predicted by Visual StudioThis IDE can read my code and comments and predict the next if statement. This is amazing. P.S. Before someone points out miserable string handling, I really do not care about code quality. This is a one time use (quick or slow) and dirty utility.
"It is easy to decipher extraterrestrial signals after deciphering Javascript and VB6 themselves.", ISanti[^]
With the possible exception of auto-complete for method names etc., I distrust such suggestions. No IDE, irrespective of how much "AI" it is using, can truly understand my thought processes.
Freedom is the freedom to say that two plus two make four. If that is granted, all else follows. -- 6079 Smith W.
-
With the possible exception of auto-complete for method names etc., I distrust such suggestions. No IDE, irrespective of how much "AI" it is using, can truly understand my thought processes.
Freedom is the freedom to say that two plus two make four. If that is granted, all else follows. -- 6079 Smith W.