* FAQ    * Search  * Register * Login 
Active topics
Unanswered topics

All times are UTC-06:00



Post new topic  Reply to topic  [ 12 posts ] 
Author Message
 Post subject: Google Closure, a web code thing.
PostPosted: Sat Mar 03, 2012 7:20 pm 
Offline
DBB Artist
DBB Artist
User avatar

Joined: Mon Aug 01, 2005 8:47 am
Posts: 7124
Location: Ơ̸̦͇̲̬̭̱̰͎̞͈̣͎͚̳ͬ͋̃̀̇͊͂͋͐ͦ̽ͣ̂ͥ͊̅̀̚͠ B̶͖̯͉̜̰̲̓̔͋̈́ͅ È̯ Y̪̤̼͉̠̙͝
I've been picking at its documentation. It's not like jQuery, where you load an entire .js file to use a few modules. It actually is python based and only sends you the exact "minimized" javascript the user needs for his/her instance. When you write the code you don't use basic html and javascript, but a goog.xxx.xxx() kind of syntax.

It's suppose to be compatible and better for making big web apps, which I want to start doing.

It's also different to jQuery in the way you install and use it. Instead of google hosting the entire, like with jQuery APIs, service on their servers you must install it on your own system (edit: on your own web server, that is). I'm still not sure why.

There are also no version numbers of Closure, unlike jQuery which is on 1.7(?). Meaning, they just add junk to it, but only release class names that pass a rigorous testing process.

Any one here use it? Anyone disagree with my summary above?

_________________
s☼-£♦и̫͍ͥ̍ͪ͌̓͗͡о̡̹̱͊̅ͮ̓̕͢б̧̝̻̪̤̳̜͐̓̉ͤ͢͜ ͙̬͙̆̑ͮ̐ͭ̾̂́͘i̎̌̾̓̽̀̈̓̀҉͉̙̦͎̘̝͕f̻͕͔̘ͣͣ̓͊̿͢͜ ͍͔͈͕̮̫ͣ̆ͮ̊͋/♂6Æ!♪╩"▲L└уͭ̂͐̇҉̴̣̼̞̠̯͓̺̞ф̜̊͌̈́̋̏̐́ц̨͔̮̿̇ ̨̛͖̙͖̖̮̗̱ͩ̆͞ͅа̥͇̞̖͚̟̅͐ͤ͞͠͠э̜̘̩̳̬͔̾ͯ̀ͫ̒̐̿ͅͅг̭̖̀ͦ̒̑ͥ̌ͮͫ͞ё͔̟̃ͬ̾̓͟ё̦̞̙̫͔̩͑̀͂ͯ̄̔̃̑̀͠ͅͅ


Top
   
 Post subject: Re: Google Closure, a web code thing.
PostPosted: Sat Mar 03, 2012 7:29 pm 
Offline
DBB Database Master
DBB Database Master
User avatar

Joined: Sun Nov 29, 1998 3:01 am
Posts: 15144
ICQ: 46028958
Website: http://krom.d3k.org
AOL: dutenhnj
Location: Camping the energy center. BTW, did you know you can have up to 100 characters in this location box?
I'd say up front that most technically oriented people aren't going to install some piece of software on their PC just to make one website work in their browser. Flash and Java leave a bad enough taste already, more plugins is not a good thing.


Top
   
 Post subject: Re: Google Closure, a web code thing.
PostPosted: Sat Mar 03, 2012 8:19 pm 
Offline
DBB Master
DBB Master
User avatar

Joined: Sun Sep 05, 1999 2:01 am
Posts: 6377
Location: ☃☃☃
I use the Closure compiler somewhat regularly. I thought that the compiler *was* the Closure project, but apparently there's a lot more to it than that.


Top
   
 Post subject: Re: Google Closure, a web code thing.
PostPosted: Sat Mar 03, 2012 9:17 pm 
Offline
DBB Artist
DBB Artist
User avatar

Joined: Mon Aug 01, 2005 8:47 am
Posts: 7124
Location: Ơ̸̦͇̲̬̭̱̰͎̞͈̣͎͚̳ͬ͋̃̀̇͊͂͋͐ͦ̽ͣ̂ͥ͊̅̀̚͠ B̶͖̯͉̜̰̲̓̔͋̈́ͅ È̯ Y̪̤̼͉̠̙͝
Krom wrote:
I'd say up front that most technically oriented people aren't going to install some piece of software on their PC just to make one website work in their browser. Flash and Java leave a bad enough taste already, more plugins is not a good thing.


It's installed on the server side, like all Python web stuff.


