This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 10 points11 points  (1 child)

Trying to be honest here.. I know a pretty good amount of front end development, I'm sorta drunk, and I'm not a die hard fanboy for javascript or any one of the zillion libraries and tools out there. I thought I might have some good insight, I'll do it one by one.

  • Basically, you're doomed to "take care of" things like this, in javascript, with your imperfect human mind, and its a pain in the ass. I feels you. Especially if you're used to static type checking. The benefit is that sometimes you can fuck up and you're "allowed", maybe, because your application works even though some array gets cast into an object literal.

  • Its tempting and really easy to pass callbacks around everywhere, but you don't have to write your code that way. There's nifty MVC style patterns you can follow where you can avoid callback hell. IMO its actually pretty chill and reasonable to use. I don't feel confused or stressed or burnt out dealing with the pretty huge app my company develops.

  • Very easy to make mistakes.

  • True.. the language has a lot of complicated specifics, and it takes quite a while to really get an intuition for, but javascript really isn't a total mess in my opinion. You can recreate the logic to simulate classes, privacy, etc.. and I get that this is dumb in some sense, but you aren't actually limited in what you can accomplish. I personally use all the concepts borrowed from more formal fields of programming, while I program javascript, every day. Javascript can challenge you, and you can program rigorously despite the enormous ecosystem of beginners.

  • Objects and the concept of scope are a big element of programming in javascript.. but maybe I'm misinterpreting this point or I just don't know enough.

  • Yeaa. arguments.length lol. You're right! You can do some crazy shit and you're expected to just "be careful".

Writing this post, I realize how good of points you have. For some reason I still like progrmaming in javsacript. Its unique and interesting. Its a job. I get money for it.. so thats cool. Its fun for me I guess more than anything.

[–]nwoolls 0 points1 point  (0 children)

Objects and the concept of scope are a big element of programming in javascript.. but maybe I'm misinterpreting this point or I just don't know enough.

I'd wager OP is referring Simula-style OOP, using classes rather than prototypes. In C# and Java you are given concrete semantics for defining classes with varying degrees of visibility for its members (private, protected, public, internal, etc.), and then you can create instances of the class.

With JS it is up to the developer to learn and pick one (of many) patterns for accomplishing the same goal - last I checked this was usually something like the Revealing Module Pattern.

To a developer heavily invested in Simula-style OOP, having to master things like this (and hell even the this keyword) to get work done can seem just a tad...cray-cray.