![]() Visual Studio 2019: Visual Studio Professional and Visual Studio Enterpriseīefore you ask for a code review, make sure you've shared your code in TFVC.Visual Studio 2022: Visual Studio Community, Visual Studio Professional, and Visual Studio Enterprise.It's uncertain how quickly and in what manner these AI monsters will integrate into our daily work (as copilots, smart code analyzers, bug detectors, etc), but one thing is clear - this is the future.Visual Studio My Work and Code Review features are available with the following editions: It has always been trailing (since the first version of Resharper) and likely will be in the foreseeable future.ĬhatGPT-4 is a beast! I've been playing around with it (not only coding and tech) since it became available, and I'm often (though not always) astonished by the results, which exceed my expectations. Visual Studio is continually improving, but it remains a few steps behind Rider / Resharper. So, what conclusions can we draw from this small competition?įirst, if you write C# code for money, then go ahead and purchase a license for either Rider or for Resharper to use it with Visual Studio (if you haven't done already). Wow! The machine figured out the possible values for the Rating property of the User class and noticed that it would be better to include 0 in the range of values that belong to the Beginner title! To be honest, I didn't expect any of the competitors to notice this issue, and I must admit that it's impressive! Conclusions So, I explained to the supermind what our program is expected to do and asked it to fix any bugs it can find in the code:ĬhatGPT didn't notice the problems detected by Rider, but it found another one! ![]() When dealing with ChatGPT (and other language models like Bing Chat), prompts are crucial, and hopefully, I didn't do a poor job here. ChatGPTĪlright, now it's time to test-drive the extremely hyped AI powerhouse that everyone is talking about these days - ChatGPT-4□ Prompt Possible 'System.NullReferenceException'Īnother fair point made by Rider is that userWithMinRating can be null, which can lead to a NullReferenceException being triggered on line 9:Īlthough it may seem like a simple and easy-to-spot bug, it's one of the most common exceptions that occur in production code. As we discussed, all this happens because new sets of users are being generated on lines 4, 6, 7 and 8. What nonsense! We can see 2 users, but it says that none were found, then it prints a minimum rating that doesn't belong to either of the two users we saw just two lines above. Var userWithMinRating = foundUsers.OrderBy(x => x.Rating).FirstOrDefault() Ĭonsole.WriteLine( $" Var foundUsers = FindUsersByRating(allUsers, 0, 60) Instead of writing this program ourselves, we asked someone else to do it for us (someone less smart than modern AI systems), and here is what we got: var allUsers = GetAllUsers() The title of a user with a minimal rating (the title is based on the rating). Generates 10 users with randomized ratings.įinds users whose ratings are between X and Y. Let's say we want to write a C# program that: Finally, we're going to ask ChatGPT to review the code and fix all discovered bugs if any. Then we'll feed the code to our favorite IDEs (Rider and Visual Studio) to see if they can highlight any code issues. What we're going to do today is review a C# program and try to spot any bugs. ![]() ![]() So instead of a short tweet, I'd like to offer you a small competition between Visual Studio 2022, Rider 2023.1 and the magical ChatGPT-4. Today I was going to post a tweet like "Hey fellow developers, use Rider/Resharper instead of good old Visual Studio because the former will find and fix some bugs for you", but then I decided to check what the latest Visual Studio 2022 can do against Rider, and while at it, I remembered our new friend ChatGPT.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |