4 ms·
Sorry, I don't see the similarity. Can you elaborate? Thanks.
by wslh 15y ago
Sorry, I don't see the similarity. Can you elaborate? Thanks.
- adolfojp 15y agoThey both have brackets and colons. How much more similar can you get! Joke aside, the first time that I coded in JavaScript I treated it as if it were a dynamically typed Java. Pain and suffering and confusion ensued.
- hare 15y agoI think the similarity started more around C# 3 when C#'s syntax was changed to make functional programming less painful.
- nxn 15y agoC#: var obj = new { propA = 1 , propB = "meh" }; JavaScript: var obj = { propA: 1 , propB: "meh" }; I admit that's about as close as they get syntactically, but with type inference, higher order functions, and anonymous types they really kind of "feel" similar in some cases. Oh, and C# has optional dynamic typing, so it can ~really~ feel similar if you want.