Search Unity

Resolved Visual Studio 2019 or 2022 ? (community editions)

Discussion in 'Code Editors & IDEs' started by atomicjoe, Jun 30, 2023.

  1. atomicjoe

    atomicjoe

    Joined:
    Apr 10, 2013
    Posts:
    1,869
    I'm reinstalling my computer.
    Unity installs VS2019 by default (at least Unity 2021LTS).
    I have been using VS2022 with Unity in the past without issues (that I know) but I wasn't even aware that VS2022 wasn't "officially" supported by Unity, so now that I am reinstalling, I wonder if I should stick to VS2019 or it's better to use VS2022 instead.
    I like the 2022 UI better, but if it's going to give me ANY issues in the long run that I don't know about, I'll stick to 2019.
    What's your opinion?
     
  2. CodeSmile

    CodeSmile

    Joined:
    Apr 10, 2014
    Posts:
    5,892
    Since you ask for opinions: neither. :p

    I've never looked back since switching to Rider. Contrary to Microsoft, for whom Unity is considered "toys for boys" with lackluster support, Jetbrains actually takes great care integrating Rider with Unity.

    Just a few noteworthy things Rider does which VS cannot (at least last time I used it). Rider can ...
    • run Unit Tests from within the IDE
    • browse the Assets tree within the IDE, thus making all assets accessible - for example if I just want to flip a flag in a Material I can just quickly edit the YAML file rather than going to Unity, waiting for compilation to complete, locate the file (again), flip the flag, and return to the IDE
    • create all kinds of Unity scripts from templates (ScriptableObject, Editor(Window), Unit Test, Assembly Definition, etc)
    • automatically update Assembly Definition files with dependencies and flags (such as "allow unsafe code")
    • understand Unity event functions like Update() (eg never complains "isn't being called")
    • understand refactoring (renaming) serialized fields
    • provide meaningful tips on how to improve code, specifically calls out common Unity performance bottlenecks (eg "this method is expensive / called frequently")
    • provide helpful "auto fix this %§#$!" refactorings which do exactly what used to be mandatory manual labour, like adding using statements and dependencies, or making private methods more accessible.
    This is just the tip of the Iceberg from the top of my head. Once you've spent two weeks with Rider you'll wonder how you could have worked with barebones MS VS. ;)
     
    Ryiah likes this.
  3. atomicjoe

    atomicjoe

    Joined:
    Apr 10, 2013
    Posts:
    1,869
    Rider is a subscription. No thanks.
     
  4. CodeSmile

    CodeSmile

    Joined:
    Apr 10, 2014
    Posts:
    5,892
    You get what you pay for. ;)
     
  5. atomicjoe

    atomicjoe

    Joined:
    Apr 10, 2013
    Posts:
    1,869
    Ok...
    Anyone that actually uses VS?
     
  6. DevDunk

    DevDunk

    Joined:
    Feb 13, 2020
    Posts:
    5,048
    I've used VS 2022 for a while and hate it when I have to use a 2019 version. 2022 is a ton better for refactoring and has way better intellisense
    Never has issues with 2022 on unity 2021 or newer.
     
    atomicjoe likes this.
  7. DevDunk

    DevDunk

    Joined:
    Feb 13, 2020
    Posts:
    5,048
    Oh do make sure Unity is up to date as well (latest lts update), as older versions had IL2CPP issues with vs 2022
     
    atomicjoe likes this.
  8. Ryiah, DevDunk and atomicjoe like this.
  9. atomicjoe

    atomicjoe

    Joined:
    Apr 10, 2013
    Posts:
    1,869
    That's much better! I'll keep using VS community though since it's free for individuals but I'll keep an eye on Rider.
     
  10. I mean obviously it is your choice. I just like to put things into perspective. Currently I pay $90 per year for Rider. I pay $18,000 for rent (in the Bay Area it's super low, I'm very lucky). I pay $400 per year for Unity (although I may drop the Plus subscription at the next payment cycle, I am not obligated to pay and Unity nowadays are really sharpening their knives on my nerves).
    But for that $90 I get a great and performant IDE for Unity, for other C# projects and also for Unreal as well. And they have many extra functions which are just not there in VS or severely more inconvenient.
    So to me, it's worth the price. (Although I had to pay higher price for a couple of years to get to the $90 per year)
     
    Ryiah likes this.
  11. atomicjoe

    atomicjoe

    Joined:
    Apr 10, 2013
    Posts:
    1,869
    Honestly, I don't have any issues with Visual Studio. Before that I just used Mono Develop for Unity and the only advanced features I use in VS are the "search and replace" across the whole project and refactoring / renaming features anyway.
    What I want from an IDE is a dark theme, colored code and autocomplete / intellisense.
    I don't really need anything more.
     
  12. Neto_Kokku

    Neto_Kokku

    Joined:
    Feb 15, 2018
    Posts:
    1,751
    There's no reason to stick with 2019 for Unity, unless you're using a really old version that doesn't support it. Visual Studio's compiler is only ever used when building IL2CPP for Windows, while all C# and burst compilation is done by Unity's own stack.

    Also, you can have both 2019 and 2022 installed side-by-side if you need to.
     
    atomicjoe and DevDunk like this.
  13. Ryiah

    Ryiah

    Joined:
    Oct 11, 2012
    Posts:
    21,157
    Rider > VS > VS Code. VS 2022 > VS 2019.
     
  14. atomicjoe

    atomicjoe

    Joined:
    Apr 10, 2013
    Posts:
    1,869
    Ok I finally installed VS 2022
    Thanks everyone! :)