the use of "class" in JS

hey guys so recently I readed some documentation about the new implemented option "classes" in Javascript

and I have to admit those features are really wells made ! 

it's not likes ruby wheres everything's is inheritanced  but it's do a pretty well jobs

the only case it's in a ways still just a functions but it's allow the magics of creating a child functions or creating a super method without having to do weird and complex method!

though I ignore if they will someday Implement the possibility of a Easy alias syntax so we would not have to "recall" the method

you can read the documentation here :

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes

so what's you though of this ? for myself I do love the use of class it's permit to keep your coding tracked and in order it's also avoid to have to create weird function for simulate a "class" 
This is ES6 Standard, I doubt that the maker will use this. Its to new.
yeah but I just showed this simply for show the use of the class it's seem pretty much really convenient and usefull
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, please remember to keep your remarks respectful to the person, even if you disagree strongly with their ideas.

Implying that someone is a douche if they follow a particular choice could be read as insulting, even if you don't intend it to be.
I am a little with Ksjp17 here....

I showed this to the people because I found them useful and this was unnecessary to say something like that :/ 

and personally I don't want to host on browser since it's make the people to be connect to internet and this not my interest  at all.
The classes idea is comforting since I like them in Ruby.  Maybe there will be a polyfill developed for those so we can use them in older browsers.

RGSS isn't exactly Ruby, so you never know, JS in RPG Maker might have some special stuff too.
The classes idea is comforting since I like them in Ruby.  Maybe there will be a polyfill developed for those so we can use them in older browsers.

RGSS isn't exactly Ruby, so you never know JS, in RPG Maker might have some special stuff too.
yeah obviously they will adapt this for handles certain extra features but I do think they also have a CERTAIN extend you can allow to modify the current code for what you want to do  before it's begin to much and make it's incompatible with the browsers :/
Hopefully they will have some stuff built in to make the code work right, even if I screw it some how.

I've been reading a lot on JS, so that I can start coding the second MV comes out, but since I haven't actually done all that much yet with it, I'm sure I will stumble a few times.
yeah they will have built-in stuff I do thinks that haha

I work in JS currently and I have to admit ...I still do ruby errors likes instead of writting "this" I write "self" haha
I've been reading about 'this' and all the rules on how it works.  So far I don't get how it works exactly, but I didn't understand 'self' first either and now I use it all the time.
self and this are for Static classes or in simple it's permit to refer to the classes directly I don't know either why you have to use self I don't remember EXACTLY why haha 

but it's mostly for module but I don't know how it's works in JS I do know you have to use them when you do that : 

function foo() {this.info = 0;this.something = function() { };} in simple it's permit to get access the data an to change it 

they keep that in the same mind fo the class but just in easier ways
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. 🙂
@Dreadshadow - You stated the biggest reason I do not like JavaScript in the first part.  JavaScript has way to much freedom.  

Imagine if your countries home language had a rule (that is widely accepted) that let people change the definition of words in an essay/paper/letter and have that word follow that definition from now on throughout the rest of the paper (until changed again).  For small documents, it might not be bad to have this rule used, but the longer it gets, the harder the document would be to follow (and it will even start to get difficult for the writer to keep track of what exactly he said when going back to it).

And this is still no where near as bad as JavaScript in how possibly chaotic it can get.

About the browser and updates, I wish people would actually understand how simple it is to update (There is a reason that Windows 10 automatic updates are mandatory now).  But, following the philosophy it is the customer problem and not yours (in regards to browser usage and the like) is guaranteed to cut the amount of people playing your game by more then half.  

There is a reason that Windows XP is still being supported by game developers.  You could tell the user to upgrade (XP has a lot of problems and vulnerabilities anyways), and they will just look for another game (and tell there friends that it sucks, give bad reviews, etc).  This is especially true for people who make small indie games (this community) who have small to no fanbase to back up the game.

It is a fact that most Windows users use Internet explorer (or edge if Windows 10) to browse the web (it is also a wide margin). I also bet, that majority of them will not even consider switching, no matter what the reasons you give.

If you where told that you would have to use a new browser (that you never heard of) to play a game from a small developer that you think looks kinda neat, would you do it?

Also, (most) companies do not always do the brightest thing when it comes to tech. Many are using outdated systems (many of which have security issues) and archaic ways of handling things.  Even if the alternatives that exist which are better and free (or cheaper).

I strongly recommend that scripters who make public scripts try and make there script have as much backwards compatibility with browsers as possible (or prepare to get bugged about it later on and such).
We have to wait and see first what JS RPG Maker will support.

I believe it will be built in prototypes and I HOPE they will not build it wrong, but take advantage of ALL OOP principles.

Let's also hope that there will be good methods.

Can't wait to see though the new eventing systems and any enhancements. 😀

I wanna see how it can collaborate with JS scripst anyway.
what you mean by built-in prototype? you mean changing the ways Prototype will works 😮 ?
No. Maybe I used that expression wrong. MY bad sorry.

I meant that I believe they will make RGSS4  using prototypes instead of classes.

I might be wrong though, but if they started before the new ECMA it is quite possible.
Let's hope they use proper prototype delegation and don't try to make "classes".  It could get messy if they do.  

I've been reading up on JS and classes just seem to be problematic.
sadly of what I know they do similit classes >w>" 

but yeah it's seem messy but 

function foo() {}are more like a Static classes e.g "module" in ruby 

in simple for handle information? I am not sure though since prototype is still something I study
If you don't implement classes, the only proper way to inherit things in JS (thus not turn your script into a vicious RAM eater) is using prototypes.

I strongly recommend you to study prototypes and how inheritance works here. 😉

Original thread: https://forums.rpgmakerweb.com/threads/the-use-of-class-in-js.44823/