@jeff, you use it just to clean up your js files? edit: you mean you use this ( http://closure-compiler.appspot.com/home )regularly, or something else? I thought it was a pretty cool web app.

edit:

Here's what I've been looking at.
https://developers.google.com/closure/l ... s/tutorial
Code:
goog.provide('tutorial.notepad');
goog.provide('tutorial.notepad.Note');

goog.require('goog.dom');
goog.require('goog.ui.Zippy');

/**
 * Iterates over a list of note data objects, creates a Note instance
 * for each one, and tells the instance to build its DOM structure.
 */
tutorial.notepad.makeNotes = function(data, noteContainer) {
  var notes = [];
  for (var i = 0; i < data.length; i++) {
    var note =
      new tutorial.notepad.Note(data[i].title, data[i].content, noteContainer);
    notes.push(note);
    note.makeNoteDom();
  }
  return notes;
};

/**
 * Manages the data and interface for a single note.
 */
tutorial.notepad.Note = function(title, content, noteContainer) {
  this.title = title;
  this.content = content;
  this.parent = noteContainer;
};

/**
 * Creates the DOM structure for the note and adds it to the document.
 */
tutorial.notepad.Note.prototype.makeNoteDom = function() {
  // Create DOM structure to represent the note.
  this.headerElement = goog.dom.createDom('div',
      {'style': 'background-color:#EEE'}, this.title);
  this.contentElement = goog.dom.createDom('div', null, this.content);
  var newNote = goog.dom.createDom('div', null,
      this.headerElement, this.contentElement);

  // Add the note's DOM structure to the document.
  goog.dom.appendChild(this.parent, newNote);
  return new goog.ui.Zippy(this.headerElement, this.contentElement);


I don't like their tutorials.

_________________
s☼-£♦и̫͍ͥ̍ͪ͌̓͗͡о̡̹̱͊̅ͮ̓̕͢б̧̝̻̪̤̳̜͐̓̉ͤ͢͜ ͙̬͙̆̑ͮ̐ͭ̾̂́͘i̎̌̾̓̽̀̈̓̀҉͉̙̦͎̘̝͕f̻͕͔̘ͣͣ̓͊̿͢͜ ͍͔͈͕̮̫ͣ̆ͮ̊͋/♂6Æ!♪╩"▲L└уͭ̂͐̇҉̴̣̼̞̠̯͓̺̞ф̜̊͌̈́̋̏̐́ц̨͔̮̿̇ ̨̛͖̙͖̖̮̗̱ͩ̆͞ͅа̥͇̞̖͚̟̅͐ͤ͞͠͠э̜̘̩̳̬͔̾ͯ̀ͫ̒̐̿ͅͅг̭̖̀ͦ̒̑ͥ̌ͮͫ͞ё͔̟̃ͬ̾̓͟ё̦̞̙̫͔̩͑̀͂ͯ̄̔̃̑̀͠ͅͅ


Top
   
 Post subject: Re: Google Closure, a web code thing.
PostPosted: Sat Mar 03, 2012 9:28 pm 
Offline
DBB Master
DBB Master
User avatar

Joined: Sun Sep 05, 1999 2:01 am
Posts: 6377
Location: ☃☃☃
I'd assume that that's a Web frontend for what I use:
http://closure-compiler.googlecode.com/ ... latest.zip

Used like so:
Code:
java -jar compiler.jar < input.js > output.js


Or for my purposes, I usually automate it as a Makefile rule:
Code:
all:    build/list.js build/of.js build/javascript.js build/files.js

build/%.js: %.js
        java -jar compiler.jar < $< > $@

clean:
        rm -f build/*.js


Top
   
 Post subject: Re: Google Closure, a web code thing.
PostPosted: Sat Mar 03, 2012 9:34 pm 
Offline
DBB Artist
DBB Artist
User avatar

Joined: Mon Aug 01, 2005 8:47 am
Posts: 7124
Location: Ơ̸̦͇̲̬̭̱̰͎̞͈̣͎͚̳ͬ͋̃̀̇͊͂͋͐ͦ̽ͣ̂ͥ͊̅̀̚͠ B̶͖̯͉̜̰̲̓̔͋̈́ͅ È̯ Y̪̤̼͉̠̙͝
I've seen people use that too. Someone was asking about using it with out having to set up a whole project, which I assume means installing it into your apache server.

Jeff, you don't use any of their fancy goog libraries?

_________________
s☼-£♦и̫͍ͥ̍ͪ͌̓͗͡о̡̹̱͊̅ͮ̓̕͢б̧̝̻̪̤̳̜͐̓̉ͤ͢͜ ͙̬͙̆̑ͮ̐ͭ̾̂́͘i̎̌̾̓̽̀̈̓̀҉͉̙̦͎̘̝͕f̻͕͔̘ͣͣ̓͊̿͢͜ ͍͔͈͕̮̫ͣ̆ͮ̊͋/♂6Æ!♪╩"▲L└уͭ̂͐̇҉̴̣̼̞̠̯͓̺̞ф̜̊͌̈́̋̏̐́ц̨͔̮̿̇ ̨̛͖̙͖̖̮̗̱ͩ̆͞ͅа̥͇̞̖͚̟̅͐ͤ͞͠͠э̜̘̩̳̬͔̾ͯ̀ͫ̒̐̿ͅͅг̭̖̀ͦ̒̑ͥ̌ͮͫ͞ё͔̟̃ͬ̾̓͟ё̦̞̙̫͔̩͑̀͂ͯ̄̔̃̑̀͠ͅͅ


Top
   
 Post subject: Re: Google Closure, a web code thing.
PostPosted: Sat Mar 03, 2012 9:42 pm 
Offline
DBB Master
DBB Master
User avatar

Joined: Sun Sep 05, 1999 2:01 am
Posts: 6377
Location: ☃☃☃
The compiler is just a standalone tool, so no reason for why your server should need to use it, unless you want to do something questionable like automatically optimize dynamically generated javascript.

I don't know anything about this library though. I guess I've never had any reason to look beyond jquery. If you find anything cool about it, let us know.


Top
   
 Post subject: Re: Google Closure, a web code thing.
PostPosted: Sat Mar 03, 2012 9:59 pm 
Offline
DBB Artist
DBB Artist
User avatar

Joined: Mon Aug 01, 2005 8:47 am
Posts: 7124
Location: Ơ̸̦͇̲̬̭̱̰͎̞͈̣͎͚̳ͬ͋̃̀̇͊͂͋͐ͦ̽ͣ̂ͥ͊̅̀̚͠ B̶͖̯͉̜̰̲̓̔͋̈́ͅ È̯ Y̪̤̼͉̠̙͝
I might go further into it. However dudes like this offer stuff that makes more sense to me: http://raphaeljs.com/

Check out his demo on a diagram: http://raphaeljs.com/graffle.html

apparently this stuff even work in IE6. I'll have to try it later.


This Raphael guy turns javascript into something that looks like pygame, to me:

Code:
var paper = Raphael(10, 50, 320, 200);
var circle = paper.circle(50, 40, 10);
circle.attr("fill", "#f00");
circle.attr("stroke", "#fff");

That makes a circle! I tried it. It works.
It defines a space and then imports a class then applies an attribute. Very similar to what I've seen in pygame or wxpython. It's not as noob friendly as jQuery is, so it's tough on me. Google's Closure, in contrast, is noob proof. I have yet to install anything of theirs...

_________________
s☼-£♦и̫͍ͥ̍ͪ͌̓͗͡о̡̹̱͊̅ͮ̓̕͢б̧̝̻̪̤̳̜͐̓̉ͤ͢͜ ͙̬͙̆̑ͮ̐ͭ̾̂́͘i̎̌̾̓̽̀̈̓̀҉͉̙̦͎̘̝͕f̻͕͔̘ͣͣ̓͊̿͢͜ ͍͔͈͕̮̫ͣ̆ͮ̊͋/♂6Æ!♪╩"▲L└уͭ̂͐̇҉̴̣̼̞̠̯͓̺̞ф̜̊͌̈́̋̏̐́ц̨͔̮̿̇ ̨̛͖̙͖̖̮̗̱ͩ̆͞ͅа̥͇̞̖͚̟̅͐ͤ͞͠͠э̜̘̩̳̬͔̾ͯ̀ͫ̒̐̿ͅͅг̭̖̀ͦ̒̑ͥ̌ͮͫ͞ё͔̟̃ͬ̾̓͟ё̦̞̙̫͔̩͑̀͂ͯ̄̔̃̑̀͠ͅͅ


Top
   
 Post subject: Re: Google Closure, a web code thing.
PostPosted: Sun Mar 04, 2012 10:34 am 
Offline
DBB Database Master
DBB Database Master
User avatar

Joined: Sun Nov 29, 1998 3:01 am
Posts: 15144
ICQ: 46028958
Website: http://krom.d3k.org
AOL: dutenhnj
Location: Camping the energy center. BTW, did you know you can have up to 100 characters in this location box?
Isaac wrote:
Krom wrote:
I'd say up front that most technically oriented people aren't going to install some piece of software on their PC just to make one website work in their browser. Flash and Java leave a bad enough taste already, more plugins is not a good thing.


It's installed on the server side, like all Python web stuff.

Ah ok, the way you wrote your post it sounded like it had to be installed on the client.


Top
   
 Post subject: Re: Google Closure, a web code thing.
PostPosted: Sun Mar 04, 2012 12:26 pm 
Offline
DBB Artist
DBB Artist
User avatar

Joined: Mon Aug 01, 2005 8:47 am
Posts: 7124
Location: Ơ̸̦͇̲̬̭̱̰͎̞͈̣͎͚̳ͬ͋̃̀̇͊͂͋͐ͦ̽ͣ̂ͥ͊̅̀̚͠ B̶͖̯͉̜̰̲̓̔͋̈́ͅ È̯ Y̪̤̼͉̠̙͝
Isaac wrote:
I might go further into it. However dudes like this offer stuff that makes more sense to me: http://raphaeljs.com/

Check out his demo on a diagram: http://raphaeljs.com/graffle.html


Update on this. That raphael js has a creator, Dmitry Baranovskiy, that is bad mouthing google's Closure Library:
""" “Just what the world needs—another sucky JavaScript library,” he said. When I asked him what made it ‘sucky’, he elaborated. “It’s a JavaScript library written by Java developers who clearly don’t get JavaScript.” """ Source: http://www.sitepoint.com/google-closure ... avascript/

Maybe he's saying this because he feels like his library is competing with Closure? Or maybe he's right. Maybe the Closure library, not to be confused with the Closure Compiler, is crap.

_________________
s☼-£♦и̫͍ͥ̍ͪ͌̓͗͡о̡̹̱͊̅ͮ̓̕͢б̧̝̻̪̤̳̜͐̓̉ͤ͢͜ ͙̬͙̆̑ͮ̐ͭ̾̂́͘i̎̌̾̓̽̀̈̓̀҉͉̙̦͎̘̝͕f̻͕͔̘ͣͣ̓͊̿͢͜ ͍͔͈͕̮̫ͣ̆ͮ̊͋/♂6Æ!♪╩"▲L└уͭ̂͐̇҉̴̣̼̞̠̯͓̺̞ф̜̊͌̈́̋̏̐́ц̨͔̮̿̇ ̨̛͖̙͖̖̮̗̱ͩ̆͞ͅа̥͇̞̖͚̟̅͐ͤ͞͠͠э̜̘̩̳̬͔̾ͯ̀ͫ̒̐̿ͅͅг̭̖̀ͦ̒̑ͥ̌ͮͫ͞ё͔̟̃ͬ̾̓͟ё̦̞̙̫͔̩͑̀͂ͯ̄̔̃̑̀͠ͅͅ


Top
   
 Post subject: Re: Google Closure, a web code thing.
PostPosted: Sun Mar 04, 2012 6:25 pm 
Offline
DBB Master
DBB Master
User avatar

Joined: Sun Sep 05, 1999 2:01 am
Posts: 6377
Location: ☃☃☃
In the article, he does plug jquery, so I don't think he minds plugging other libraries per se.


Top
   
 Post subject: Re: Google Closure, a web code thing.
PostPosted: Sun Mar 04, 2012 9:27 pm 
Offline
DBB Artist
DBB Artist
User avatar

Joined: Mon Aug 01, 2005 8:47 am
Posts: 7124
Location: Ơ̸̦͇̲̬̭̱̰͎̞͈̣͎͚̳ͬ͋̃̀̇͊͂͋͐ͦ̽ͣ̂ͥ͊̅̀̚͠ B̶͖̯͉̜̰̲̓̔͋̈́ͅ È̯ Y̪̤̼͉̠̙͝
I'm just going to write my own javascript library and learn javascript on the way.

_________________
s☼-£♦и̫͍ͥ̍ͪ͌̓͗͡о̡̹̱͊̅ͮ̓̕͢б̧̝̻̪̤̳̜͐̓̉ͤ͢͜ ͙̬͙̆̑ͮ̐ͭ̾̂́͘i̎̌̾̓̽̀̈̓̀҉͉̙̦͎̘̝͕f̻͕͔̘ͣͣ̓͊̿͢͜ ͍͔͈͕̮̫ͣ̆ͮ̊͋/♂6Æ!♪╩"▲L└уͭ̂͐̇҉̴̣̼̞̠̯͓̺̞ф̜̊͌̈́̋̏̐́ц̨͔̮̿̇ ̨̛͖̙͖̖̮̗̱ͩ̆͞ͅа̥͇̞̖͚̟̅͐ͤ͞͠͠э̜̘̩̳̬͔̾ͯ̀ͫ̒̐̿ͅͅг̭̖̀ͦ̒̑ͥ̌ͮͫ͞ё͔̟̃ͬ̾̓͟ё̦̞̙̫͔̩͑̀͂ͯ̄̔̃̑̀͠ͅͅ


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 12 posts ] 

All times are UTC-06:00


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron



Descent'rs have piloted these pages
 
The layout and contents contained within this site are © DescentBB.net 1997-2006.
Descent, Descent II are © Parallax Software Corporation.
Descent III is Outrage Entertainment.
Descent is a Trademark of Interplay Productions.

Miner Wars™ is trademark of Keen Software House s. r. o.
.


Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group