8

After javascript, coding in C# feels like I have to communicate with a deaf person with using only one hand. :D

Comments
  • 1
  • 2
    Yeah it feels like something is missing while working with C#
  • 11
    I'd say it's the opposite tbh. C# feels like a mature language.
  • 11
    What... Lmao, for me getting back to C# feels like finally getting down from a plank, to a solid, stable ground.
  • 8
    Better than javascript which is like communicating with blind person with no hands
  • 5
    @theabbie Look ma, no hands!
  • 0
    @theabbie that is how you learn telepathy!

    I don’t dislike c#, I dislike c# devs doing stuff like tryGet.
    If it’s null -> you failed to get
    No need to abuse an out parameter
  • 0
    @piratefox tryGet should be error handling (and not null checking) and would be pretty much this:

    bool tryGet(int id, out object obj){
    try{
    obj = get(id);
    return true;
    }
    catch{
    //some error handling
    }
    return false;
    }

    The reason is that in C# we like error handling by throwing exceptions.
  • 3
    @Eklavya yeah, it's missing the ability to write any random disgusting incomprehensible bullshit while high on heroine and have it "run" without it actually properly informing you what it did and why, if anything.
  • 3
    this is why i discourage people from learning js as their first language - when they then go to any other, it's like a 5star restaurant cook complaining that barfing into platters is not an acceptable cooking method.
  • 0
    @saucyatom (!bool){get(id)}
  • 1
    Never seen TryGet used in any C# project.

    TryParse on the other hand is a very useful "this might be type X, convert if it is but don't incur the overhead of an exception I don't care about if it isn't".

    Very helpful for parsing filthy user inputs.
  • 0
    @kwilliams seen in a unity project. You can guess the quality by one sentence: “sure this way it’s unreadable, but it’s way faster as it’s one less operation! Assigning a variable is expensive!”
  • 0
    @saucyatom in that case I find more helpful something as tryOrDefault (passing an optional default value), but it’s just cause more examples come to my mind, I see why your example could be useful (e.g get an entry or ask the user to create a new one)
  • 1
    @piratefox Of course it depends what get() is actually doing. I just meant that tryX implies that it is functioning that way, like e.g. tryParse. xOrDefault has another implication. Both are useful in their own way and for different things.
  • 1
    Coming from c and python c# feels more organised
  • 1
    @techneo that's because it is :)
Add Comment