0

I was told that object oriented code is significantly slower when working with multiple clients interacting with a cloud-based server, and not worth considering. From what I understand, if treated as an interpreted language, the difference in speed is negligible when compared to other possible optimizations that could be made. Is it truly different for compiled Javascript, say through Rhino perhaps?

I am not privy to the architecture of the code yet, and I could not find any information that answered my question elsewhere. The code is written in Javascript. Memory footprint is not an issue.

Thank you.

Jeremy
  • 53
  • 6
  • @JaromandaX "There is no object oriented code in javascript anyway" is a patently false assertion. While one can argue all day about details, even "pre-class" ECMAScript fully supports OO via prototypes. – user2864740 Apr 05 '19 at 00:09
  • Well "object-oriented" means a *much* different thing in JavaScript than it does on languages like C++, Java, or C#. Also Rhino is not really interesting anymore as it's obsolete. – Pointy Apr 05 '19 at 00:10
  • @Pointy No, [it really doesn't mean so "much" different](https://en.wikipedia.org/wiki/Object-oriented_programming).. "**Object-oriented programming (OOP) is a programming paradigm based on the concept of "objects", which can contain data, in the form of fields, and code, in the form of procedures.** A feature of objects is an object's procedures that can access and often modify the data fields of the object with which they are associated .. **OOP languages are diverse**, but the most popular ones are class-based.." – user2864740 Apr 05 '19 at 00:10
  • OK well if you want to make believe that inheritance etc. in traditional OO languages like C++, Java, or C# is pretty much the same as JavaScript prototypal inheritance, that's you're privilege. – Pointy Apr 05 '19 at 00:11
  • There's no other way in JavaScript but to use Objects. Functions are objects too. – Daniel Jee Apr 05 '19 at 00:12
  • 2
    @dannyjee Functions being first-class values is irrelevant to OOP (or lack of). – user2864740 Apr 05 '19 at 00:12
  • @user2864740 all I meant was that attempts to map semantics from traditional OO languages like Java to JavaScript results in a huge amount of confusion and frustration. Yes, you can work with "classes" in JavaScript, but there is a long list of profound differences in how things work. – Pointy Apr 05 '19 at 00:15
  • @user2864740 Okay my bad. But to be most effective in JavaScript, you have to follow well known OO principles like information hiding and bundling am I right? – Daniel Jee Apr 05 '19 at 00:16
  • search for a perf to find out? https://jsperf.com – Daniel Lizik Apr 05 '19 at 00:37
  • This discussion is perfect example of why opinion oriented questions are off topic – charlietfl Apr 05 '19 at 00:38
  • @JaromandaX Which is why I prefer to speak using *common terms*, as linked above. Your statement is patently incorrect in relation to common definitions. That's a defensible statement, backed with verifiable information, not an "opinion". – user2864740 Apr 05 '19 at 00:38
  • @JaromandaX https://en.oxforddictionaries.com/definition/opinion , https://www.merriam-webster.com/dictionary/opinion – user2864740 Apr 05 '19 at 00:41
  • @charlietfl While containing a good bit of questionable claims, with a spurious aim and rocky baseline, it is _not_ an opinion oriented question. Presumably (and I do not hold this presumption) there is a 'technical performance reason' to choose one style over another. The claim of opinions was interjected later. – user2864740 Apr 05 '19 at 00:43
  • 1
    I just realised, the OP couldn't give a stuff - it's all been some other person with a bee in his britches about the definition of `OO` - too funny, I'm out - thanks for the patronising links @user2864740 - I'll be sure to file them appropriately in the "round file" – Jaromanda X Apr 05 '19 at 00:47
  • Thank you for the responses. user2864740 is correct, my question is technical - specifically in regards to whether there is a significant enough loss of speed when using a procedural architecture with compiled Javascript and dealing with passing small bits of information between numerous clients and a single cloud server. I am more comfortable with OOP architecture and would rather not discard it off-hand If the speed differences are mere milleseconds. I can't run tests for a while to compare things myself, so I had hopes that maybe someone else already has done something similar. – Jeremy Apr 05 '19 at 02:52

0 Answers0