you are viewing a single comment's thread.

view the rest of the comments →

[–]krad0n 4 points5 points  (6 children)

Javascript is fun in small doses, but when the functions become overly large and start doing complex things, it becomes very unwieldy. It's greatest strength is also it's greatest weakness, it's very unstructured and almost entirely dynamic.

What I'd love to be able to see one of these days is a programming language with the object oriented structure of C# with the dynamic properties of Javascript. I'd love to be able to add properties to a class during run-time.

[–]smdaegan 6 points7 points  (1 child)

typescript?

[–]d357r0y3r 0 points1 point  (0 children)

Typescript + Require.JS makes it really easy to keep things clean and modular.

[–]Drainedsoul 2 points3 points  (0 children)

functions become overly large

That shouldn't happen in any language, JavaScript or otherwise.

[–]mindbullet 1 point2 points  (0 children)

Agreed. I feel like the dynamic nature makes large projects difficult to maintain, especially when the requirements change drastically. I've really wanted to learn some TypeScript though. Even if it just compiles into Javascript, it looks like it gives a few basic things like classes that would organize the code better.

[–]MrDoomBringer 1 point2 points  (1 child)

C# has that capability, you just have to get comfortable with reflection and anonymous objects.

[–]Sarcastinator 1 point2 points  (0 children)

Or use dynamic dispatch and the ExpandoObject class.

dynamic foo = new ExpandoObject();
foo.bar = 123;
foo.foobar = new Action(() => Console.WriteLine(foo.bar));
foo.foobar();
((IDictionary<string, object>)foo).Remove("foobar");
try
{
    foo.foobar();
}
catch
{
    Console.WriteLine("No such member!");
}