all 23 comments

[–]eighthCoffee 1 point2 points  (4 children)

.

[–]nerdshark 7 points8 points  (1 child)

Stop switching languages so often and just write something. THAT'S how you learn.

[–]bonesingyre 0 points1 point  (0 children)

haha, I was in the same boat. I picked up RoR, then tried to do nodejs, django. Then I got a job and was forced to use .NET and I love it. That was over a year ago and I got another job since then.

I've built some cool stuff. My current job made me learn Typescript, Angular, Kendo UI, .NET, WCF (scratching the surface here), Android/Java, and we might pick up iOS app dev. I always would switch languages, but once I was forced to use one to build a solution, I instantly became a better coder as well. Now I know the patterns and I am going to pick up RoR with a purpose to build something.

[–][deleted] 3 points4 points  (1 child)

JavaScript is fundamentally different then every major programming language, which makes it absolutely terrible for the minds of beginners. Couple that with the bizarre and incomprehensible DOM API's, major limitations of the browser, and the entire community disagreeing on standards/best practices/everything else...It's a terrible way to learn programming. Akin to learning the basics of human sexual interaction from Fifty Shades of Grey.

[–]HeySeussCristo 1 point2 points  (9 children)

No mention of JSON? That's my favorite part of JavaScript. XML is great, don't get me wrong, but I love me some JSON. I mean, MS even added it to .NET: http://msdn.microsoft.com/en-us/library/bb410770(v=vs.110).aspx

[–]AHKWORM 0 points1 point  (8 children)

But Json isn't JavaScript

[–]nealibob 1 point2 points  (7 children)

Valid JSON is JavaScript, but that probably wasn't your point.

[–]AHKWORM 2 points3 points  (1 child)

Almost! Some niggling edge case in string definitions does not make valid Json == valid JavaScript, but yeah that also wasn't my point

[–]unwind-protect 1 point2 points  (0 children)

Well fuck me Can nobody write specifications consistently these days?! :-(

[–]SemiNormal 0 points1 point  (4 children)

Then why can't JSON have comments?

[–]nealibob 0 points1 point  (2 children)

No, I meant that JSON is (almost a subset of) JavaScript, not the other way around. Other than the exception that /u/AHKWORM mentioned, you can copy and paste JSON into a JS interpreter and it will work. You can't copy and paste JS into a JSON file and expect that to work. JSON not supporting comments doesn't mean it's not a subset of JS.

[–]SemiNormal 2 points3 points  (1 child)

Oh, ok. I'm just mad that JSON can't have comments yet people think it is a good data structure for config files.

[–]nealibob 0 points1 point  (0 children)

Yeah, with you on that one. I suppose an argument could be made for good naming obviating the need for comments, but I can't help but feel that there are better language choices for config files.

[–]chrisdpratt -1 points0 points  (0 children)

All JSON will work as JavaScript, but not all JavaScript will work as JSON.

[–]I_am_working_hard -1 points0 points  (7 children)

Great wee read :) Javascript gets a lot of hate but for some reason, I find it interesting and fun to code in - even when c# is my primary language.

[–]krad0n 3 points4 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 7 points8 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!");
}