4 ms·
I like JavaScript... it’s very flexible and incredibly expressive. Using c# lately, I just feel shackled
by jammygit 7y ago
I like JavaScript... it’s very flexible and incredibly expressive. Using c# lately, I just feel shackled
- onion2k 7y agoMoving for any modern language you know well to any other modern language will feel like that. You need to spend time learning. It has nothing to do with the what the language is capable of. "I can code in X so I should be able to jump in to any other language and get to speed instantly." is obviously wrong.
- goto11 7y agoWhat can you express in JavaScript which you cant express in C#?
- jammygit 7y agoSerialization for one thing. You can work with JSON extremely freely without creating weird serializable classes for every combination of data you might need to work with - eg, no class named "DoodadList" for when you want to de-serialize a JSON list (maybe that's a Unity3D thing?). You can nest functions nicely and work with closures when it makes sense, if you like that sort of thing. The async programming model is also really nice to work with. You also don't need to create classes for every noun, verb, and adjective in your system either - when all you need is a function, you just write a function, not some weird object to hold it. You also don't have to write a f after all of your decimal values to tell the silly compiler that you mean for 0.25 to be a float. (this one truly does not matter, but there are a lot of little things like this that add up) I know you can do a lot of that in C#, but its just so effortless in javascript. You just need to be more disciplined about how you code it
- goto11 7y agoYou are right about having to create a class to hold a function, that is annoying. But C# do support nested functions and closures. I don't really understand your other points. A literal 0.25 in C# will be parsed as a double precision. If you want it to be a float (less precision) you use the F postfix. But JavaScript doesn't even have the float/double distinction.
- svecoldr 7y agoWhat can you express in C# which you cant express in Assembler?
- wayneftw 7y agoLooping over properties of an object is painful in C#.
- goto11 7y agoExpressions and functions for example. Assembler is really low level, it doesn't even have control structures. But C# seem to have everything JavaScript has and much more, so I just wondered why the parent post found JavaScript more expressive.
- celticmusic 7y agoI'm the exact opposite. Having a compiler help you avoid an entire class of bugs is superb.