The Cache: Technology Expert's Forum
 
*
Welcome, Guest. Please login or register. September 16, 2019, 05:18:55 PM

Login with username, password and session length


Pages: [1]
  Print  
Author Topic: Using javascript like for real - might sound retarded...  (Read 2537 times)
kurdt
Lifer
*****
Offline Offline

Posts: 1153


paha arkkitehti


View Profile
« on: February 24, 2010, 04:08:29 AM »

I just had the strangest idea or relevelation depending who you ask. Are you still programming in a way that everything that happens on the screen must come from backend. Let me explain: You have a database interface with grids and columns. You do ajax powered interface that reads and writes from the database. Now when visitor changes something, do you process POST variables, save to database and refresh the value on the UI. But why? This creates lag and unnecessary server load. You could almost as easily to update the changed value in DOM so UI stays current and then just save it to the database. I mean all normal applications do is to display character information. Why can't you just do like 1 jQuery call for your own jQuery function that updates value in #id. There's probably already jQuery native API call for this and that's what I'm studying next. With this you just cut your requests in half. I know this doesn't really concern 99.8% of the webapps because with their userbases, they can run in the cheapest shared hosting you can find but it's a big deal if you design system that needs to scale. Less tasks for processing, less power needed when scaling.

Am I the only one didn't update UI with javascript and instead just relied on ajax reading with polling the server or with COMET server? I mean it's no wonder that most of the webapps seems sluggish if you have to communicate every change with the server when the inferface could be done in the browser with user's CPU or GPU if you use that experimental JS library and server could process mostly data writing instead of generating websites.

Web-development seems so "young" compared to operating system development. In OS world it's kinda obvious that you update the UI separately when action happens and you save data when it needs to be saved. It's little bit puzzling because to me it appears that web development is much easier than OS so why there isn't a proper framework with this mentality? And as for SproutCore and Capuccino it seems that those frameworks will only make my life more difficult because I have to learn Objective-C for Cappuccino and Ruby for SproutCore which doesn't make any sense. Isn't framework's job to make my life easier and not require me to learn something much harder than what I'm currently doing? Great example for great "framework" is jQuery. It's javascript library but the way it makes things easier. In PHP world I would say CodeIgnitor. The way it handles database stuff, it's just excellent and so fast to use. Lunascript seems exactly what I'm trying to describe.
« Last Edit: February 24, 2010, 06:03:16 AM by kurdt » Logged

I met god and he had nothing to say to me.
Phaėton
Lifer
*****
Offline Offline

Posts: 555


⎝⏠⏝⏠⎠


View Profile
« Reply #1 on: February 24, 2010, 05:48:38 AM »

Very interesting.  The tower of babel's starting to look like it might get organized.

Logged

When I was your age we used to walk to the TV to change the channel....  _̴ı̴̴̡̡̡ ̡͌l̡̡̡ ̡͌l̡*̡̡ ̴̡ı̴̴̡ ̡̡͡|̲̲̲͡͡͡ ̲▫̲͡ ̲̲̲͡͡π̲̲͡͡ ̲̲͡▫̲̲͡͡ ̲|̡̡̡ ̡ ̴̡ı̴̡̡
arms
Expert
****
Offline Offline

Posts: 235



View Profile
« Reply #2 on: February 24, 2010, 07:07:01 AM »

you could accomplish this with javascript + couchdb.
Logged
kurdt
Lifer
*****
Offline Offline

Posts: 1153


paha arkkitehti


View Profile
« Reply #3 on: February 24, 2010, 08:24:46 AM »

you could accomplish this with javascript + couchdb.
Funny thing that I have been studying couchdb for the past few months but I'm still having problems in letting go of the old sqlish database scheme. But I do think that when userbase of internet grows, people will start to use databases like couchdb that are built to scale. Only ~25% of human population is online so there's still ~75% more potential load Smiley
Logged

I met god and he had nothing to say to me.
Pages: [1]
  Print  
 
Jump to:  

Perkiset's Place Home   Best of The Cache   phpMyIDE: MySQL Stored Procedures, Functions & Triggers
Politics @ Perkiset's   Pinkhat's Perspective   
cache
mart
coder
programmers
ajax
php
javascript
Powered by MySQL Powered by PHP Powered by SMF 1.1.2 | SMF © 2006-2007, Simple Machines LLC
Seo4Smf v0.2 © Webmaster's Talks


Valid XHTML 1.0! Valid CSS!