Ad
  • Custom User Avatar

    Does resharper want to modify all your code to use 'var'

    Yes, it's by default. It's not marked as a big warning, but as a suggestion. To me, I repeat, it's such a small difference that I think it's a matter of taste :) If i had to back up this in a more objective way, I would resort to the DRY principle. Writing string a = '' is like saying to time that it is a string, hence providing redundant information. I don't think that var a = '' has any readability problem :).

    Weird.

    As I said, I don't think it's weird, just stylistic decisions :)

    Always code like it's real... :)

    I can commit only a certain amount of time to codewars, I try to do the best I can in a reasonable amount of time :)

  • Custom User Avatar

    Thanks for commenting :)

    I guess that var has a lot to do with opinions and personal feeling of the coder, is difficult to say what is better to use objectively, whether var or the actual type. Personally, I use var everywhere, probably because I am addicted to resharper, it's concise, and because I like to use type inference whenever I can, but as I said, I think it's more a matter of taste.

    If I had to put this code in a real project, I guess I would have added a documentation for Seq, and maybe chose a better name :)

  • Custom User Avatar

    try with .Trim()? maybe the whitespace is on the other side

  • Custom User Avatar

    You should look into StringBuilder if you don't want to dry up your memory ;)

  • Custom User Avatar

    that's true, also ToList =)

  • Custom User Avatar

    Isn't the OfType redundant?