Re:JavaScript as default language and software stack
by Touche on Thursday September 24, 2015 @02:42PM
(#10273669)
Back when I did C# I found trying to do functional stuff painful. Maybe it's gotten a bit better, but I recall creating functions being something like
Or something like that. I found moving to dynamic languages to be a breath of fresh air. I never cared too much about code completion and stuff like that.
[ Parent
| on HN ]
Re:JavaScript as default language and software stack
by bratsche on Thursday September 24, 2015 @02:53PM
(#10273751)
If pain is measured in keystrokes, then yeah.. functional C# might be somewhat painful.
If you haven't tried it you might consider using F#. It seems to have the best of both worlds. It's got a static type system with functional features, but also a very lightweight and beautiful syntax (heavily influenced by OCaml, fwiw).
Re:JavaScript as default language and software stack
by TheCoelacanth on Thursday September 24, 2015 @03:47PM
(#10274155)
That's one way to do it, but the typical way is identical to ES6: `() => expression` or `() => { statements }`
Re:JavaScript as default language and software stack
by douche on Thursday September 24, 2015 @02:46PM
(#10273700)
Lambdas and LINQ has made this much simpler:
var foo = (param, anotherParam)=>{ /* do stuff */};
Re:JavaScript as default language and software stack
by erdeszt on Thursday September 24, 2015 @05:19PM
(#10274823)
Except that this is not working. You have to explicitly type lambdas if you assign them to local variables(or to properties, fields). But I don't see it as big trouble though.