466
sam9669
1y

Difference between C# and Javascript
Me: Hold my cup of tea.
C#: That's not a cup of tea.
Me: Hold my cup of tea, with two teaspoons of sugar in it.
C#: That's not a cup of tea with two tea spoons of sugar in it.
Me: Hold my cup of tea, with two teaspoons of sugar and milk in it.
C#: That is not a cup of tea, with two teaspoons of sugar and milk it.
...
Me: Hold my cup of tea.
Javascript: I'll hold your cup of coffee.

Comments
  • 4
    interesting :D
  • 64
    python : i would make coffee for you
  • 74
    Python: I'll hold your cup. If it turns out that is is not tea, I'll pour it on the floor and knock over a table, while I'm at it
  • 36
    Me: Hold this piece of crap.
    Javascript: I'll hold your cup of coffee.
  • 3
    What if you were not holding a cup of tea 🤔
  • 26
    @edwrodrig or, perhaps more fittingly, "Hold this, piece of crap"
  • 2
    I'm just starting to learn coding. I wanna take up JavaScript, so began with HTML & CSS. I also had considered C# a few weeks back. Can someone please explain me the above post...how it relates technically to those languages.
  • 47
    Me: Hold my cup of coffee
    Assembly: 01001001 00100111 01101100 01101100 00100000 01101000 01101111 01101100 01100100 00100000 01111001 01101111 01110101 01110010 00100000 01100011 01110101 01110000 00100000 01101111 01100110 00100000 01100011 01101111 01100110 01100110 01100101 01100101
  • 24
    JavaScript: Hold my cup of tea.
    TypeScript: That's not a cup of tea.
    JavaScript: Hold my cup of tea. Please. Any.
    TypeScript: As you wish. Any-thing you want.
  • 55
    Well well well. You should obviously have said "Here, please hold my object of type ICup" and then C# wouldn't have cared what was in the cup...
    Problem with Javascript is when you want the cup back. Then it's:

    Me: "can I have it back now?"
    Js: "You mean this?"
    Js: hands over someone else's beer..
  • 40
    @skanchan221 it doesn't. They just don't understand how JavaScript works.
    Correctly written it should be:
    Me: Hold my cup of tea
    JavaScript: Okay, I'll hold your cup of tea, even though you designed me to hold coffee, you seem to be a dumbass and pass me tea, but I'll play nice and try and do the best I can without dying, despite your stupidity.
  • 1
    @eldamir i hope the cup has a warning label on it so you can catch it!
  • 7
    @skanchan221 Google for "type safety" or "strongly typed vs weakly typed languages".
  • 3
    My comment above... The binary actually says something.
  • 8
    @CodePlebe static vs dynamic types would probably be a better search
  • 2
    @filthyranter 010101110110010100100000010010110110111001101111011101110010000001010100011010000110000101110100
  • 20
    Me: hold my cup of tea
    C: *drops cup on the floor* "You should have told me it was scalding hot!"
    ...
    Me: hold my cup of tea
    Java: nope, I'm sorry. I only do coffee.
  • 13
    Me: Hold my cup of tea.
    C: Ok.
    ...later...
    Me: Give me mu cup of tea.
    C: There's nothing here, but I'll leave you a core dumped and go take a nap. Call me later.
  • 11
    Sorry to be pedantic, but why would I ever allow a cup of tea to leave my hand anyway?
  • 2
    @skanchan221 have a look at the difference between high and low level languages.
  • 1
    Its hilarious
  • 2
    That's great!
  • 1
    ELI5?
  • 4
    Me: Hold my cup of tea.
    CoffeeScript: ...
  • 7
    @GrizzlyMagnum

    Is a joke about the typed language.

    In C# you have to declare what type your variable is. For example

    int aNumber; this mean you can only save integer numbers in aNumber, if you try to save text in aNumber it will give you an error.

    On the hand in js you just go
    var aNumber; and then save in a number whatever you want. A String, a number, a function anything.
  • 1
    @fioritonicolas thank you. That was meaningful :)
  • 4
  • 0
    That's very funny
  • 2
    @fioritonicolas True and a great explanation, but C# also supports `var` and `dynamic` types.

    For me the most irritating thing about C# is that a control is still a control, no matter if it's a label or a button.

    Also 1 == true, but 1!== true. C does it, JS does, PHP does it, but in C#, 1 != true.
  • 3
    @DRSDavidSoft In C# "var" is not dynamic typing. It is just a way for the coder to omit writing out the exact type of a variable. Var is basically a placeholder, but its exact type is well defined at compile time, the compiler evaluates, what type it will be.

    Last section:
    C has no "boolean" type. JS and PHP do implicit type conversion to boolean, C# does not.
    Because C# is strongly typed and in the case of integer and boolean has no implicit type conversion.
  • 1
    @qbasic16 well spoken!
Your Job Suck?
Get a Better Job
Add Comment