Javascript has actually an advantage that can also be a disadvantage.
You CAN:
- Create an object without declaring a class. There is actually no class. (Yes yes I know prototypes but they are not classes as people know them traditionally).
- Add and remove attributes and I think methods too, at will.
Now look. On the right hands, such flexibility, gives great power. But great power needs great responsibility. Thus people should code stuff well or the whole project will become a clusterf@$k..
Because Javascript is really a VERY flexible language, VERY different from C++ or Java or any other "traditional" OOP language, it caused some issues.
Let's say I know Javascript. When I say I know, let's assume that I am a guru (I am not
😛 )
Let's say I start working at a comapny's IT department, as a specialist on JS to fix some website issues.
Now the PREVIOUS "specialist" created a NOT-SO-OBJECT-ORIENTED and a not so consistent big and huge part of code. But he used modules, in a way to make our lives even more miserable.
Even if you are a specialist, you can NOT make sense easily from code that doesn't follow some well scientifcally approved principles.
I assume such scenarios led the "market" to ask for new ECMA standards that support classes, so we might see traditional way of coding soon on JS.
So because you asked my opinion on this, you will get it.
I salute such a move. I really love how Java and other "traditional" OOP languages work. I also wished Java could be more flexible, but because the way it is made, no spaghetti code will be made easily on Java. There are people though that blew it, even in Java.
😛
On the other hand, we might have compatibility issues:
Well, if you only support google chrome 42 and up, and firefox in debug modeand only deploy to html5 you could use them....
You will probably loose arround 50% of your potential audience probably, but that doesn't mean you can't do it if you want to be a douche...
@Ramiro you got a point on compatibility and you are right on the issues that might occur, but in my opinion you are wrong at the same time. Both Firefox and Chrome are provided for free. If someone is too lazy to update a web browser it's
their problem, not yours as a developer. Why not calling
them a douche then using the same logic?
This also applies to Java verisons, flash version etc etc. Nobody is a douche really, I can understand how you used that expression, but seriously, if someone is too lazy to allow chrome do an update, then sorry but it's not the developer's problem. Can you imagine yourself making a website of 2000 lines of code, and then having someone demanding to have cross browser compatibility with Chrome and Firefox?
Of course you do. It's easy. Just a bunch of more lines of code right? How about Internet Explorer 6 compatibility then? You just need to rewrite the whole website from scratch. Don't be a douche!
😛
See why this is not and MUST not be YOUR problem, except if you are a web browser developer? Also ECMA standards are just that. What if an ECMA standard fixes a lot of security issues? Would companies care about someone not updating the web browser? Not to mention that you can put a messagebox or better yet the very web page telling the uset ot update.
I hope repeating that bad word was not too toxic. Also I do not wanna cause any drama here. I believe @Ramiro had no intentions to insult @nio kasgami. That told I end my reply.
🙂