• 0 Posts
  • 44 Comments
Joined 3 years ago
cake
Cake day: June 30th, 2023

help-circle

  • Simply put, because you often want to change the state of something without breaking all the references to it.

    Wild off the top of my head example: you’re simulating a football game. Everything is represented by objects which hold references to other objects that are relevant. The ball object is held by player object W, player object X is in collision with and holds a reference to player object Y, player Z is forming a plan to pass to player object X (and that plan object holds a reference to player object X) and so on.

    You want to be able to change the state of the ball object (its position say) without creating a new object, because that would invalidate how every other existing object relates to the ball.






  • true, and i can’t think of a legitimate case where it would have tripped me up. but if someone, a novice perhaps, wrote

    def some_func(foo, bar=[1, 2, 3]):
        bar.reverse()  # for whatever reason
        print(bar)
    
    some_func('hello')    # output [3,2,1]
    some_func('hello')    # output [1,2,3] 
    

    i think they would be within their rights to be surprised that calling this function twice has different results. that’s what i was surprised by; it feels like bar would be re initialised each time with a scope of the function but apparenty not






  • Ok, that’s great. I get what you’re trying to do now.

    I think in terms of getting input I can only suggest that deliberately invoking Cunningham’s law is probably going to get you more responses that anything else. You are honest and upfront about the code being unstable but this is unlikely to motivate someone to audit it for you. Simply stating it’s the most secure web chat available for x reasons is more likely to motivate someone to prove you wrong. Even if their motivations are negative you might still find the insight valuable…




  • Depends how you learn. Being mindful of what your goal is helps. C# can be used for console apps, it can also be used to make ASP.Net websites, further afield you can program the Unity games engine with C#. Each of these will have “absolute beginner most basic first steps” type tutorials out there. They’ll all have some similarity as you’ll need to just learn the C# syntax one way out another, but it miles easier doing this if you’re vaguely interested in the types of apps you’re heading towards.

    If all else fails, message me, I was there once, about 20 years ago…