Jump to content
MakeWebGames

Ajax or not?


a_bertrand

Ajax or not?  

15 members have voted

  1. 1. Ajax or not?

    • Yes NWE should have AJAX and other dynamic content
      11
    • No, let's keep it simple for a developer point of view.
      4


Recommended Posts

Hi,

As the engine is growing, I was wondering how many of you would like to have some more "dynamic" kind of result, for example, having the jail time updating, or modules working with ajax and maybe some base ajax functionality offered by the engine itself.

Now to make things a bit more clear, of course well done ajax website can bring a new dimension to the website, where poorly crafted one can actually make things just more complex for the user. On the other side, if you add ajax to the engine it may make things more complex to develop too.

As the engine is ultimately not for myself (I'm mean I develop it but you guys will be the customers), you should choose what you would like to have. Ajax or not? Don't ask for "let it be configurable" as either a page has some understanding of AJAX some dynamic or it doesn't.

Link to comment
Share on other sites

Well actually I was also wondering if I shall use jQuery or not. Even if I don't like much jQuery syntax it does help by removing some of the JS pain. On the other side, a simply ajax call is not all that complex, and I could write it without the need of any 3rd party library. So, that could be a second step question, if Ajax is a wished feature for the engine.

Link to comment
Share on other sites

It's a bit like a DIFF, and of course you could have such system or simply an if with yet another GetConfigValue access.

Anyhow due to the result of the pool it's more or less clear you guys like the ajax idea, therefore I will check what to do in that direction.

Link to comment
Share on other sites

Well, websites still not using Ajax functionality where possible is either created by lazy developers or people who don't quite understand Ajax.

Ajax accounts for 30% of my Javascript headaches, but if it were to be natively implemented it would take weeks or months to create a proper Ajax application.

Also, jQuery(and other frameworks alike) was made for a reason... it seems to me that most people still don't quite understand why.

The web is dynamic, browsers are inconsistent and most of all Javascript is an art to master.

Unlike PHP or most other interpreted languages, there is no "one" way Javascript is executed in the browser.

In Chrome(V8 engine) Javascript is compiled into machine code and then executed, others interpret and some execute bytecode.

Let's take a simple example, IE vs Every other browser on earth - Round one: substr.

In every language I've ever programmed in, the following will return the last character of the string "t"(rewritten to specific syntax):

"Javascript".substr(-1, 1)

In IE the function returns the first character, the simple answer is that the implementation of substr is so different with IE in such a way that if the first parameter of substr is a negative integer it interprets a string, i.e. the resulting code in other browsers will be:

"Javascript".substr(0, 1) // J

 

That was a *very* simple example, and it's something not a lot of people know about.

But... when you actually learn(instead of use) Javascript, these are vital things you need to know about.

Sure one could write hacks all over, and even write a class to replace all native functions to function the same in all browsers, but that would be a damn mission.

What jQuery(and others alike) attempts to do, is solve these issues by creating something called a framework.

In my mind only fools try to reinvent the wheel.

On to Ajax then...

$.ajax v.s. XMLHttpRequest.

Wait, old IE doesn't support this.

$.ajax v.s. ActiveXObject("Msxml2.XMLHTTP").

Wait, new IE doesn't support this.

$.ajax v.s. ActiveXObject("Microsoft.XMLHTTP")

Wait, no other browser on earth supports this.

$.ajax vs $.ajax.

Every major browser supports this.

See what I did there?

But that's not the only reason to use a framework'd Ajax implementation.

Things like caching, callbacks, encodings, data formats, request formats, etc. are all pretty damn neat features.

And I would put money on that if anyone were to develop something that features all of that, they would probably mess it up somehow.

Now compare all this, to - I just know you people are going to contradict me with it, so here - a ~100KB size framework.

Something you don't have to push into a repo and maintain, something that just always works whenever you use it.

There's a place to use native Javascript, but I do not believe Ajax is such an occasion.

Note: This post was not directed at anyone - I'm just rambling on about my love of Javascript.

Link to comment
Share on other sites

Ok lucky enough jquery is under MIT license and not only GPL otherwise it would not be possible to include it. Why? Because if you use a GPL software within your project your project must be under GPL as well which would be a show stopper for me.

On the library level, sure 100Kb could be somewhat annoying, however it should be a one time per site loading or, you may even point to a copy located somewhere else with the hope the player already downloaded that one.

JQuery has indeed be created for good reasons, as you said Spudinski, and it was both to create some sort of abstraction layer and remove the pain of such stupid browser compatibility, add a CSS selector to JS as well as easy up animations (what people think jquery is, where actually the framework does more than simply fade and movements).

So does it make sense to use jQuery instead of recreating the wheel? Yes, however knowing how a wheel works is also important ;) finally, there could be some issues if you need to learn jQuery AND JS as you actually need to know both to really code with jQuery, or maybe jQuery does make the learning process easier... I don't know.

Link to comment
Share on other sites

Ok lucky enough jquery is under MIT license and not only GPL otherwise it would not be possible to include it. Why? Because if you use a GPL software within your project your project must be under GPL as well which would be a show stopper for me.

On the library level, sure 100Kb could be somewhat annoying, however it should be a one time per site loading or, you may even point to a copy located somewhere else with the hope the player already downloaded that one.

JQuery has indeed be created for good reasons, as you said Spudinski, and it was both to create some sort of abstraction layer and remove the pain of such stupid browser compatibility, add a CSS selector to JS as well as easy up animations (what people think jquery is, where actually the framework does more than simply fade and movements).

So does it make sense to use jQuery instead of recreating the wheel? Yes, however knowing how a wheel works is also important ;) finally, there could be some issues if you need to learn jQuery AND JS as you actually need to know both to really code with jQuery, or maybe jQuery does make the learning process easier... I don't know.

Yes, it's duly licensed. The addition to the MIT license will allow you to append your own license to the content modified.

jQuery's Javascript so the learning curve is much easier if one already knows Javascript.

Nothing changes w.r.t. the way that onewould normally write Javascript, only the addition is of a framework that is used.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...