4 ms·
Can someone summarize what one could accomplish using WebAssembly with a statically typed language as c#?
by interdrift 11y ago
Can someone summarize what one could accomplish using WebAssembly with a statically typed language as c#?
- hacker_9 11y agoI've worked with both C# and JS for a number of years and to sum up why static typing is ultimately better than dynamic typing, is because of the type system which gives you compile time errors. As programmers on the computer all day, the more work the computer does for us the better. With a type system the computer knows what the system is capable of, and so knows what you are doing - this means it can tell us precisely what members are available in 'foo' when you type 'foo.', and it can accurately tell us that 'bar' does not exist in foo when you type 'foo.bar'. With systems of even minor complexity this is a godsend when you don't have to even read the documentation of a new API you want to use - you just use the autocomplete and contextual documentation to figure things out. It makes code fun again. With dynamic typing, and especially with JS, the computer is mostly oblivious to what can/cannot be done and you end up having to ctrl+F on method names, mispell something and it just gets added as another variable to the type, you can't refactor variable names easily etc. It's pretty bad in comparison. Static typing isn't all perfect though - sometimes types do get in the way where I wish more dynamic features would have been available. But at least now if C# etc can be used for webdev, then solving these problems will become something people will invest time in and we will finally see new innovation again - instead of yet-another-javascript library/hack.
- pingec 11y agoI have also been doing C# and JS for years and completely agree. JS is nice for prototyping because of the light footprint but as soon as your code gets more complex it becomes a problem to manage/maintain, far from impossible, just harder. From this perspective TypeScript is a godsend.
- user_0001 11y agoDynamic languages are like inventing a new type of car with square wheels. ;-) Compilers are great, they exist for a reason. Use them