9
ZioCain
3y

Well I program in PHP, JS and C#.
Weak typed variables are literally the worst thing ever.

In C# I particularly hate the way callback as handled

Comments
  • 1
  • 2
    @alexbrooklyn well, weak typing means a variable can be anything, but some methods require parameters to be of a specific type and therefore you always have to check what kind of var it is.

    As for callbacks, it's really messy to understand what's going on when you're working with callback, thread and so on
  • 2
    @alexbrooklyn Come on, you don't want to open the debate on weak typing again surely 😉
  • 3
    @AlmondSauce fuck weak typing I want to know about the callbacks :p

    (I should have been more specific)
  • 3
    C#? Callback? Have I missed something?
  • 1
    Are you talking about delegates, funcs, task async or something else?
  • 0
    consider delegates and events in C#
  • 1
    @SortOfTested yeah, that's what I mean

    (i'm not that good at programming, tho)
  • 1
    @ZioCain
    If you're coming from a js or single threaded background it can be a bit confusing.

    If you're looking for promises. The analogue you're looking for is continuations. Task has a ContinueWith method that accepts a function that lets you unroll the result of a task. Also has facilities to control things like schedulers (how the work is executed, synchronized), timeouts and cancellation of observation/operation.

    Async await functions in a semantically identical way with tasks as is does with promises in js, because .net popularized it as a control flow mechanism, courtesy of erik meijer.

    It is however all built on top of the thread ecosystem. It may help to read up on the differences between threads and green threads.

    https://en.m.wikipedia.org/wiki/...
    https://en.m.wikipedia.org/wiki/...
Add Comment