michaelaisgreat
You pretty much sum up the entire problem with Javascript in your reply here.
Javascript, as a scripting language for simple webpages (i.e. what it was designed for) is fine. Practically every other use of Javascript is an ugly hack, which wastes developer time, often leads to poorer quality code, and leads to unmaintainable code.
Which seems like an utterly irrelevant complaint, especially given that the particular use of JavaScript in the OP's case is a
dialect of the language created for scripting a game engine.
michaelaisgreat
Perhaps I should have been more specific. Due to Javascript's ability to dynamically modify objects, etc.,
automated refactoring can have complexity higher than that of the halting problem. Unlike languages such as Java/C#/C++/Haskell/F# in which the complexity of automated refactoring is within polynomial time.
IMNSHO, automated refactoring is a crutch for weak-minded programmers. If you need to rely on an automated tool for refactoring, it's my opinion that your problem is one that will require more thought on your part. Refactoring willy-nilly is a counter-productive endeavor. Automated refactoring tools just let you morph your code with far less forethought than you ought to have.
michaelaisgreat
I would hope that someone who understands Computer Science would understand the importance of automating programmer workflow.
Oh, I understand the importance of workflow.
But I also understand the limits of automation. When I automate, I write my own tools. I don't depend on IDEs to do my work for me. I want to understand my problem space, not will it away with broken tools.
michaelaisgreat
Ah, but most (do any?) don't actually support it.
So?
michaelaisgreat
As for reflection, I'm afraid I should have been more specific. I meant dynamic code generation.
So? JavaScript does have those facilities, so it's absurd to insist that it doesn't.
michaelaisgreat
You then quote various things I stated out of context, perhaps you missed the point? As you stated,
Javascript is Turing complete so it is capable of the same logic as any other Turing complete language - however,
it often requires more code full of ugly hacks which are prone to bugs than some more elegant language. i.e.
Javascript makes the job of a developer harder.Perhaps for someone who approaches it from a C# perspective.
Programmers who understand their tools find the job easy. Programmers who do not understand their tools find their job hard. JavaScript is only hard because you do not immerse yourself in its mindset. It makes
your job harder, because you're trying to use it like you use other tools.
Yes, it's hard to nail a screw into wood.
But that's because you're supposed to use a hammer with nails, and a screw driver with screws. Doing so otherwise is a waste of your energy. Writing JavaScript like you write C# is a waste of your energy.
I'll put it this way: If you have to write an "ugly hack," you're doing something
very wrong and you should probably rethink your entire approach.
michaelaisgreat
As a mental exercise, consider some reasonably complex algorithm. Perhaps AES. Consider how long it would take you to implement (and then debug) in both Javascript and your choice of Java/C++/C#, etc.
As a mental exercise, consider that I wouldn't do that. I would write it in whatever way makes the most sense. Writing AES in JavaScript does not make sense. Likewise, writing it in C#, C++, or Java does not make sense. It makes sense to write it in C, and to plug it into the language runtime you plan to use.
Again, your complaints make no sense in the context of this thread, or otherwise.
I contend, still, that you do not understand your tools.