DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Zones

Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks

Curious about the future of data-driven systems? Join our Data Engineering roundtable and learn how to build scalable data platforms.

Data Engineering: The industry has come a long way from organizing unstructured data to adopting today's modern data pipelines. See how.

Threat Detection: Learn core practices for managing security risks and vulnerabilities in your organization — don't regret those threats!

Managing API integrations: Assess your use case and needs — plus learn patterns for the design, build, and maintenance of your integrations.

Avatar

Axel Rauschmayer

CEO, CTO, CIO, CFO at Freelancer

München, DE

Joined Mar 2003

About

Dr. Axel Rauschmayer is a freelance software engineer, blogger and educator, located in Munich, Germany.

Stats

Reputation: 5
Pageviews: 826.9K
Articles: 7
Comments: 188
  • Articles
  • Comments

Articles

article thumbnail
Implementing a Command Line With Eval in JavaScript
This blog post explores JavaScript’s eval function by implementing the foundation for an interactive command line. As a bonus, you’ll get to work with ECMAScript.next’s generators (which can already be tried out on current Firefox versions). Writing an evaluator Let’s say you want to implement an interactive command line for JavaScript (such as [1]). On one hand, you would need to get the graphical user interface right: The user inputs JavaScript code, the command line evaluates the code and displays the result. On the other hand, you would have to implement the evaluation. That’s what we will take on here. It is more complex that it initially seems and teaches us a lot about eval. For starters, let’s write a constructor Evaluator: function Evaluator() { } Evaluator.prototype.evaluate = function (str) { return JSON.stringify(eval(str)); }; To use the evaluator, we create an instance and send JavaScript code to it: > var e = new Evaluator(); > e.evaluate("Math.pow(2, 53)") '9007199254740992' > e.evaluate("3 * 7") '21' > e.evaluate("'foo'+'bar'") '"foobar"' JSON.stringify is used so that the evaluation results can be shown to the user and look like the input. Without stringify, things look as follows: > console.log(123) // OK 123 > console.log("abc") // not OK abc With stringify, everything looks OK: > console.log(JSON.stringify(123)) 123 > console.log(JSON.stringify("abc")) "abc" Note that undefined is not valid JSON, but stringify converts it to undefined (the value, not the string), which is fine for our purposes. What we have implemented so far works for basic things, but still has several problems. Let’s tackle them one at a time. Problem: declarations You can evaluate variable and function declarations, but they are forgotten immediately afterwards: > e.evaluate("var x = 12;") undefined > e.evaluate("x") ReferenceError: x is not defined How do we fix this? The following code is a solution: function Evaluator() { this.env = {}; } Evaluator.prototype.evaluate = function (str) { str = rewriteDeclarations(str); var __environment__ = this.env; // (1) with (__environment__) { // (2) return JSON.stringify(eval(str)); } }; function rewriteDeclarations(str) { // Prefix a newline so that search and replace is simpler str = "\n" + str; str = str.replace(/\nvar\s+(\w+)\s*=/g, "\n__environment__.$1 ="); // (3) str = str.replace(/\nfunction\s+(\w+)/g, "\n__environment__.$1 = function"); return str.slice(1); // remove prefixed newline } this.env holds all variable declarations and function declarations in its properties. We make it accessible to the input in two steps. Step 1 – declare: We assign this.env to __environment__ (1) and rewrite the input so that, among other things, each var declaration assigns to __environment__ (3). That demonstrates one important aspect of eval: it sees all variables in surrounding scopes. That is, if you invoke eval inside your function, you expose all of its internals. The only way to keep those internals secret is to put the eval call in a separate function and call that function. Step 2 – access: Use a with statement so that the properties of __environment__ appear as variables to the eval-ed code. This is not an ideal solution, more of a compromise: with should be avoided [2] and can’t be used in the advantageous strict mode [3]. But it is a quick solution for us now. A work-around is quite complex [4]. > var e = new Evaluator(); > e.evaluate("var x = 123;") '123' > e.evaluate("x") '123' Minor drawback: Normal var declarations have the result undefined; due to our rewriting we now get the value that is assigned to the variable. Problem: exceptions Right now, throwing an exception in evaluate’s input means that the method will throw: > e.evaluate("* 3") SyntaxError: Unexpected token * That is obviously unacceptable: In a graphical user interface, we want to report errors back to the user, not (invisibly) throw an exception. Here is one simple way of doing so: Evaluator.prototype.evaluate = function (str) { try { str = rewriteDeclarations(str); var __environment__ = this.env; with (__environment__) { return JSON.stringify(eval(str)); } } catch (e) { return e.toString(); } }; There is nothing surprising in this code, we simply use try-catch and report back what happened. More sophisticated solutions will want to do more, e.g. display the exception’s stack trace. The new evaluator in action: > var e = new Evaluator(); > e.evaluate("* 3") 'SyntaxError: Unexpected token *' Problem: console.log How do we handle calls to console.log in the input? Logged messages should be shown to the user, not be sent to the browser’s console. The solution is surprisingly easy: function Evaluator(cons) { this.env = {}; this.cons = cons; } Evaluator.prototype.evaluate = function (str) { try { str = rewriteDeclarations(str); var __environment__ = this.env; var console = this.cons; with (__environment__) { return JSON.stringify(eval(str)); } } catch (e) { return e.toString(); } }; The constructor now receives a custom implementation of console and assigns it to this.cons. By assigning that object to a local variable named console (1), we temporarily shadow the global console for eval, there is no need to replace it. Beware that that shadowing affects all of the function, you won’t be able to use the browser’s console anywhere in evaluate. The new evaluator in action: > var cons = { log: function (m) { console.log("### "+m) } }; > var e = new Evaluator(cons); > e.evaluate("console.log('hello')") ### hello undefined Problem: eval creates bindings inside the function One scary feature of eval is that it creates variable bindings inside the function that invokes it: > (function () { eval("var x=3"); return x }()) 3 Fortunately, the fix is easy: use strict mode. > (function () { "use strict"; eval("var x=3"); return x }()) ReferenceError: x is not defined You can’t use with in strict mode, so you’ll have to replace it with a work-around [4]. Keeping declarations in an environment An environment is where JavaScript keeps the parameters and variables of a function. It maps variable names to values and is thus similar to an object. We might be able to avoid rewriting the input and manage declarations via environments. The idea is as follows. eval puts declarations in some environment: Non-strict mode: the environment of the surrounding function. Strict mode: a newly created environment. What if we could reuse that environment for the next invocation of eval, instead of throwing it away? Then eval would properly remember prior declarations. Strict mode gives us no way to access the temporary environment it creates for each invocation. However, in non-strict mode, we might be able to keep the environment of the surrounding function around. The following subsections explore two ways of doing so. Declarations via nested scopes If you create a function g inside another function f, then g permanently retains a reference to f’s current environment envf. Whenever g is called, a new g-specific environment envg is created. But envg points to its parent environment envf. Variables that can’t be found in g’s scope (as managed via envg), are looked up in f’s scope (via envf). Thus, envf is not lost, as long as g exists. That gives us a strategy for keeping the environment of the function that calls eval around. In the following code that function is called evalHelper and creates a new function that has to be used for the next call of eval. Hence, declarations made in the former function are accessible in the later function. function Evaluator() { var that = this; that.evalHelper = function (str) { that.evalHelper = function (str) { return eval(str); }; return eval(str); }; } Evaluator.prototype.evaluate = function (str) { return this.evalHelper(str); }; The fatal problem of this implementation is that you cannot nest to arbitrary depth. But, for the above depth of 2, it works perfectly: > var e = new Evaluator(); > e.evaluate("var x = 7;"); undefined > e.evaluate("x * 3") 21 Declarations via a generator It would be great if we could “restart” the function that calls eval, re-enter it with its previous environment still in place. ECMAScript.next’s generators [5] let you do that. Current versions of Firefox already support generators. Here is a demonstration of how they work in these versions (in ECMAScript.next, you will have to write function*, but apart from that, the code is the same): function mygen() { console.log((yield 0) + " @ 0"); console.log((yield 1) + " @ 1"); console.log((yield 2) + " @ 2"); } The above is a generator function. Invoke it and it will create a generator object. On that object, you first need to invoke the next() method to start execution. A yield x inside the code pauses execution and returns x to the the previously called generator object method. After the first next(), you can either call next() or send(y). The latter means that the currently paused yield will continue and produce the value y. The former is equivalent to send(undefined). The following interaction shows mygen in use: > var g = mygen(); > g.next() // can’t use send() the first time 0 > g.send("a") // continue after yield 0, pause again a @ 0 1 > g.send("b") b @ 1 2 The following is an implementation of Evaluator that calls eval via the generator evalGenerator. Because of that, eval always sees the same environment and remembers declarations. function evalGenerator(console) { var str = yield; while(true) { try { var result = JSON.stringify(eval(str)); str = yield result; } catch (e) { str = yield e.toString(); } } } function Evaluator(cons) { this.evalGen = evalGenerator(cons); this.evalGen.next(); // start } Evaluator.prototype.evaluate = function (str) { return this.evalGen.send(str); }; The new evaluator works as expected. > var e = new Evaluator(); > e.evaluate("var x = 7;") undefined > e.evaluate("x * 2") "14" > e.evaluate("* syntax_error") "SyntaxError: missing ; before statement" The biggest problem with this solution is that it uses the deprecated features non-strict eval together with the new feature generators. There will probably be a way in ECMAScript.next to make this combination work, but it will be a hack and should thus be avoided. Conclusion We have used eval to implement a helper type for a command line. While doing so, we learned a few interesting things about eval: Letting it remember declarations between invocations is complicated; it can access all variables in the scopes surrounding its invocation; and in non-strict mode, it can even create new variables inside the invoking function. The best solution for remembering declarations would be for eval to have an optional parameter for an environment (to be reused), but that is not in the cards. Therefore, the only truly safe solution in pure JavaScript is to use a full-featured JavaScript parser such as esprima to rewrite critical parts of the input code. That is left as an exercise to the reader. References Combining code editing with a command line JavaScript’s with statement and why it’s deprecated JavaScript’s strict mode: a summary Handing variables to eval Asynchronous programming and continuation-passing style in JavaScript
July 27, 2012
· 4,675 Views
article thumbnail
Converting a Value to String in JavaScript
In JavaScript, there are three main ways in which any value can be converted to a string. This blog post explains each way, along with its advantages and disadvantages. Three approaches for converting to string The three approaches for converting to string are: value.toString() "" + value String(value) The problem with approach #1 is that it doesn’t work if the value is null or undefined. That leaves us with approaches #2 and #3, which are basically equivalent. ""+value: The plus operator is fine for converting a value when it is surrounded by non-empty strings. As a way for converting a value to string, I find it less descriptive of one’s intentions. But that is a matter of taste, some people prefer this approach to String(value). String(value): This approach is nicely explicit: Apply the function String() to value. The only problem is that this function call will confuse some people, especially those coming from Java, because String is also a constructor. However, function and constructor produce completely different results: > String("abc") === new String("abc") false > typeof String("abc") 'string' > String("abc") instanceof String false > typeof new String("abc") 'object' > new String("abc") instanceof String true The function produces, as promised, a string (a primitive [1]). The constructor produces an instance of the type String (an object). The latter is hardly ever useful in JavaScript, which is why you can usually forget about String as a constructor and concentrate on its role as converting to string. A minor difference between ""+value and String(value) Until now you have heard that + and String() convert their “argument” to string. But how do they actually do that? It turns out that they do it in slightly different ways, but usually arrive at the same result. Converting primitives to string Both approaches use the internal ToString() operation to convert primitives to string. “Internal” means: a function specified by the ECMAScript 5.1 (§9.8) that isn’t accessible to the language itself. The following table explains how ToString() operates on primitives. Argument Result undefined "undefined" null "null" boolean value either "true" or "false" number value the number as a string, e.g. "1.765" string value no conversion necessary Converting objects to string Both approaches first convert an object to a primitive, before converting that primitive to string. However, + uses the internal ToNumber() operator (except for dates [2]), while String() uses ToString(). ToNumber(): To convert an object obj to a primitive, invoke obj.valueOf(). If the result is primitive, return that result. Otherwise, invoke obj.toString(). If the result is primitive, return that result. Otherwise, throw a TypeError. ToString(): Works the same, but invokes obj.toString() before obj.valueOf(). With the following object, you can observe the difference: var obj = { valueOf: function () { console.log("valueOf"); return {}; // not a primitive, keep going }, toString: function () { console.log("toString"); return {}; // not a primitive, keep going } }; Interaction: > "" + obj valueOf toString TypeError: Cannot convert object to primitive value > String(obj) toString valueOf TypeError: Cannot convert object to primitive value Most objects use the default implementation of valueOf() which returns this for objects. Hence, that method will always be skipped by ToNumber(). > var x = {} > x.valueOf() === x true Instances of Boolean, Number, and String wrap primitives and valueOf returns the wrapped primitive. But that still means that the final result will be the same as for toString(), even though it will have been produced in a different manner. > var n = new Number(756) > n.valueOf() === n false > n.valueOf() === 756 true Conclusion Which of the three approaches for converting to string should you choose? value.toString() can be OK, if you are sure that value will never be null or undefined. Otherwise, ""+value and String(value) are mostly equivalent. Which one people prefer is a matter of taste. I find String(value) more explicit. Related posts JavaScript values: not everything is an object [primitives versus objects] What is {} + {} in JavaScript? [explains how the + operator works] String concatenation in JavaScript [how to best concatenate many strings]
March 30, 2012
· 30,943 Views · 2 Likes
article thumbnail
Handling footnotes and references in HTML5
This post examines what options one has for handling footnotes and references in HTML. It then presents a library that helps you with handling them. Requirements Handling footnotes and references comes with several requirements: On screen, one wants to show the footnote text as close as possible to the number pointing to the footnote. Whatever solution one chooses, it should also work on touch devices. Hence, a hover-only approach is not feasible. In print, footnotes should be shown, as well. Hence, a tooltip-only solution is not acceptable. Lastly, things should degrade gracefully if JavaScript is switched off. The HTML5 spec recommendations for footnotes The HTML5 specification gives several tips on how to format footnotes. Short inline annotations: title attribute. Customer: Hello! I wish to register a complaint. Hello. Miss? Shopkeeper: Watcha mean, miss? Customer: Uh, I'm sorry, I have a cold. I wish to make a complaint. Shopkeeper: Sorry, we're closing for lunch. Longer annotations: bidirectional linking via : Announcer: Number 16: The hand. Interviewer: Good evening. I have with me in the studio tonight Mr Norman St John Polevaulter, who for the past few years has been contradicting people. Mr Polevaulter, why do you contradict people? Norman: I don't. [1] Interviewer: You told me you did! ... [1] This is, naturally, a lie, but paradoxically if it were true he could not say so without contradicting the interviewer and thus making it false. Wikipedia-style highlighting of the currently active footnote The CSS pseudo-selector :target allows you to style the HTML element whose ID is the same as the page fragment identifier: li:target { background-color: #BFEFFF; } Thus, if the page URL ends with #explanation then the following list item would be highlighted: It works like this: ... Using the html_footnotes library You can download html_footnotes on GitHub and try it out online. Terminology: An annotation is either a footnote or a reference (citation). The markers in the main text referring to those annotations are called annotation pointers. A footnote pointer is a number written in parentheses. Example: (1) A reference pointer is a number written in square brackets. Example: [1] Activating the library: The library consists of CSS to style annotations and pointers and of JavaScript that post-processes the HTML so that less code has to be written. Footnotes: The library processes the HTML so that footnote pointers are formatted as superscript and become links that, when clicked on, display the text of the footnote inline. You can use an IIFE(1) to avoid the global namespace(2) being polluted. ... Footnotes IIFE is an acronym for Immediately-Invoked Function Expression. The global scope is reified as an object in JavaScript. References: Reference pointers are processed and become links. The library also adds IDs to the reference list items. Due to the appropriate CSS, a list item will be highlighted and scrolled to if one clicks on a pointer. JavaScript has many functional language constructs [1]. For example: consult [2] for an introduction to closures. ... References Functional programming. In Wikipedia. Retrieved 2011-12-03. Douglas Crockford, JavaScript: The Good Parts. O’Reilly. 2008-05-16. Source: http://www.2ality.com/2011/12/footnotes.html
December 5, 2011
· 19,213 Views
article thumbnail
An introduction to JSDoc
JSDoc is the de facto standard for documenting JavaScript code. You need to know at least its syntax (which is also used by many other tools) if you publish code. Alas, documentation is still scarce, but this post can help – it shows you how to run JSDoc and how its syntax works. (The JSDoc wiki [2] is the main source of this post, some examples are borrowed from it.) As a tool, JSDoc takes JavaScript code with special /** */ comments and produces HTML documentation for it. For example: Given the following code. /** @namespace */ var util = { /** * Repeat str several times. * @param {string} str The string to repeat. * @param {number} [times=1] How many times to repeat the string. * @returns {string} */ repeat: function(str, times) { if (times === undefined || times < 1) { times = 1; } return new Array(times+1).join(str); } }; The generated HTML looks as follows in a web browser: This post begins with a quick start, so can try out JSDoc immediately if you are impatient. Afterwards, more background information is given. 1. Quick start For the steps described below, you need to have Java installed. JSDoc includes the shell script jsrun.sh that requires Unix (including OS X and Linux) to run. But it should be easy to translate that script to a Windows batch file. Download the latest jsdoc_toolkit. Unpack the archive into, say, $HOME/jsdoc-toolkit. Make the script $HOME/jsdoc-toolkit/jsrun.sh executable and tell it where to look for the JSDoc binary and the template (which controls what the result looks like). JSDOCDIR="$HOME/local/jsdoc-toolkit" JSDOCTEMPLATEDIR="$JSDOCDIR/templates/jsdoc" Now you can move the script anywhere you want to, e.g. a bin/ directory. For the purpose of this demonstration, we don’t move the script. Use jsrun.sh on a directory of JavaScript files: $HOME/jsdoc-toolkit/jsrun.sh -d=$HOME/doc $HOME/js Input: $HOME/js – a directory of JavaScript files (see below for an example). Output: $HOME/doc – where to write the generated files. If you put the JavaScript code at the beginning of this post into a file $HOME/js/util.js then JSDoc produces the following files: $HOME/doc +-- files.html +-- index.html +-- symbols +-- _global_.html +-- src ¦ +-- util.js.html +-- util.html 2. Introduction: What is JSDoc? It’s a common programming problem: You have written JavaScript code that is to be used by others and need a nice-looking HTML documentation of its API. Java has pioneered this domain via its JavaDoc tool. The quasi-standard in the JavaScript world is JSDoc. As seen above, you document an entity by putting before it a special comment that starts with two asterisks. Templates. In order to output anything, JSDoc always needs a template, a mix of JavaScript and specially marked-up HTML that tells it how to translate the parsed documentation to HTML. JSDoc comes with a built-in template, but there are others that you can download [3]. 2.1. Terminology and conventions of JSDoc Doclet: JSDoc calls its comments doclets which clashes with JavaDoc terminology where such comments are called doc comments and a doclet is similar to a JSDoc template, but written in Java. Variable: The term variable in JSDoc often refers to all documentable entities which include global variables, object properties, and inner members. Instance properties: In JavaScript one typically puts methods into a prototype to share them with all instances of a class, while fields (non-function-valued properties) are put into each instance. JSDoc conflates shared properties and per-instance properties and calls them instance properties. Class properties, static properties: are properties of classes, usually of constructor functions. For example, Object.create is a class property of Object. Inner members: An inner member is data nested inside a function. Most relevant for documentation is instance-private data nested inside a constructor function. function MyClass() { var privateCounter = 0; // an inner member this.inc = function() { // an instance property privateCounter++; }; } 2.2. Syntax Let’s review the comment shown at the beginning: /** * Repeat str several times. * @param {string} str The string to repeat. * @param {number} [times=1] How many times to repeat the string. * @returns {string} */ This demonstrates some of the JSDoc syntax which consists of the following pieces. JSDoc comment: is a JavaScript block comment whose first character is an asterisk. This creates the illusion that the token /** starts such a comment. Tags: Comments are structured by starting lines with tags, keywords that are prefixed with an @ symbol. @param is an example above. HTML: You can freely use HTML in JSDoc comments; for example, to display a word in a monospaced font. Type annotations: You can document the type of a value by putting the type name in braces after the appropriate tags. Variations: Single type: @param {string} name Multiple types: @param {string|number} idCode Arrays of a type: @param {string[]} names Name paths: are used to refer to variables inside JSDoc comments. The syntax of such paths is as follows. myFunction MyConstructor MyConstructor.classProperty MyConstructor#instanceProperty MyConstructor-innerMember 2.3. A word on types There are two kinds of values in JavaScript: primitives and objects [7]. Primitive types: boolean, number, string. The values undefined and null are also considered primitive. Object types: All other types are object types, including arrays and functions. Watch out: the names of primitive types start with a lowercase letter. Each primitive type has a corresponding wrapper type, an object type with a capital name whose instances are objects: The wrapper type of boolean is Boolean. The wrapper type of number is Number. The wrapper type of string is String. Getting the name of the type of a value: Primitive value p: via typeof p. > typeof "" 'string' Compare: an instance of the wrapper type is an object. > typeof new String() 'object' Object value o: via o.constructor.name. Example: > new String().constructor.name 'String' 3. Basic tags Meta-data: @fileOverview: marks a JSDoc comment that describes the whole file. @author: Who has written the variable being documented? @deprecated: indicates that the variable is not supported, any more. It is a good practice to document what to use instead. @example: contains a code example, illustrating how the given entity should be used. /** * @example * var str = "abc"; * console.log(repeat(str, 3)); // abcabcabc */ Linking: @see: points to a related resource. /** * @see MyClass#myInstanceMethod * @see The Example Project. */ {@link ...}: works like @see, but can be used inside other tags. @requires resourceDescription: a resource that the documented entity needs. The resource description is either a name path or a natural language description. Versioning: @version versionNumber: indicates the version of the documented entity. Example: @version 10.3.1 @since versionNumber: indicates since which version the documented entity has been available. Example: @since 10.2.0 4. Documenting functions and methods For functions and methods, one can document parameters, return values, and exceptions they might throw. @param {paramType} paramName description: describes the parameter whose name is paramName. Type and description are optional. Examples: @param str @param str The string to repeat. @param {string} str @param {string} str The string to repeat. Advanced features: Optional parameter: @param {number} [times] The number of times is optional. Optional parameter with default value: @param {number} [times=1] The number of times is optional. @returns {returnType} description: describes the return value of the function or method. Either type or description can be omitted. @throws {exceptionType} description: describes an exception that might be thrown during the execution of the function or method. Either type or description can be omitted. 4.1. Inline type information (“inline doc comments”) There are two ways of providing type information for parameters and return values. First, you can add a type annotation to @param and @returns. /** * @param {String} name * @returns {Object} */ function getPerson(name) { } Second, you can inline the type information: function getPerson(/**String*/ name) /**Object*/ { } 5. Documenting variables and fields Fields are properties with non-function values. Because instance fields are often created inside a constructor, you have to document them there. @type {typeName}: What type does the documented variable have? Example: /** @constructor */ function Car(make, owner) { /** @type {string} */ this.make = make; /** @type {Person} */ this.owner = owner; } @type {Person} This tag can also be used to document the return type of functions, but @returns is preferable in this case. @constant: A flag that indicates that the documented variable has a constant value. @default defaultValue: What is the default value of a variable? Example: /** @constructor */ function Page(title) { /** * @default "Untitled" */ this.title = title || "Untitled"; } @property {propType} propName description: Document an instance property in the class comment. Example: /** * @class * @property {string} name The name of the person. */ function Person(name) { this.name = name; } Without this tag, instance properties are documented as follows. /** * @class */ function Person(name) { /** * The name of the person. * @type {string} */ this.name = name; } Which one of those styles to use is a matter of taste. @property does introduce redundancies, though. 6. Documenting classes JavaScript’s built-in means for defining classes are weak, which is why there are many APIs that help with this task [5]. These APIs differ, often radically, so you have to help JSDoc with figuring out what is going on. There are three basic ways of defining a class: Constructor function: You must mark a constructor function, otherwise it will not be documented as a class. That is, capitalization alone does not mark a function as a constructor. /** * @constructor */ function Person(name) { } @class is a synonym for @constructor, but it also allows you to describe the class – as opposed to the function setting up an instance (see tag documentation below for an example). API call and object literal: You need two markers. First, you need to tell JSDoc that a given variable holds a class. Second, you need to mark an object literal as defining a class. The latter is done via the @lends tag. /** @class */ var Person = makeClass( /** @lends Person# */ { say: function(message) { return "This person says: " + message; } } ); API call and object literal with a constructor method: If one of the methods in an object literal performs the task of a constructor (setting up instance data, [8]), you need to mark it as such so that fields are found by JSDoc. Then the documentation of the class moves to that method. var Person = makeClass( /** @lends Person# */ { /** * A class for managing persons. * @constructs */ initialize: function(name) { this.name = name; }, say: function(message) { return this.name + " says: " + message; } } ); Tags: @constructor: marks a function as a constructor. @class: marks a variable as a class or a function as a constructor. Can be used in a constructor comment to separate the description of the constructor (first line below) from the description of the class (second line below). /** * Creates a new instance of class Person. * @class Represents a person. */ Person = function() { } @constructs: marks a method in an object literal as taking up the duties of a constructor. That is, setting up instance data. In such a case, the class must be documented there. Works in tandem with @lends. @lends namePath: specifies to which class the following object literal contributes. There are two ways of contributing. @lends Person# – the object literal contributes instance properties to Person. @lends Person – the object literal contributes class properties to Person. 6.1. Inheritance, namespacing JavaScript has no simple support for subclassing and no real namespaces [6]. You thus have to help JSDoc see what is going on when you are using work-arounds. @extends namePath: indicates that the documented class is the subclass of another one. Example: /** * @constructor * @extends Person */ function Programmer(name) { Person.call(this, name); ... } // Remaining code for subclassing omitted @augments: a synonym for @extends. @namespace: One can use objects to simulate namespaces in JavaScript. This tag marks such objects. Example: /** @namespace */ var util = { ... }; 7. Meta-tags Meta-tags are tags that are added to several variables. You put them in a comment that starts with “/**#@+”. They are then added to all variables until JSDoc encounters the closing comment “/**#@-*/”. Example: /**#@+ * @private * @memberOf Foo */ function baz() {} function zop() {} function pez() {} /**#@-*/ 8. Rarely used tags @ignore: ignore a variable. Note that variables without /** comments are ignored, anyway. @borrows otherNamePath as this.propName: A variable is just a reference to somewhere else; it is documented there. Example: /** * @constructor * @borrows Remote#transfer as this.send */ function SpecialWriter() { this.send = Remote.prototype.transfer; } @description text: Provide a description, the same as all of the text before the first tag. Manual categorization. Sometimes JSDoc misinterprets what a variable is. Then you can help it via one of the following tags: Tag Mark variable as @function function @field non-function value @public public (especially inner variables) @private private @inner inner and thus also private @static accessible without instantiation Name and membership: @name namePath: override the parsed name and use the given name, instead. @memberOf parentNamePath: the documented variable is a member of the specified object. Not explained here: @event, see [2]. 9. Related reading jsdoc-toolkit - A documentation generator for JavaScript: JSDoc homepage on Google Code. Includes a link to the downloads. JSDoc wiki: the official documentation of JSDoc and source of this post. JSDoc wiki – TemplateGallery: lists available JSDoc templates. JSDoc wiki – TagReference: a handy cheat-sheet for JSDoc tags. Lightweight JavaScript inheritance APIs Modules and namespaces in JavaScript JavaScript values: not everything is an object Prototypes as classes – an introduction to JavaScript inheritance From http://www.2ality.com/2011/08/jsdoc-intro.html
August 18, 2011
· 69,916 Views · 2 Likes
article thumbnail
A brief history of ECMAScript versions (including Harmony/ES.next)
Two questions: What is the difference between JavaScript and ECMAScript? What is the difference between ECMAScript Harmony and ECMAScript.next? Both are almost trick questions, because in each case, the two terms mean basically the same. This post explains the details. Glossary: ECMAScript: Sun (now Oracle) had a trademark on the name “JavaScript” (which led to Microsoft calling its JavaScript dialect “JScript”). Thus, when it came to standardizing the language, a different name had to be used. Instead, “ECMAScript” was chosen, because the corresponding standard is hosted by Ecma International (see below). In practice, the terms “ECMAScript” and “JavaScript” are interchangeable. If JavaScript means “ECMAScript as implemented by Mozilla and others” then the the former is a dialect of the latter. The term “ECMAScript” is also frequently used to denote language versions (such as ECMAScript 5). ECMA-262: The Ecma International (a standards organization) has created the ECMA-262 standard which is the official specification of the ECMAScript language. ECMAScript 5: If one talks about ECMAScript 5, one means the 5th edition of ECMA-262, the current edition of this standard. Ecma’s Technical Committee 39 (TC39): is the group of people (Brendan Eich and others) who develop the ECMA-262 standard. History: ECMAScript 3 (December 1999). This is the version of ECMAScript that most browsers support today. It introduced many features that have become an inherent part of the language: [...] regular expressions, better string handling, new control statements, try/catch exception handling, tighter definition of errors, formatting for numeric output and other enhancements. [1] ECMAScript 4 (abandoned July 2008). ECMAScript 4 was developed as the next version of JavaScript, with a prototype written in ML. However, TC39 could not agree on its feature set. To prevent an impasse, the committee met at the end of July 2008 and came to an accord, summarized in four points [2]: Develop an incremental update of ECMAScript [which became ECMAScript 5]. Develop a major new release, which was to be more modest than ECMAScript 4, but much larger in scope than the version after ECMAScript 3. This version has been code-named Harmony, due to the nature of the meeting in which it was conceived. Features from ECMAScript 4 that would be dropped: packages, namespaces, early binding. Other ideas were to be developed in consensus with all of TC39. Thus: The ECMAScript 4 developers agreed to make Harmony less radical than ECMAScript 4, the rest of TC39 agreed to keep moving things forward. ECMAScript 5 (December 2009). This version brings several enhancements to the standard library and even updated language semantics via a strict mode. [3] ECMAScript.next (planned for 2013). It quickly became apparent that the plans for Harmony were too ambitious, so its features were split into two groups: Group one are features that are considered for the next version after ECMAScript 5. This version has the code name ECMAScript.next and will probably become ECMAScript 6. Group two are Harmony features that are not considered ready or high-priority enough for ECMAScript.next. The current goal is to have ECMAScript.next finished by 2013, with parts of it making it into web browsers (especially Firefox) before then. Summary: ECMAScript is the “standard name” of the JavaScript language. ECMAScript.next is the version after ECMAScript 5. ECMAScript Harmony is a superset of ECMAScript.next that additionally includes features to be considered after ECMAScript.next. Sources and related reading: ECMAScript - Wikipedia, the free encyclopedia ECMAScript Harmony [archived email] What’s new in ECMAScript 5 JavaScript: how it all began Posts on ECMAScript.next From http://www.2ality.com/2011/06/ecmascript.html
June 28, 2011
· 10,341 Views
article thumbnail
Modules and namespaces in JavaScript
JavaScript does not come with support for modules. This blog post examines patterns and APIs that provide such support. It is split into the following parts: Patterns for structuring modules. APIs for loading modules asynchronously. Related reading, background and sources. 1. Patterns for structuring modules A module fulfills two purposes: First, it holds content, by mapping identifiers to values. Second, it provides a namespace for those identifiers, to prevent them from clashing with identifiers in other modules. In JavaScript, modules are implemented via objects. Namespacing: A top-level module is put into a global variable. That variable is the namespace of the module content. Holding content: Each property of the module holds a value. Nesting modules: One achieves nesting by putting a module inside another one. Filling a module with content Approach 1: Object literal. var namespace = { func: function() { ... }, value: 123 }; Approach 2: Assigning to properties. var namespace = {}; namespace.func = function() { ... }; namespace.value = 123; Accessing the content in either approach: namespace.func(); console.log(namespace.value + 44); Assessment: Object literal. Pro: Elegant syntax. Con: As a single, sometimes very long syntactic construct, it imposes constraints on its contents. One must maintain the opening brace before the content and the closing brace after the content. And one must remember to not add a comma after the last property value. This makes it harder to move content around. Assigning to properties. Con: Redundant repetitions of the namespace identifier. The Module pattern: private data and initialization In the module pattern, one uses an Immediately-Invoked Function Expression (IIFE, [1]) to attach an environment to the module data. The bindings inside that environment can be accessed from the module, but not from outside. Another advantage is that the IIFE gives you a place to perform initializations. var namespace = function() { // set up private data var arr = []; // not visible outside for(var i=0; i<4; i++) { arr.push(i); } return { // read-only access via getter get values() { return arr; } }; }(); console.log(namespace.values); // [0,1,2,3] Comments: Con: Harder to read and harder to figure out what is going on. Con: Harder to patch. Every now and then, you can reuse existing code by patching it just a little. Yes, this breaks encapsulation, but it can also be very useful for temporary solutions. The module pattern makes such patching impossible (which may be a feature, depending on your taste). Alternative for private data: use a naming convention for private properties, e.g. all properties whose names start with an underscore are private. Variation: Namespace is a function parameter. var namespace = {}; (function(ns) { // (set up private data here) ns.func = function() { ... }; ns.value = 123; }(namespace)); Variation: this as the namespace identifier (cannot accidentally be assigned to). var namespace = {}; (function() { // (set up private data here) this.func = function() { ... }; this.value = 123; }).call(namespace); // hand in implicit parameter "this" Referring to sibling properties Use this. Con: hidden if you nest functions (which includes methods in nested objects). var namespace = { _value: 123; // private via naming convention getValue: function() { return this._value; } anObject: { aMethod: function() { // "this" does not point to the module here } } } Global access. Cons: makes it harder to rename the namespace, verbose for nested namespaces. var namespace = { _value: 123; // private via naming convention getValue: function() { return namespace._value; } } Custom identifier: The module pattern (see above) enables one to use a custom local identifier to refer to the current module. Module pattern with object literal: assign the object to a local variable before returning it. Module pattern with parameter: the parameter is the custom identifier. Private data and initialization for properties An IFEE can be used to attach private data and initialization code to an object. It can do the same for a single property. var ns = { getValue: function() { var arr = []; // not visible outside for(var i=0; i<4; i++) { arr.push(i); } return function() { // actual property value return arr; }; }() }; Read on for an application of this pattern. Types in object literals Problem: A JavaScript type is defined in two steps. First, define the constructor. Second, set up the prototype of the constructor. These two steps cannot be performed in object literals. There are two solutions: Use an inheritance API where constructor and prototype can be defined simultaneously [4]. Wrap the two parts of the type in an IIFE: var ns = { Type: function() { var constructor = function() { // ... }; constructor.prototype = { // ... }; return constructor; // value of Type }() }; Managing namespaces Use the same namespace in several files: You can spread out a module definition across several files. Each file contributes features to the module. If you create the namespace variable as follows then the order in which the files are loaded does not matter. Note that this pattern does not work with object literals. var namespace = namespace || {}; Nested namespaces: With multiple modules, one can avoid a proliferation of global names by creating a single global namespace and adding sub-modules to it. Further nesting is not advisable, because it adds complexity and is slower. You can use longer names if name clashes are an issue. var topns = topns || {}; topns.module1 = { // content } topns.module2 = { // content } YUI2 uses the following pattern to create nested namespaces. YAHOO.namespace("foo.bar"); YAHOO.foo.bar.doSomething = function() { ... }; 2. APIs for loading modules asynchronously Avoiding blocking: The content of a web page is processed sequentially. When a script tag is encountered that refers to a file, two steps happen: The file is downloaded. The file is interpreted. All browsers block the processing of subsequent content until (2) is finished, because everything is single-threaded and must be processed in order. Newer browsers perform some downloads in parallel, but rendering is still blocked [2]. This unnecessarily delays the initial display of a page. Modern module APIs provide a way around this by supporting asynchronous loading of modules. There are usually two parts to using such APIs: First one specifies what modules one would like to use. Second, one provides a callback that is invoked once all modules are ready. The goal of this section is not to be a comprehensive introduction, but rather to give you an overview of what is possible in the design space of JavaScript modules. 2.1. RequireJS RequireJS has been created as a standard for modules that work both on servers and in browsers. The RequireJS website explains the relationship between RequireJS and the earlier CommonJS standard for server-side modules [3]: CommonJS defines a module format. Unfortunately, it was defined without giving browsers equal footing to other JavaScript environments. Because of that, there are CommonJS spec proposals for Transport formats and an asynchronous require. RequireJS tries to keep with the spirit of CommonJS, with using string names to refer to dependencies, and to avoid modules defining global objects, but still allow coding a module format that works well natively in the browser. RequireJS implements the Asynchronous Module Definition (formerly Transport/C) proposal. If you have modules that are in the traditional CommonJS module format, then you can easily convert them to work with RequireJS. RequireJS projects have the following file structure: project-directory/ project.html legacy.js scripts/ main.js require.js helper/ util.js project.html: My Sample Project main.js: helper/util is resolved relative to data-main. legacy.js ends with .js and is assumed to not be in module format. The consequences are that its path is resolved relative to project.html and that there isn’t a function parameter to access its (module) contents. require(["helper/util", "legacy.js"], function(util) { //This function is called when scripts/helper/util.js is loaded. require.ready(function() { //This function is called when the page is loaded //(the DOMContentLoaded event) and when all required //scripts are loaded. }); }); Other features of RequireJS: Specify and use internationalization data. Load text files (e.g. to be used for HTML templating) Use JSONP service results for initial application setup. 2.2. YUI3 Version 3 of the YUI JavaScript framework brings its own module infrastructure. YUI3 modules are loaded asynchronously. The general pattern for using them is as follows. YUI().use('dd', 'anim', function(Y) { // Y.DD is available // Y.Anim is available }); Steps: Provide IDs “dd” and “anim” of the modules you want to load. Provide a callback to be invoked once all modules have been loaded. The parameter Y of the callback is the YUI namespace. This namespace contains the sub-namespaces DD and Anim for the modules. As you can see, the ID of a module and its namespace are usually different. Method YUI.add() allows you to register your own modules. YUI.add('mymodules-mod1', function(Y) { Y.namespace('mynamespace'); Y.mynamespace.Mod1 = function() { // expose an API }; }, '0.1.1' // module version ); YUI includes a loader for retrieving modules from external files. It is configured via a parameter to the API. The following example loads two modules: The built-in YUI module dd and the external module yui_flot that is available online. YUI({ modules: { yui2_yde_datasource: { // not used below fullpath: 'http://yui.yahooapis.com/datasource-min.js' }, yui_flot: { fullpath: 'http://bluesmoon.github.com/yui-flot/yui.flot.js' } } }).use('dd', 'yui_flot', function(Y) { // do stuff }); 2.3. Script loaders Similarly to RequireJS, script loaders are replacements for script tags that allow one to load JavaScript code asynchronously and in parallel. But they are usually simpler than RequireJS. Examples: LABjs: a relatively simple script loader. Use it instead of RequireJS if you need to load scripts in a precise order and you don't need to manage module dependencies. Background: “LABjs & RequireJS: Loading JavaScript Resources the Fun Way” describes the differences between LABjs and RequireJS. yepnope: A fast script loader that allows you to make the loading of some scripts contingent on the capabilities of the web browser. 3. Related reading, background and sources Related reading: A first look at the upcoming JavaScript modules Background: JavaScript variable scoping and its pitfalls Loading Scripts Without Blocking CommonJS Modules Lightweight JavaScript inheritance APIs Main sources of this post: Namespacing in JavaScript YUI2: A JavaScript Module Pattern YUI3: YUI Global Object How to get started with RequireJS From http://www.2ality.com/2011/04/modules-and-namespaces-in-javascript.html
April 29, 2011
· 17,702 Views
article thumbnail
Enable (vertical) side tabs in Google Chrome [Windows, Mac]
Tabs for web pages in browsers are usually arranged horizontally, on top of the browser window. This arrangement has two disadvantages: First, with many tabs, it becomes impossible to read their titles. Second, horizontal tabs take up valuable vertical space on widescreen displays. The obvious solution is to arrange them vertically. Firefox has several ways to do this. It is one of three features I still miss from Chrome. But there now is a way to turn on a beta version of this feature in Chrome. This post explains how. Horizontal tabs: Vertical space is wasted, tab titles become hard to read. Vertical tabs: Better use of horizontal space on widescreen displays, titles readable even with many tabs. You can tell that its a beta feature, because everything still looks a bit ugly. First step: Windows: Type “about:flags” into the address bar. Enable “Side Tabs”. Restart Chrome [details]. Mac Open Chrome from Terminal like this: /Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome -enable-vertical-tabs If you want to make this more permanent: Rename the binary mentioned above (e.g. to “Google Chrome Binary”) and put a shell script that invokes it in its place [details]: #!/bin/bash exec "${0%/*}/Google Chrome Binary" -enable-vertical-tabs "$@"Second step: Toggle vertical bars via the context menu that opens on a tab. Second step: Toggle vertical bars via the context menu that opens on a tab.
March 18, 2011
· 14,524 Views · 2 Likes

Comments

Reload a web browser when a file changes (Node.js, Grunt, Safari/Mac)

Aug 24, 2012 · Tony Thomas

Updated: now also works with Chrome/Mac (previously: only Safari/Mac)
Whitepapers on .NET Framework 3.5

Dec 06, 2011 · Tony Thomas

I like the idea, it would help us make progress much more quickly. Note, though, that CouchDB’s replication and browser-to-server sync needs are probably much different.

“Maybe something that can gives us push notifications in a flexible way?” –would that really make sense as part of a database API?

SQLPython is a SQL command-line client

Nov 08, 2011 · Rich LaMarche

Wish: Some kind of (tl;dr-style) executive summary.
Firefox Extension to Track Favorite Code Snippets

Oct 20, 2011 · Eric Redmond

Work-around: Use a shim to get ECMAScript 5 features on older browsers:

www.2ality.com/2011/02/es5-shim-use-ecmascript-5-in-older.html

Firefox Extension to Track Favorite Code Snippets

Oct 20, 2011 · Eric Redmond

Work-around: Use a shim to get ECMAScript 5 features on older browsers:

www.2ality.com/2011/02/es5-shim-use-ecmascript-5-in-older.html

Firefox Extension to Track Favorite Code Snippets

Oct 20, 2011 · Eric Redmond

Work-around: Use a shim to get ECMAScript 5 features on older browsers:

www.2ality.com/2011/02/es5-shim-use-ecmascript-5-in-older.html

Firefox Extension to Track Favorite Code Snippets

Oct 20, 2011 · Eric Redmond

Work-around: Use a shim to get ECMAScript 5 features on older browsers:

www.2ality.com/2011/02/es5-shim-use-ecmascript-5-in-older.html

Transparent Flex apps with HTML showing through

Oct 20, 2011 · Gerd Storm

@Jörg Buchberger: As a Java (and GWT!) replacement, Dart would make a lot of sense. With good tools, I would prefer it to Java. And it would help Google with their Java-related legal troubles.
Transparent Flex apps with HTML showing through

Oct 20, 2011 · Gerd Storm

@Jörg Buchberger: As a Java (and GWT!) replacement, Dart would make a lot of sense. With good tools, I would prefer it to Java. And it would help Google with their Java-related legal troubles.
Transparent Flex apps with HTML showing through

Oct 20, 2011 · Gerd Storm

@Jörg Buchberger: As a Java (and GWT!) replacement, Dart would make a lot of sense. With good tools, I would prefer it to Java. And it would help Google with their Java-related legal troubles.
Transparent Flex apps with HTML showing through

Oct 20, 2011 · Gerd Storm

@Fabrizio Giudici: Excellent point! That was the main thing I missed from the presentation: Google properly arguing their case. It is obvious that JavaScript has currently shortcomings in these areas. But ECMAScript 6 is coming along nicely!

JavaScript really may not be Dart’s target any more...

Transparent Flex apps with HTML showing through

Oct 20, 2011 · Gerd Storm

@Fabrizio Giudici: Excellent point! That was the main thing I missed from the presentation: Google properly arguing their case. It is obvious that JavaScript has currently shortcomings in these areas. But ECMAScript 6 is coming along nicely!

JavaScript really may not be Dart’s target any more...

Transparent Flex apps with HTML showing through

Oct 20, 2011 · Gerd Storm

@Fabrizio Giudici: Excellent point! That was the main thing I missed from the presentation: Google properly arguing their case. It is obvious that JavaScript has currently shortcomings in these areas. But ECMAScript 6 is coming along nicely!

JavaScript really may not be Dart’s target any more...

Google’s Alex Russell on JavaScript versus Dart

Sep 14, 2011 · Axel Rauschmayer

True. Apart from that: Give JavaScript a chance. It’s much better than its reputation, you just need a little time to get to know it. Additionally, the upcoming ECMAScript 6 will remove many quirks.
Go Ajax, Young Man

Jul 15, 2011 · David Salter

Great comment. I’ve quoted it above.
Go Ajax, Young Man

Jul 15, 2011 · David Salter

Great comment. I’ve quoted it above.
Go Ajax, Young Man

Jul 15, 2011 · David Salter

Great comment. I’ve quoted it above.
Go Ajax, Young Man

Jul 15, 2011 · David Salter

In my experience, the problem of premature optimization transcends age. Avoiding it is usually a sign of wisdom (which can increase with age, but doesn’t have to).
Go Ajax, Young Man

Jul 15, 2011 · David Salter

In my experience, the problem of premature optimization transcends age. Avoiding it is usually a sign of wisdom (which can increase with age, but doesn’t have to).
Go Ajax, Young Man

Jul 15, 2011 · David Salter

In my experience, the problem of premature optimization transcends age. Avoiding it is usually a sign of wisdom (which can increase with age, but doesn’t have to).
Go Ajax, Young Man

Jul 15, 2011 · David Salter

In my experience, the problem of premature optimization transcends age. Avoiding it is usually a sign of wisdom (which can increase with age, but doesn’t have to).
Go Ajax, Young Man

Jul 14, 2011 · David Salter

Good point. I added a sentence that clarifies that experience contributes to better seeing the big picture.
Go Ajax, Young Man

Jul 14, 2011 · David Salter

Good point. I added a sentence that clarifies that experience contributes to better seeing the big picture.
Go Ajax, Young Man

Jul 14, 2011 · David Salter

Good point. I added a sentence that clarifies that experience contributes to better seeing the big picture.
C# Threads using anonymous methods

Jun 27, 2011 · Andrea Ingaglio

True. Google does have a lot of nice ideas: I like the ability to push URLs and map locations from a desktop computer to an Android device); Google Docs are cool; etc. But Apple’s story seems more focused and coherent. We’ll have to wait and see until iCloud is an actual product (as in “available for public consumption”).
C# Threads using anonymous methods

Jun 27, 2011 · Andrea Ingaglio

True. Google does have a lot of nice ideas: I like the ability to push URLs and map locations from a desktop computer to an Android device); Google Docs are cool; etc. But Apple’s story seems more focused and coherent. We’ll have to wait and see until iCloud is an actual product (as in “available for public consumption”).
ECMAScript.next: the “TXJS” update by Eich

Jun 18, 2011 · Axel Rauschmayer

My experience: I have suggested improvements like this a few times and each time there was some complicated (but unfortunately justified) reason for why the more beautiful syntax would not work. That is: these guys think about things a lot, before they write a proposal. In don’t think the asterisk is too bad.
jQuery 1.2.1: Quick Fixes for 1.2

Jun 16, 2011 · Gerd Storm

I edited the text a bit for clarity. The information I have on Windows 8 is that indeed new (complete) *apps* will be written in JavaScript. Additional APIs are rumored but not yet confirmed (to my knowledge). If you have other information, I’d love to know about it!

The CLR is indeed nice technology and C# has many language features that have no match in JavaScript. But JavaScript (ECMAScript.next is shaping up to be awesome) and HTML5 are evolving very quickly. We’ll see what happens. I think Microsoft’s new focus on the web is clever, because neither Apple (which relies on Cocoa apps) nor Google (it is doubtful that Chrome OS will ever become very popular) can match this step. It’s the first time after many years that I’m excited about MS technology again.

jQuery 1.2.1: Quick Fixes for 1.2

Jun 16, 2011 · Gerd Storm

I edited the text a bit for clarity. The information I have on Windows 8 is that indeed new (complete) *apps* will be written in JavaScript. Additional APIs are rumored but not yet confirmed (to my knowledge). If you have other information, I’d love to know about it!

The CLR is indeed nice technology and C# has many language features that have no match in JavaScript. But JavaScript (ECMAScript.next is shaping up to be awesome) and HTML5 are evolving very quickly. We’ll see what happens. I think Microsoft’s new focus on the web is clever, because neither Apple (which relies on Cocoa apps) nor Google (it is doubtful that Chrome OS will ever become very popular) can match this step. It’s the first time after many years that I’m excited about MS technology again.

jQuery 1.2.1: Quick Fixes for 1.2

Jun 16, 2011 · Gerd Storm

I edited the text a bit for clarity. The information I have on Windows 8 is that indeed new (complete) *apps* will be written in JavaScript. Additional APIs are rumored but not yet confirmed (to my knowledge). If you have other information, I’d love to know about it!

The CLR is indeed nice technology and C# has many language features that have no match in JavaScript. But JavaScript (ECMAScript.next is shaping up to be awesome) and HTML5 are evolving very quickly. We’ll see what happens. I think Microsoft’s new focus on the web is clever, because neither Apple (which relies on Cocoa apps) nor Google (it is doubtful that Chrome OS will ever become very popular) can match this step. It’s the first time after many years that I’m excited about MS technology again.

jQuery 1.2.1: Quick Fixes for 1.2

Jun 16, 2011 · Gerd Storm

True. Fixed.
jQuery 1.2.1: Quick Fixes for 1.2

Jun 16, 2011 · Gerd Storm

True. Fixed.
OSX Unsuitable for Web Development

Apr 16, 2011 · Derrick

I’ve always stuck to a single package management on Mac OS and been *very* happy with it (and yes, I am also occasionally using Linux and like it). And let's not forget about all the different Linux distros and package managers. Both Mac OS and Linux have pros and cons. I’ve always considered Mac hardware quality to be one of the pros. Especially for notebooks, I value the increased reliability. And if you compare prices with Sony or high-end Samsung, Apple is sometimes even cheaper. What you want is cheap hardware and package management that is exactly like Linux's. What made you think that you could ever like Macs?
The Lost Generation

Apr 05, 2011 · Mr B Loid

Good points. I'm glad to hear that the Android team is so supportive of developers. Given that Google currently uses its app store to exert control over the platform, we'll have to see how things develop. But if Amazon can help grow Android, Google does indeed stand to profit, too.
Apple iPad 2 VS Samsung Galaxy Tab – A Detailed Comparison

Mar 19, 2011 · Kazim Hassan

All there is is a table comparing the specs. I expected an actual comparison based on experiences with the devices.
Why Linux Is Better Than Windows OS

Mar 18, 2011 · Arnold Barney

To elaborate: This should be much more carefully argued. Linux simply isn’t universally better, it has lots of quirks of its own (every operating system has). A much better article would be: when is Linux better than Windows and how exactly? The article could just as well have been pro-Mac.
Why Linux Is Better Than Windows OS

Mar 18, 2011 · Arnold Barney

Flamebait.
Google Web Toolkit 1.4 Release Candidate 2

Mar 03, 2011 · Mr B Loid

True. While I’m its author, I didn’t put the article here, but I will try to get this fixed.
Google Web Toolkit 1.4 Release Candidate 2

Mar 03, 2011 · Mr B Loid

True. While I’m its author, I didn’t put the article here, but I will try to get this fixed.
Google Web Toolkit 1.4 Release Candidate 2

Mar 03, 2011 · Mr B Loid

True. While I’m its author, I didn’t put the article here, but I will try to get this fixed.
Google Web Toolkit 1.4 Release Candidate 2

Mar 03, 2011 · Mr B Loid

True. While I’m its author, I didn’t put the article here, but I will try to get this fixed.
PHP Abstract Podcast Episode 15: The Zend Access Control List

Feb 15, 2011 · Stefan Koopmanschap

I agree, but other factors come into play, too.

  • Google’s openness has many aspects to it: Not all of Android is open (not all Android phones have all of Google’s apps or the Android Market), you still have to root (=jail-break) your device if you want to tinker with it freely, the freedom to change the OS is used by many carriers to add their bloatware. In case I sound like an Android hater: I’m not! I like the environment and think that Honeycomb will be a fine tablet OS.
  • What I have seen of WP7 actually looks quite promising, they are making good decisions (especially usability-wise), but have a lot of catching up to do.
  • Apple’s control is not all bad for developers.
PHP Abstract Podcast Episode 15: The Zend Access Control List

Feb 15, 2011 · Stefan Koopmanschap

I agree, but other factors come into play, too.

  • Google’s openness has many aspects to it: Not all of Android is open (not all Android phones have all of Google’s apps or the Android Market), you still have to root (=jail-break) your device if you want to tinker with it freely, the freedom to change the OS is used by many carriers to add their bloatware. In case I sound like an Android hater: I’m not! I like the environment and think that Honeycomb will be a fine tablet OS.
  • What I have seen of WP7 actually looks quite promising, they are making good decisions (especially usability-wise), but have a lot of catching up to do.
  • Apple’s control is not all bad for developers.
PHP Abstract Podcast Episode 15: The Zend Access Control List

Feb 15, 2011 · Stefan Koopmanschap

I agree, but other factors come into play, too.

  • Google’s openness has many aspects to it: Not all of Android is open (not all Android phones have all of Google’s apps or the Android Market), you still have to root (=jail-break) your device if you want to tinker with it freely, the freedom to change the OS is used by many carriers to add their bloatware. In case I sound like an Android hater: I’m not! I like the environment and think that Honeycomb will be a fine tablet OS.
  • What I have seen of WP7 actually looks quite promising, they are making good decisions (especially usability-wise), but have a lot of catching up to do.
  • Apple’s control is not all bad for developers.
PHP Abstract Podcast Episode 15: The Zend Access Control List

Feb 15, 2011 · Stefan Koopmanschap

I agree, but other factors come into play, too.

  • Google’s openness has many aspects to it: Not all of Android is open (not all Android phones have all of Google’s apps or the Android Market), you still have to root (=jail-break) your device if you want to tinker with it freely, the freedom to change the OS is used by many carriers to add their bloatware. In case I sound like an Android hater: I’m not! I like the environment and think that Honeycomb will be a fine tablet OS.
  • What I have seen of WP7 actually looks quite promising, they are making good decisions (especially usability-wise), but have a lot of catching up to do.
  • Apple’s control is not all bad for developers.
How easy maintenance will improve performance

Feb 15, 2011 · Tony Thomas

Yes, if you invent your own class system and compile JS to JS, you might as well compile Java to JS (and have better tools to boot). With JS Harmony, things will change, because JS will become a very compelling language.
How easy maintenance will improve performance

Feb 15, 2011 · Tony Thomas

Yes, if you invent your own class system and compile JS to JS, you might as well compile Java to JS (and have better tools to boot). With JS Harmony, things will change, because JS will become a very compelling language.
How easy maintenance will improve performance

Feb 15, 2011 · Tony Thomas

Yes, if you invent your own class system and compile JS to JS, you might as well compile Java to JS (and have better tools to boot). With JS Harmony, things will change, because JS will become a very compelling language.
How easy maintenance will improve performance

Feb 15, 2011 · Tony Thomas

Yes, if you invent your own class system and compile JS to JS, you might as well compile Java to JS (and have better tools to boot). With JS Harmony, things will change, because JS will become a very compelling language.
How easy maintenance will improve performance

Feb 15, 2011 · Tony Thomas

Yes, if you invent your own class system and compile JS to JS, you might as well compile Java to JS (and have better tools to boot). With JS Harmony, things will change, because JS will become a very compelling language.
How easy maintenance will improve performance

Feb 15, 2011 · Tony Thomas

Yes, if you invent your own class system and compile JS to JS, you might as well compile Java to JS (and have better tools to boot). With JS Harmony, things will change, because JS will become a very compelling language.
How easy maintenance will improve performance

Feb 15, 2011 · Tony Thomas

Yes, if you invent your own class system and compile JS to JS, you might as well compile Java to JS (and have better tools to boot). With JS Harmony, things will change, because JS will become a very compelling language.
How easy maintenance will improve performance

Feb 15, 2011 · Tony Thomas

Yes, if you invent your own class system and compile JS to JS, you might as well compile Java to JS (and have better tools to boot). With JS Harmony, things will change, because JS will become a very compelling language.
How easy maintenance will improve performance

Feb 15, 2011 · Tony Thomas

Yes, if you invent your own class system and compile JS to JS, you might as well compile Java to JS (and have better tools to boot). With JS Harmony, things will change, because JS will become a very compelling language.
How easy maintenance will improve performance

Feb 15, 2011 · Tony Thomas

Yes, if you invent your own class system and compile JS to JS, you might as well compile Java to JS (and have better tools to boot). With JS Harmony, things will change, because JS will become a very compelling language.
How easy maintenance will improve performance

Feb 15, 2011 · Tony Thomas

Yes, if you invent your own class system and compile JS to JS, you might as well compile Java to JS (and have better tools to boot). With JS Harmony, things will change, because JS will become a very compelling language.
How easy maintenance will improve performance

Feb 15, 2011 · Tony Thomas

Yes, if you invent your own class system and compile JS to JS, you might as well compile Java to JS (and have better tools to boot). With JS Harmony, things will change, because JS will become a very compelling language.
How easy maintenance will improve performance

Feb 15, 2011 · Tony Thomas

Yes, if you invent your own class system and compile JS to JS, you might as well compile Java to JS (and have better tools to boot). With JS Harmony, things will change, because JS will become a very compelling language.
How easy maintenance will improve performance

Feb 15, 2011 · Tony Thomas

Yes, if you invent your own class system and compile JS to JS, you might as well compile Java to JS (and have better tools to boot). With JS Harmony, things will change, because JS will become a very compelling language.
PHP Abstract Podcast Episode 15: The Zend Access Control List

Feb 15, 2011 · Stefan Koopmanschap

Qt plus something would have been nice.

To stand out on Android, you have to be really smart. An example of a company making smart moves is Amazon. Their app store is "yet another one", but they are putting a lot of effort into UI, curation, and billing. As a result, it is a worthy addition to the Android ecosystem.

If Nokia gets paid a lot of money and is able to collaborate closely with MS, then that might make the deal interesting enough (for Nokia). I agree with you on Nokia’s selling point, but in collaboration with MS, Nokia might actually produce a phone that is unique among all WP7 phones. Something that would be harder to do on Android.

PHP Abstract Podcast Episode 15: The Zend Access Control List

Feb 15, 2011 · Stefan Koopmanschap

Qt plus something would have been nice.

To stand out on Android, you have to be really smart. An example of a company making smart moves is Amazon. Their app store is "yet another one", but they are putting a lot of effort into UI, curation, and billing. As a result, it is a worthy addition to the Android ecosystem.

If Nokia gets paid a lot of money and is able to collaborate closely with MS, then that might make the deal interesting enough (for Nokia). I agree with you on Nokia’s selling point, but in collaboration with MS, Nokia might actually produce a phone that is unique among all WP7 phones. Something that would be harder to do on Android.

PHP Abstract Podcast Episode 15: The Zend Access Control List

Feb 15, 2011 · Stefan Koopmanschap

Qt plus something would have been nice.

To stand out on Android, you have to be really smart. An example of a company making smart moves is Amazon. Their app store is "yet another one", but they are putting a lot of effort into UI, curation, and billing. As a result, it is a worthy addition to the Android ecosystem.

If Nokia gets paid a lot of money and is able to collaborate closely with MS, then that might make the deal interesting enough (for Nokia). I agree with you on Nokia’s selling point, but in collaboration with MS, Nokia might actually produce a phone that is unique among all WP7 phones. Something that would be harder to do on Android.

How easy maintenance will improve performance

Feb 14, 2011 · Tony Thomas

Yes and no. Prototypal inheritance, if done well, can be very elegant [1] and feel more object-oriented than class-based inheritance. If you don’t do inheritance, object-orientation works well in "pure" JavaScript, otherwise you need to use one of the APIs.

[1] http://www.2ality.com/2010/12/javascripts-prototypal-inheritance.html

How easy maintenance will improve performance

Feb 14, 2011 · Tony Thomas

Yes and no. Prototypal inheritance, if done well, can be very elegant [1] and feel more object-oriented than class-based inheritance. If you don’t do inheritance, object-orientation works well in "pure" JavaScript, otherwise you need to use one of the APIs.

[1] http://www.2ality.com/2010/12/javascripts-prototypal-inheritance.html

How easy maintenance will improve performance

Feb 14, 2011 · Tony Thomas

Yes and no. Prototypal inheritance, if done well, can be very elegant [1] and feel more object-oriented than class-based inheritance. If you don’t do inheritance, object-orientation works well in "pure" JavaScript, otherwise you need to use one of the APIs.

[1] http://www.2ality.com/2010/12/javascripts-prototypal-inheritance.html

How easy maintenance will improve performance

Feb 14, 2011 · Tony Thomas

Yes and no. Prototypal inheritance, if done well, can be very elegant [1] and feel more object-oriented than class-based inheritance. If you don’t do inheritance, object-orientation works well in "pure" JavaScript, otherwise you need to use one of the APIs.

[1] http://www.2ality.com/2010/12/javascripts-prototypal-inheritance.html

How easy maintenance will improve performance

Feb 14, 2011 · Tony Thomas

  • Java definitely also has a lot of momentum. JVM languages are a prime example. You can also call it "excitement" instead of "momentum" if you want to. In the user-facing part of applications, JavaScript currently has a more compelling story (with web browsers) and I think that leads to a lot of mind share.
  • JS on the server does not have to be untyped if Harmony really brings type guards. The killer feature of node.js is its asynchronicity where current JavaScript practices are a surprisingly elegant fit for the server.
So GUI-wise and server-wise, JS currently is avant-garde, similar to Ruby on Rails a few years ago. Just like with RoR, I’m sure other platforms will adopt some of the JS innovations.
How easy maintenance will improve performance

Feb 14, 2011 · Tony Thomas

  • Java definitely also has a lot of momentum. JVM languages are a prime example. You can also call it "excitement" instead of "momentum" if you want to. In the user-facing part of applications, JavaScript currently has a more compelling story (with web browsers) and I think that leads to a lot of mind share.
  • JS on the server does not have to be untyped if Harmony really brings type guards. The killer feature of node.js is its asynchronicity where current JavaScript practices are a surprisingly elegant fit for the server.
So GUI-wise and server-wise, JS currently is avant-garde, similar to Ruby on Rails a few years ago. Just like with RoR, I’m sure other platforms will adopt some of the JS innovations.
How easy maintenance will improve performance

Feb 14, 2011 · Tony Thomas

  • Java definitely also has a lot of momentum. JVM languages are a prime example. You can also call it "excitement" instead of "momentum" if you want to. In the user-facing part of applications, JavaScript currently has a more compelling story (with web browsers) and I think that leads to a lot of mind share.
  • JS on the server does not have to be untyped if Harmony really brings type guards. The killer feature of node.js is its asynchronicity where current JavaScript practices are a surprisingly elegant fit for the server.
So GUI-wise and server-wise, JS currently is avant-garde, similar to Ruby on Rails a few years ago. Just like with RoR, I’m sure other platforms will adopt some of the JS innovations.
How easy maintenance will improve performance

Feb 14, 2011 · Tony Thomas

  • Java definitely also has a lot of momentum. JVM languages are a prime example. You can also call it "excitement" instead of "momentum" if you want to. In the user-facing part of applications, JavaScript currently has a more compelling story (with web browsers) and I think that leads to a lot of mind share.
  • JS on the server does not have to be untyped if Harmony really brings type guards. The killer feature of node.js is its asynchronicity where current JavaScript practices are a surprisingly elegant fit for the server.
So GUI-wise and server-wise, JS currently is avant-garde, similar to Ruby on Rails a few years ago. Just like with RoR, I’m sure other platforms will adopt some of the JS innovations.
How easy maintenance will improve performance

Feb 14, 2011 · Tony Thomas

  • Java definitely also has a lot of momentum. JVM languages are a prime example. You can also call it "excitement" instead of "momentum" if you want to. In the user-facing part of applications, JavaScript currently has a more compelling story (with web browsers) and I think that leads to a lot of mind share.
  • JS on the server does not have to be untyped if Harmony really brings type guards. The killer feature of node.js is its asynchronicity where current JavaScript practices are a surprisingly elegant fit for the server.
So GUI-wise and server-wise, JS currently is avant-garde, similar to Ruby on Rails a few years ago. Just like with RoR, I’m sure other platforms will adopt some of the JS innovations.
How easy maintenance will improve performance

Feb 14, 2011 · Tony Thomas

  • Java definitely also has a lot of momentum. JVM languages are a prime example. You can also call it "excitement" instead of "momentum" if you want to. In the user-facing part of applications, JavaScript currently has a more compelling story (with web browsers) and I think that leads to a lot of mind share.
  • JS on the server does not have to be untyped if Harmony really brings type guards. The killer feature of node.js is its asynchronicity where current JavaScript practices are a surprisingly elegant fit for the server.
So GUI-wise and server-wise, JS currently is avant-garde, similar to Ruby on Rails a few years ago. Just like with RoR, I’m sure other platforms will adopt some of the JS innovations.
How easy maintenance will improve performance

Feb 14, 2011 · Tony Thomas

  • Java definitely also has a lot of momentum. JVM languages are a prime example. You can also call it "excitement" instead of "momentum" if you want to. In the user-facing part of applications, JavaScript currently has a more compelling story (with web browsers) and I think that leads to a lot of mind share.
  • JS on the server does not have to be untyped if Harmony really brings type guards. The killer feature of node.js is its asynchronicity where current JavaScript practices are a surprisingly elegant fit for the server.
So GUI-wise and server-wise, JS currently is avant-garde, similar to Ruby on Rails a few years ago. Just like with RoR, I’m sure other platforms will adopt some of the JS innovations.
How easy maintenance will improve performance

Feb 14, 2011 · Tony Thomas

  • Java definitely also has a lot of momentum. JVM languages are a prime example. You can also call it "excitement" instead of "momentum" if you want to. In the user-facing part of applications, JavaScript currently has a more compelling story (with web browsers) and I think that leads to a lot of mind share.
  • JS on the server does not have to be untyped if Harmony really brings type guards. The killer feature of node.js is its asynchronicity where current JavaScript practices are a surprisingly elegant fit for the server.
So GUI-wise and server-wise, JS currently is avant-garde, similar to Ruby on Rails a few years ago. Just like with RoR, I’m sure other platforms will adopt some of the JS innovations.
How easy maintenance will improve performance

Feb 14, 2011 · Tony Thomas

  • Java definitely also has a lot of momentum. JVM languages are a prime example. You can also call it "excitement" instead of "momentum" if you want to. In the user-facing part of applications, JavaScript currently has a more compelling story (with web browsers) and I think that leads to a lot of mind share.
  • JS on the server does not have to be untyped if Harmony really brings type guards. The killer feature of node.js is its asynchronicity where current JavaScript practices are a surprisingly elegant fit for the server.
So GUI-wise and server-wise, JS currently is avant-garde, similar to Ruby on Rails a few years ago. Just like with RoR, I’m sure other platforms will adopt some of the JS innovations.
How easy maintenance will improve performance

Feb 14, 2011 · Tony Thomas

  • Java definitely also has a lot of momentum. JVM languages are a prime example. You can also call it "excitement" instead of "momentum" if you want to. In the user-facing part of applications, JavaScript currently has a more compelling story (with web browsers) and I think that leads to a lot of mind share.
  • JS on the server does not have to be untyped if Harmony really brings type guards. The killer feature of node.js is its asynchronicity where current JavaScript practices are a surprisingly elegant fit for the server.
So GUI-wise and server-wise, JS currently is avant-garde, similar to Ruby on Rails a few years ago. Just like with RoR, I’m sure other platforms will adopt some of the JS innovations.
How easy maintenance will improve performance

Feb 14, 2011 · Tony Thomas

  • Java definitely also has a lot of momentum. JVM languages are a prime example. You can also call it "excitement" instead of "momentum" if you want to. In the user-facing part of applications, JavaScript currently has a more compelling story (with web browsers) and I think that leads to a lot of mind share.
  • JS on the server does not have to be untyped if Harmony really brings type guards. The killer feature of node.js is its asynchronicity where current JavaScript practices are a surprisingly elegant fit for the server.
So GUI-wise and server-wise, JS currently is avant-garde, similar to Ruby on Rails a few years ago. Just like with RoR, I’m sure other platforms will adopt some of the JS innovations.
How easy maintenance will improve performance

Feb 14, 2011 · Tony Thomas

  • Java definitely also has a lot of momentum. JVM languages are a prime example. You can also call it "excitement" instead of "momentum" if you want to. In the user-facing part of applications, JavaScript currently has a more compelling story (with web browsers) and I think that leads to a lot of mind share.
  • JS on the server does not have to be untyped if Harmony really brings type guards. The killer feature of node.js is its asynchronicity where current JavaScript practices are a surprisingly elegant fit for the server.
So GUI-wise and server-wise, JS currently is avant-garde, similar to Ruby on Rails a few years ago. Just like with RoR, I’m sure other platforms will adopt some of the JS innovations.
How easy maintenance will improve performance

Feb 14, 2011 · Tony Thomas

  • Java definitely also has a lot of momentum. JVM languages are a prime example. You can also call it "excitement" instead of "momentum" if you want to. In the user-facing part of applications, JavaScript currently has a more compelling story (with web browsers) and I think that leads to a lot of mind share.
  • JS on the server does not have to be untyped if Harmony really brings type guards. The killer feature of node.js is its asynchronicity where current JavaScript practices are a surprisingly elegant fit for the server.
So GUI-wise and server-wise, JS currently is avant-garde, similar to Ruby on Rails a few years ago. Just like with RoR, I’m sure other platforms will adopt some of the JS innovations.
PHP Abstract Podcast Episode 15: The Zend Access Control List

Feb 14, 2011 · Stefan Koopmanschap

@Jacek: I don’t understand why Nokia could not do more with MeeGo and Qt. Were the teams underfunded? Incompetent? Did something else get in the way?
How easy maintenance will improve performance

Feb 14, 2011 · Tony Thomas

Good point. I’m a big fan of GWT’s. And you are right, its tool support makes a huge difference. Also, it does clever things with compiled CSS, images, etc.

Points in JavaScript’s favor:

  • The language has a lot of momentum and enthusiasm behind it. Just as Oracle kills some of Java’s momentum. (Note that I’m not an Oracle hater, Sun has made its own share of mistakes and Oracle does bring stability to the platform.)
  • JS Harmony is going to be one heck of a language. Optional type guards plus dynamism will enable some great development environments.
  • Node.js is shaping up to be a great server environment. This increases the appeal of going all-JS on both client and server.
Sireh Dan Cengkeh Webzine

Feb 10, 2011 · syed syahrul

A whole-heartedly agree. It is about encoding versus decoding [1]: While you have to type one more character as an encoder, you make things easier for decoders, because humans are used to punctuation. I hope strict mode will eventually make semicolons mandatory, but would not bet on it.

[1] http://www.2ality.com/2011/01/coffeescript-versus-javascript-without.html

Comparing colliding mice in C++, Java, Ruby and C#

Feb 01, 2011 · Gerd Storm

Yeah, mine, too. I guess that makes Brooks a super-hero.
Comparing colliding mice in C++, Java, Ruby and C#

Feb 01, 2011 · Gerd Storm

Yeah, mine, too. I guess that makes Brooks a super-hero.
Comparing colliding mice in C++, Java, Ruby and C#

Feb 01, 2011 · Gerd Storm

Yeah, mine, too. I guess that makes Brooks a super-hero.
Programming a SAX-RSS Parser In 30 Minutes Flat

Feb 01, 2011 · Benjamin Coe

Amen to that. Sun dropped the ball regarding the web. Desktop Java is also much less than it could be.
Programming a SAX-RSS Parser In 30 Minutes Flat

Feb 01, 2011 · Benjamin Coe

Amen to that. Sun dropped the ball regarding the web. Desktop Java is also much less than it could be.
Programming a SAX-RSS Parser In 30 Minutes Flat

Feb 01, 2011 · Benjamin Coe

Amen to that. Sun dropped the ball regarding the web. Desktop Java is also much less than it could be.
Programming a SAX-RSS Parser In 30 Minutes Flat

Feb 01, 2011 · Benjamin Coe

Amen to that. Sun dropped the ball regarding the web. Desktop Java is also much less than it could be.
Adding Ajax support to ProMesh.NET - the hunt for JSON

Jan 29, 2011 · Philippe Leybaert

There is also a frontend side to it: applications that synchronize their data with the cloud. I find that it does introduce a new aspect to applications and makes them much more useful (especially mobile applications).
Tomcat with HTTPS SSL

Jan 23, 2011 · Mark Bakker

Note that this index ranks popularity as in market demand. This is not the same as ranking the beauty of a language. If it was a beauty contest then, for example, Python would (IMHO) not be behind C++.
Tomcat with HTTPS SSL

Jan 22, 2011 · Mark Bakker

I love Python! But I expected "popular" languages such as Ruby and JavaScript to grow more, so apparently it has found its "niche" (not the right word, considering how highly ranked it is). I just wish Python had as good an IDE as Eclipse, which is the main reason that I still use Java so much.
Tomcat with HTTPS SSL

Jan 22, 2011 · Mark Bakker

I love Python! But I expected "popular" languages such as Ruby and JavaScript to grow more, so apparently it has found its "niche" (not the right word, considering how highly ranked it is). I just wish Python had as good an IDE as Eclipse, which is the main reason that I still use Java so much.
Tomcat with HTTPS SSL

Jan 22, 2011 · Mark Bakker

I love Python! But I expected "popular" languages such as Ruby and JavaScript to grow more, so apparently it has found its "niche" (not the right word, considering how highly ranked it is). I just wish Python had as good an IDE as Eclipse, which is the main reason that I still use Java so much.
Tomcat with HTTPS SSL

Jan 22, 2011 · Mark Bakker

I love Python! But I expected "popular" languages such as Ruby and JavaScript to grow more, so apparently it has found its "niche" (not the right word, considering how highly ranked it is). I just wish Python had as good an IDE as Eclipse, which is the main reason that I still use Java so much.
Switching to WPF and Silverlight

Dec 15, 2010 · Tony Thomas

@Igor Laera: Note that JavaScript is just as “banned” and crash-protected as Flash in Chrome. But I agree that Flash seems to be on its way out. I’ve posted ideas about a JVM browser a while ago.
Switching to WPF and Silverlight

Dec 15, 2010 · Tony Thomas

@Igor Laera: Note that JavaScript is just as “banned” and crash-protected as Flash in Chrome. But I agree that Flash seems to be on its way out. I’ve posted ideas about a JVM browser a while ago.
Switching to WPF and Silverlight

Dec 15, 2010 · Tony Thomas

@Igor Laera: Note that JavaScript is just as “banned” and crash-protected as Flash in Chrome. But I agree that Flash seems to be on its way out. I’ve posted ideas about a JVM browser a while ago.
Switching to WPF and Silverlight

Dec 14, 2010 · Tony Thomas

@Ivan Lazarte: Amen to all of the above. Local storage will probably be replaced by IndexedDB, long-term (especially because MS is on board). JavaScript as a language is actually surprisingly cool. It is minimalist and succinct in a way that all necessary features could be added easily (optional typing comes to mind which is important for large systems and APIs). That is much more tricky with Java which is weighed down by a lot of legacy baggage (anonymous inner classes, primitive types, etc.). Java is saved by superior tools which also makes GWT a great choice for web programming. JavaScript tools will get better (I’ll try WebStorm soon) and one could also compile JavaScript to JavaScript (as Google’s Closure does). I wonder if, long term, we couldn’t have a core JavaScript that everything else (even more sophisticated JavaScript) is compiled to. I don’t think we could get browser vendors to agree on a common byte code format or something similar, but this could serve the same purpose. It's a bit of a shame because all the JavaScript engines are starting to look more like the JVM by the day.
Switching to WPF and Silverlight

Dec 14, 2010 · Tony Thomas

@Ivan Lazarte: Amen to all of the above. Local storage will probably be replaced by IndexedDB, long-term (especially because MS is on board). JavaScript as a language is actually surprisingly cool. It is minimalist and succinct in a way that all necessary features could be added easily (optional typing comes to mind which is important for large systems and APIs). That is much more tricky with Java which is weighed down by a lot of legacy baggage (anonymous inner classes, primitive types, etc.). Java is saved by superior tools which also makes GWT a great choice for web programming. JavaScript tools will get better (I’ll try WebStorm soon) and one could also compile JavaScript to JavaScript (as Google’s Closure does). I wonder if, long term, we couldn’t have a core JavaScript that everything else (even more sophisticated JavaScript) is compiled to. I don’t think we could get browser vendors to agree on a common byte code format or something similar, but this could serve the same purpose. It's a bit of a shame because all the JavaScript engines are starting to look more like the JVM by the day.
Switching to WPF and Silverlight

Dec 14, 2010 · Tony Thomas

@Ivan Lazarte: Amen to all of the above. Local storage will probably be replaced by IndexedDB, long-term (especially because MS is on board). JavaScript as a language is actually surprisingly cool. It is minimalist and succinct in a way that all necessary features could be added easily (optional typing comes to mind which is important for large systems and APIs). That is much more tricky with Java which is weighed down by a lot of legacy baggage (anonymous inner classes, primitive types, etc.). Java is saved by superior tools which also makes GWT a great choice for web programming. JavaScript tools will get better (I’ll try WebStorm soon) and one could also compile JavaScript to JavaScript (as Google’s Closure does). I wonder if, long term, we couldn’t have a core JavaScript that everything else (even more sophisticated JavaScript) is compiled to. I don’t think we could get browser vendors to agree on a common byte code format or something similar, but this could serve the same purpose. It's a bit of a shame because all the JavaScript engines are starting to look more like the JVM by the day.
Switching to WPF and Silverlight

Dec 14, 2010 · Tony Thomas

@Ivan Lazarte: Amen to all of the above. Local storage will probably be replaced by IndexedDB, long-term (especially because MS is on board). JavaScript as a language is actually surprisingly cool. It is minimalist and succinct in a way that all necessary features could be added easily (optional typing comes to mind which is important for large systems and APIs). That is much more tricky with Java which is weighed down by a lot of legacy baggage (anonymous inner classes, primitive types, etc.). Java is saved by superior tools which also makes GWT a great choice for web programming. JavaScript tools will get better (I’ll try WebStorm soon) and one could also compile JavaScript to JavaScript (as Google’s Closure does). I wonder if, long term, we couldn’t have a core JavaScript that everything else (even more sophisticated JavaScript) is compiled to. I don’t think we could get browser vendors to agree on a common byte code format or something similar, but this could serve the same purpose. It's a bit of a shame because all the JavaScript engines are starting to look more like the JVM by the day.
Database Programming - Fixing MySQL Replication

Dec 07, 2010 · quad helper

No, it's purely for client-side applications. Think poor man’s mail merge.
Database Programming - Fixing MySQL Replication

Dec 07, 2010 · quad helper

No, it's purely for client-side applications. Think poor man’s mail merge.
How Agile Development Can Lead to Better Results and Technology-Business Alignment

Dec 04, 2010 · Gene Gotimer

Hi James! My list of favorite iPad apps is here: 2ality.blogspot.com/2010/10/recommended-ipad-apps-basics.html
Cocoa: Initializing managed objects with data from the GUI

Oct 25, 2010 · Mr B Loid

Oh, amen to that! But its features go much more in depth, here I wanted to list some of the new features that help on a more superficial level. These are just some of the ingredients for creating fluid interfaces.
Cocoa: Initializing managed objects with data from the GUI

Oct 25, 2010 · Mr B Loid

Oh, amen to that! But its features go much more in depth, here I wanted to list some of the new features that help on a more superficial level. These are just some of the ingredients for creating fluid interfaces.
Cocoa: Initializing managed objects with data from the GUI

Oct 25, 2010 · Mr B Loid

Oh, amen to that! But its features go much more in depth, here I wanted to list some of the new features that help on a more superficial level. These are just some of the ingredients for creating fluid interfaces.
Cocoa: Initializing managed objects with data from the GUI

Oct 20, 2010 · Mr B Loid

@Jonas: Fixed, thanks.
Cocoa: Initializing managed objects with data from the GUI

Oct 20, 2010 · Mr B Loid

@Jonas: Fixed, thanks.
Cocoa: Initializing managed objects with data from the GUI

Oct 20, 2010 · Mr B Loid

@Jonas: Fixed, thanks.
Applying UML and Patterns: They can't all be winners

Oct 13, 2010 · Tony Thomas

@Fabrizio: Apart from worries about efficiency, why keep primitive types? They are a source of many idiosyncracies in Java. Languages such as Common Lisp and Dylan have figured out how to treat everything as an object without sacrificing efficiency, why can’t Java?

Bracha has more to say on this: “Original Sin”.

Applying UML and Patterns: They can't all be winners

Oct 13, 2010 · Tony Thomas

@Fabrizio: Apart from worries about efficiency, why keep primitive types? They are a source of many idiosyncracies in Java. Languages such as Common Lisp and Dylan have figured out how to treat everything as an object without sacrificing efficiency, why can’t Java?

Bracha has more to say on this: “Original Sin”.

Applying UML and Patterns: They can't all be winners

Oct 13, 2010 · Tony Thomas

@Fabrizio: Apart from worries about efficiency, why keep primitive types? They are a source of many idiosyncracies in Java. Languages such as Common Lisp and Dylan have figured out how to treat everything as an object without sacrificing efficiency, why can’t Java?

Bracha has more to say on this: “Original Sin”.

Applying UML and Patterns: They can't all be winners

Oct 13, 2010 · Tony Thomas

@Fabrizio: Apart from worries about efficiency, why keep primitive types? They are a source of many idiosyncracies in Java. Languages such as Common Lisp and Dylan have figured out how to treat everything as an object without sacrificing efficiency, why can’t Java?

Bracha has more to say on this: “Original Sin”.

Linking between Apps within Symfony

Aug 07, 2010 · Stefan Koopmanschap

Check out the addendum to my post (clarifying some of what I’ve written, in response to the comments).
Move Over Eclipse. NetBeans 6 Rocks!

Jul 12, 2010 · Mr B Loid

Just putting (e.g. .html) files into the directory $TOMCAT/webapps/ROOT might also work. It did for me.
Move Over Eclipse. NetBeans 6 Rocks!

Jul 12, 2010 · Mr B Loid

Just putting (e.g. .html) files into the directory $TOMCAT/webapps/ROOT might also work. It did for me.
Move Over Eclipse. NetBeans 6 Rocks!

Jul 12, 2010 · Mr B Loid

Just putting (e.g. .html) files into the directory $TOMCAT/webapps/ROOT might also work. It did for me.
Move Over Eclipse. NetBeans 6 Rocks!

Jul 12, 2010 · Mr B Loid

Just putting (e.g. .html) files into the directory $TOMCAT/webapps/ROOT might also work. It did for me.
Move Over Eclipse. NetBeans 6 Rocks!

Jul 12, 2010 · Mr B Loid

Just putting (e.g. .html) files into the directory $TOMCAT/webapps/ROOT might also work. It did for me.
Move Over Eclipse. NetBeans 6 Rocks!

Jul 12, 2010 · Mr B Loid

Just putting (e.g. .html) files into the directory $TOMCAT/webapps/ROOT might also work. It did for me.
Move Over Eclipse. NetBeans 6 Rocks!

Jul 12, 2010 · Mr B Loid

Just putting (e.g. .html) files into the directory $TOMCAT/webapps/ROOT might also work. It did for me.
Move Over Eclipse. NetBeans 6 Rocks!

Jul 12, 2010 · Mr B Loid

Just putting (e.g. .html) files into the directory $TOMCAT/webapps/ROOT might also work. It did for me.
Move Over Eclipse. NetBeans 6 Rocks!

Jul 12, 2010 · Mr B Loid

Just putting (e.g. .html) files into the directory $TOMCAT/webapps/ROOT might also work. It did for me.
Move Over Eclipse. NetBeans 6 Rocks!

Jul 12, 2010 · Mr B Loid

Just putting (e.g. .html) files into the directory $TOMCAT/webapps/ROOT might also work. It did for me.
Move Over Eclipse. NetBeans 6 Rocks!

Jul 12, 2010 · Mr B Loid

Just putting (e.g. .html) files into the directory $TOMCAT/webapps/ROOT might also work. It did for me.
Move Over Eclipse. NetBeans 6 Rocks!

Jul 12, 2010 · Mr B Loid

Just putting (e.g. .html) files into the directory $TOMCAT/webapps/ROOT might also work. It did for me.
Move Over Eclipse. NetBeans 6 Rocks!

Jul 12, 2010 · Mr B Loid

Just putting (e.g. .html) files into the directory $TOMCAT/webapps/ROOT might also work. It did for me.
Move Over Eclipse. NetBeans 6 Rocks!

Jul 12, 2010 · Mr B Loid

Just putting (e.g. .html) files into the directory $TOMCAT/webapps/ROOT might also work. It did for me.
JavaFX: First Steps - Correcting a Swing Mistake

May 04, 2010 · Mr B Loid

I agree. One could even put the (unpacked) contents of the WAR inside the JAR. I just don't know of any servlet container that is able to serve a WAR without unpacking it.
JavaFX: First Steps - Correcting a Swing Mistake

May 04, 2010 · Mr B Loid

I agree. One could even put the (unpacked) contents of the WAR inside the JAR. I just don't know of any servlet container that is able to serve a WAR without unpacking it.
JavaFX: First Steps - Correcting a Swing Mistake

May 04, 2010 · Mr B Loid

I agree. One could even put the (unpacked) contents of the WAR inside the JAR. I just don't know of any servlet container that is able to serve a WAR without unpacking it.
JavaFX: First Steps - Correcting a Swing Mistake

May 04, 2010 · Mr B Loid

I agree. One could even put the (unpacked) contents of the WAR inside the JAR. I just don't know of any servlet container that is able to serve a WAR without unpacking it.
JavaFX: First Steps - Correcting a Swing Mistake

May 04, 2010 · Mr B Loid

I find that having an external database is always a bit of a nuisance (when it comes to ease of installation). So I would always go for an embedded one. Then the problem is: Where do you put your files? This has been discussed here, with great ideas in the comments.
JavaFX: First Steps - Correcting a Swing Mistake

May 04, 2010 · Mr B Loid

I find that having an external database is always a bit of a nuisance (when it comes to ease of installation). So I would always go for an embedded one. Then the problem is: Where do you put your files? This has been discussed here, with great ideas in the comments.
JavaFX: First Steps - Correcting a Swing Mistake

May 04, 2010 · Mr B Loid

I find that having an external database is always a bit of a nuisance (when it comes to ease of installation). So I would always go for an embedded one. Then the problem is: Where do you put your files? This has been discussed here, with great ideas in the comments.
Testing Your Web Design For Free

Apr 06, 2010 · Jesse Eickholt

  • Maven: I don't currently use Maven, so I can't really comment. But controlling anything under the hood is indeed complicated. For example, I've only looked for it briefly, but haven't found a way to configure the Jetty that GWT uses (with the previously used Tomcat, it was more obvious).
  • Intrusiveness: I hear you. I maintain an Eclipse version and a GWT version of the same application and that is a bit ugly. Annotations for ignoring code would really help here. Once you go 100% GWT, though, having explicit packages for "client", "server", and "shared" makes it much easier to understand what's going on.
Testing Your Web Design For Free

Apr 06, 2010 · Jesse Eickholt

  • Maven: I don't currently use Maven, so I can't really comment. But controlling anything under the hood is indeed complicated. For example, I've only looked for it briefly, but haven't found a way to configure the Jetty that GWT uses (with the previously used Tomcat, it was more obvious).
  • Intrusiveness: I hear you. I maintain an Eclipse version and a GWT version of the same application and that is a bit ugly. Annotations for ignoring code would really help here. Once you go 100% GWT, though, having explicit packages for "client", "server", and "shared" makes it much easier to understand what's going on.
Testing Your Web Design For Free

Apr 05, 2010 · Jesse Eickholt

Thanks. Fixed it.
Testing Your Web Design For Free

Apr 05, 2010 · Jesse Eickholt

Thanks. Fixed it.
Testing Your Web Design For Free

Apr 05, 2010 · Jesse Eickholt

Thanks. Fixed it.
Testing Your Web Design For Free

Apr 05, 2010 · Jesse Eickholt

Thanks. Fixed it.
Aptana backs RDT, hires me

Mar 15, 2010 · Daniel Spiewak

"What about not-exploded applications (not opening the war file)? You solution forces your user to use exploded wars."

The WAR of "app" can be unexploded, i.e., I do not require it to be exploded. Conversely, app.dir/ is a pseudo web application called "app.dir" which is exploded. But that should only be a problem if the servlet container only supports non-exploded webapps. What I'm really looking for is a servlet container giving my web application a directory where it can store its data.

I do like the homedirectory-relative approach (where mine could be considered webapp-directory-relative) and using JNDI.

Aptana backs RDT, hires me

Mar 15, 2010 · Daniel Spiewak

"What about not-exploded applications (not opening the war file)? You solution forces your user to use exploded wars."

The WAR of "app" can be unexploded, i.e., I do not require it to be exploded. Conversely, app.dir/ is a pseudo web application called "app.dir" which is exploded. But that should only be a problem if the servlet container only supports non-exploded webapps. What I'm really looking for is a servlet container giving my web application a directory where it can store its data.

I do like the homedirectory-relative approach (where mine could be considered webapp-directory-relative) and using JNDI.

Integrating .NET Code and SQL Server Reporting Services

Nov 28, 2009 · Vladimir Carrer

I agree with people saying that Java is already too complicated. There are things one could do to simplify it (remove primitive types, reify generics, streamline the standard library, etc.), but maybe it is not realistic to perform these simplifications, nor even necessary to do so, as another JVM-based language will cater to people with more difficult tastes. BTW: Languages that I know and like from a perspective of conceptual clarity often have a small group or even a single person dictating their taste. And the languages benefits from it.

IMHO, Java is still doing well, productivity-wise. I used to prefer Python to Java, but then Eclipse (refactoring, code browsing, etc.) came along, which made it hard for me to use any programming language that had less capable tools.

Integrating .NET Code and SQL Server Reporting Services

Nov 28, 2009 · Vladimir Carrer

I've not chosen the above mentioned constructs for their academic beauty (even though it is there ;-), but depending on what work-arounds caused me the most pain in Java. Here are concrete examples:
  • Closures: The closure proposals for Java (especially FCM) have several examples that I find quite convincing. In one of my projects, there are several methods that always begin with the same statements and end with the same statements. I let those invoke a method that consolidates those statements in one place and invokes a Runnable argument “in the middle”. This would be much cleaner with a closure. Even with object-oriented programs, some things cannot be put into a single class. In these cases, I want top-level functions. Closures are a logical extension of top-level functions. Are anonymous inner classes ever used for anything else than handing over behavior? I think true functions are easy to understand for beginners and closures probably could replace anonymous inner classes completely. This would also allow us to stop using static methods to as pseudo-functions.
  • Modules: are very useful in collaborative settings where you need to control and simplify how people build on shared code. I think, with Eclipse and OSGi, no one argues against this point.
  • Generators: help with implementing iterators (writing an iterator for a tree is complicated; I've tried). Also, any algorithm that produces a stream profits. For example, a tokenizer for a text stream can be implemented as a loop.
  • Mix-ins: If you have a set of tool methods that you would like to see in several classes, you can only do so, if those classes don't already use inheritance. I think interfaces have proven their usefulness; giving methods default implementations seems like a simple extension to me.
  • Post-hoc interfaces: For example, you create a new interface App for appending objects to some kind of stream you have implemented. Making StringBuilder an implementor of App makes it work with all utility methods you write for that interface. Post-hoc interfaces are mainly useful for library developers to make more classes work with their code.
Integrating .NET Code and SQL Server Reporting Services

Nov 28, 2009 · Vladimir Carrer

@Greg Brown: You are misreading the tone of my article: I'm not criticizing Java, in fact I'm still most productive in that language (due to its tools and the vast amount of libraries available). I'm just curious what language features are out there and if they lead to increased productivity.
Integrating .NET Code and SQL Server Reporting Services

Nov 28, 2009 · Vladimir Carrer

@Greg Brown: You are misreading the tone of my article: I'm not criticizing Java, in fact I'm still most productive in that language (due to its tools and the vast amount of libraries available). I'm just curious what language features are out there and if they lead to increased productivity.
Integrating .NET Code and SQL Server Reporting Services

Nov 28, 2009 · Vladimir Carrer

@Greg Brown: You are misreading the tone of my article: I'm not criticizing Java, in fact I'm still most productive in that language (due to its tools and the vast amount of libraries available). I'm just curious what language features are out there and if they lead to increased productivity.
Quick CSS Mockups with Photoshop

Jul 22, 2009 · Mr B Loid

@Charlie Hubbard: I like the idea of having different modes depending on whether you want to encode a page or an application. I don't think that CSS is all bad (I've rather grown to like it with jQuery), so maybe just telling CSS about the current mode would be enough.
Quick CSS Mockups with Photoshop

Jul 22, 2009 · Mr B Loid

@Charlie Hubbard: I like the idea of having different modes depending on whether you want to encode a page or an application. I don't think that CSS is all bad (I've rather grown to like it with jQuery), so maybe just telling CSS about the current mode would be enough.
Quick CSS Mockups with Photoshop

Jul 22, 2009 · Mr B Loid

@Charlie Hubbard: I like the idea of having different modes depending on whether you want to encode a page or an application. I don't think that CSS is all bad (I've rather grown to like it with jQuery), so maybe just telling CSS about the current mode would be enough.
Quick CSS Mockups with Photoshop

Jul 21, 2009 · Mr B Loid

@Jacek: You are making my point: With Java, I'm really happy with the available options (JGoodies, MigLayout), with Ajax, I want to have something that is similar to the more advanced Java layout managers. IMHO, template layout comes close (enough).
Quick CSS Mockups with Photoshop

Jul 21, 2009 · Mr B Loid

@Jacek: You are making my point: With Java, I'm really happy with the available options (JGoodies, MigLayout), with Ajax, I want to have something that is similar to the more advanced Java layout managers. IMHO, template layout comes close (enough).
Mono Applications Get Integrated with Microsoft Moonlight

Jul 17, 2009 · Nasty Microsoft

Addendum: If I already can't bear reading this stuff and I'm a Java-lover and not particularly fond of MS, how can anyone?
Mono Applications Get Integrated with Microsoft Moonlight

Jul 17, 2009 · Nasty Microsoft

Please! I don't mind careful analyses of the pros and cons of Mono, but this article is terribly biased, just look at the name of the web site. This kind of diatribe should not be posted on DZone.
MailSneaker - Building a mail account watcher ! - CodeBoje Developer Site

Jul 14, 2009 · Jens

Do you mean software engineering related? I do consider the following things part of engineering software: adding a picture to documentation or adding a license when publishing an open source project.

Simple FTP demo application using C#.Net 2.0

Jul 04, 2009 · Mr B Loid

Don't forget that the server side is part of a web application, too. Then the client side works as an interface to web services (or a web-service-like API). The server does the heavy lifting, the client is just a thin presentation layer. Quite useful for some scenarios.

I agree with the criticisms in your blog article, but the nice thing about GWT is that it abstracts everything enough so that one's code is fairly future-proof. Thus, one can let Google worry about keeping up with browser technologies. HTML 5 is already adding new widgets and while I was ready to hate the HTML DOM, I now really like it. Some aspects of CSS are weird, but it enables an interesting style of declarative GUI programming: By just changing attributes such as the class of an element, a whole lot of changes can be triggered. Check out jQuery to find out more.

I think one can loosely compare Ajax's success with Java's: Both didn't do anything new, were initially quite flawed, but somehow hit a sweet spot that made people use them. That is, people saw the potential and not the flaws. With Ajax, the story isn't finished, yet, but things look promising.

BWT: The thread at http://java.dzone.com/articles/what-appeal-ajax-and-gwt has gotten quite long and does have some more Ajax pro and contra arguments.

Simple FTP demo application using C#.Net 2.0

Jul 04, 2009 · Mr B Loid

Don't forget that the server side is part of a web application, too. Then the client side works as an interface to web services (or a web-service-like API). The server does the heavy lifting, the client is just a thin presentation layer. Quite useful for some scenarios.

I agree with the criticisms in your blog article, but the nice thing about GWT is that it abstracts everything enough so that one's code is fairly future-proof. Thus, one can let Google worry about keeping up with browser technologies. HTML 5 is already adding new widgets and while I was ready to hate the HTML DOM, I now really like it. Some aspects of CSS are weird, but it enables an interesting style of declarative GUI programming: By just changing attributes such as the class of an element, a whole lot of changes can be triggered. Check out jQuery to find out more.

I think one can loosely compare Ajax's success with Java's: Both didn't do anything new, were initially quite flawed, but somehow hit a sweet spot that made people use them. That is, people saw the potential and not the flaws. With Ajax, the story isn't finished, yet, but things look promising.

BWT: The thread at http://java.dzone.com/articles/what-appeal-ajax-and-gwt has gotten quite long and does have some more Ajax pro and contra arguments.

Simple FTP demo application using C#.Net 2.0

Jul 04, 2009 · Mr B Loid

Don't forget that the server side is part of a web application, too. Then the client side works as an interface to web services (or a web-service-like API). The server does the heavy lifting, the client is just a thin presentation layer. Quite useful for some scenarios.

I agree with the criticisms in your blog article, but the nice thing about GWT is that it abstracts everything enough so that one's code is fairly future-proof. Thus, one can let Google worry about keeping up with browser technologies. HTML 5 is already adding new widgets and while I was ready to hate the HTML DOM, I now really like it. Some aspects of CSS are weird, but it enables an interesting style of declarative GUI programming: By just changing attributes such as the class of an element, a whole lot of changes can be triggered. Check out jQuery to find out more.

I think one can loosely compare Ajax's success with Java's: Both didn't do anything new, were initially quite flawed, but somehow hit a sweet spot that made people use them. That is, people saw the potential and not the flaws. With Ajax, the story isn't finished, yet, but things look promising.

BWT: The thread at http://java.dzone.com/articles/what-appeal-ajax-and-gwt has gotten quite long and does have some more Ajax pro and contra arguments.

File Type Metadata Discovery, Part 2: Images

Jul 03, 2009 · Fred Eaker

@Greg Brown:

Especially with 6u10, applets are really cool. Pro-GWT arguments do hinge on the premise that Ajax apps are worth the effort. With applets, apart from installed base, it is the little things that make them feel ever so slightly out of place. Even now, knowing about the inferiority of the web platform, I sometimes prefer it to Swing+JVM. And I think the best for browsers is yet to come. It has an amazing amount of momentum and enthusiasm behind it, so eventually, there will be things that the JVM doesn't offer. Note that that kind of momentum is never due to technical reasons. Java owes its popularity to a similar kind of momentum, otherwise we'd all be using Common Lisp or Smalltalk.

File Type Metadata Discovery, Part 2: Images

Jul 03, 2009 · Fred Eaker

@Greg Brown:

Especially with 6u10, applets are really cool. Pro-GWT arguments do hinge on the premise that Ajax apps are worth the effort. With applets, apart from installed base, it is the little things that make them feel ever so slightly out of place. Even now, knowing about the inferiority of the web platform, I sometimes prefer it to Swing+JVM. And I think the best for browsers is yet to come. It has an amazing amount of momentum and enthusiasm behind it, so eventually, there will be things that the JVM doesn't offer. Note that that kind of momentum is never due to technical reasons. Java owes its popularity to a similar kind of momentum, otherwise we'd all be using Common Lisp or Smalltalk.

File Type Metadata Discovery, Part 2: Images

Jul 03, 2009 · Fred Eaker

@Greg Brown:

Especially with 6u10, applets are really cool. Pro-GWT arguments do hinge on the premise that Ajax apps are worth the effort. With applets, apart from installed base, it is the little things that make them feel ever so slightly out of place. Even now, knowing about the inferiority of the web platform, I sometimes prefer it to Swing+JVM. And I think the best for browsers is yet to come. It has an amazing amount of momentum and enthusiasm behind it, so eventually, there will be things that the JVM doesn't offer. Note that that kind of momentum is never due to technical reasons. Java owes its popularity to a similar kind of momentum, otherwise we'd all be using Common Lisp or Smalltalk.

File Type Metadata Discovery, Part 2: Images

Jul 03, 2009 · Fred Eaker

@Greg Brown:

Especially with 6u10, applets are really cool. Pro-GWT arguments do hinge on the premise that Ajax apps are worth the effort. With applets, apart from installed base, it is the little things that make them feel ever so slightly out of place. Even now, knowing about the inferiority of the web platform, I sometimes prefer it to Swing+JVM. And I think the best for browsers is yet to come. It has an amazing amount of momentum and enthusiasm behind it, so eventually, there will be things that the JVM doesn't offer. Note that that kind of momentum is never due to technical reasons. Java owes its popularity to a similar kind of momentum, otherwise we'd all be using Common Lisp or Smalltalk.

Simple FTP demo application using C#.Net 2.0

Jul 02, 2009 · Mr B Loid

@Andrew Vishnevsky: I've blogged about this: What is the appeal of GWT (and Ajax)?
Simple FTP demo application using C#.Net 2.0

Jul 02, 2009 · Mr B Loid

@Andrew Vishnevsky: I've blogged about this: What is the appeal of GWT (and Ajax)?
Simple FTP demo application using C#.Net 2.0

Jul 02, 2009 · Mr B Loid

@Andrew Vishnevsky: I've blogged about this: What is the appeal of GWT (and Ajax)?
Hibernate - Difference between session's get() and load()

Jun 22, 2009 · Ganeshji Marwaha

There must be some kind of deal between the two companies. Do you know the details or are you guessing? It could be anywhere between Sun saying that if Apple doesn't do it, they won't. Or Apple saying that nobody should touch their system. Either way, I blame both companies for not finding a more developer-friendly solution. And again I have to wonder why there is no public statement that explains the situation.

Hibernate - Difference between session's get() and load()

Jun 22, 2009 · Ganeshji Marwaha

There must be some kind of deal between the two companies. Do you know the details or are you guessing? It could be anywhere between Sun saying that if Apple doesn't do it, they won't. Or Apple saying that nobody should touch their system. Either way, I blame both companies for not finding a more developer-friendly solution. And again I have to wonder why there is no public statement that explains the situation.

Hibernate - Difference between session's get() and load()

Jun 22, 2009 · Ganeshji Marwaha

There must be some kind of deal between the two companies. Do you know the details or are you guessing? It could be anywhere between Sun saying that if Apple doesn't do it, they won't. Or Apple saying that nobody should touch their system. Either way, I blame both companies for not finding a more developer-friendly solution. And again I have to wonder why there is no public statement that explains the situation.

Hibernate - Difference between session's get() and load()

Jun 22, 2009 · Ganeshji Marwaha

If I read the page correctly, it is the feature "64-bit support" that "requires a Mac with a 64-bit processor", not Snow Leopard per se.

The Top 30 Django Tutorials and Articles

May 27, 2009 · admin

BTW: The article above can be seen as third in a series.

    1. Eclipse 4 wishes: simplification first, then innovation
    2. Improving code browsing in Eclipse
      Fine-tune Your Active Directory Operations with .NET

      Apr 18, 2009 · Mr B Loid

      JWS is really cool. Especially in combination with the updated applet API: You can drag and drop an applet to the desktop and it becomes a Java Web Start application.

      With the new applets, there are only two problems: First, very often, Java is not installed or a version that is too old. Second, the UI will always feel foreign inside a web browser. Now, with Java being able to access the browser DOM, one could use Java instead of JavaScript to construct DOM widgets etc. It would have to work seamlessly, though (no JavaScript frontend, Java backend, it should all be done in Java) and I don't know of any project that provides the necessary infrastructure to do so.

      Furthmore, with a solution such as Trephine, you have the option to fall back to a non-applet solution if the browser cannot do applets. Then I would use GWT to bridge the client-server differences.

      Fine-tune Your Active Directory Operations with .NET

      Apr 18, 2009 · Mr B Loid

      JWS is really cool. Especially in combination with the updated applet API: You can drag and drop an applet to the desktop and it becomes a Java Web Start application.

      With the new applets, there are only two problems: First, very often, Java is not installed or a version that is too old. Second, the UI will always feel foreign inside a web browser. Now, with Java being able to access the browser DOM, one could use Java instead of JavaScript to construct DOM widgets etc. It would have to work seamlessly, though (no JavaScript frontend, Java backend, it should all be done in Java) and I don't know of any project that provides the necessary infrastructure to do so.

      Furthmore, with a solution such as Trephine, you have the option to fall back to a non-applet solution if the browser cannot do applets. Then I would use GWT to bridge the client-server differences.

      Fine-tune Your Active Directory Operations with .NET

      Apr 18, 2009 · Mr B Loid

      JWS is really cool. Especially in combination with the updated applet API: You can drag and drop an applet to the desktop and it becomes a Java Web Start application.

      With the new applets, there are only two problems: First, very often, Java is not installed or a version that is too old. Second, the UI will always feel foreign inside a web browser. Now, with Java being able to access the browser DOM, one could use Java instead of JavaScript to construct DOM widgets etc. It would have to work seamlessly, though (no JavaScript frontend, Java backend, it should all be done in Java) and I don't know of any project that provides the necessary infrastructure to do so.

      Furthmore, with a solution such as Trephine, you have the option to fall back to a non-applet solution if the browser cannot do applets. Then I would use GWT to bridge the client-server differences.

      Fine-tune Your Active Directory Operations with .NET

      Apr 18, 2009 · Mr B Loid

      JWS is really cool. Especially in combination with the updated applet API: You can drag and drop an applet to the desktop and it becomes a Java Web Start application.

      With the new applets, there are only two problems: First, very often, Java is not installed or a version that is too old. Second, the UI will always feel foreign inside a web browser. Now, with Java being able to access the browser DOM, one could use Java instead of JavaScript to construct DOM widgets etc. It would have to work seamlessly, though (no JavaScript frontend, Java backend, it should all be done in Java) and I don't know of any project that provides the necessary infrastructure to do so.

      Furthmore, with a solution such as Trephine, you have the option to fall back to a non-applet solution if the browser cannot do applets. Then I would use GWT to bridge the client-server differences.

      Fine-tune Your Active Directory Operations with .NET

      Apr 15, 2009 · Mr B Loid

      Users will probably want to run their webapp in three styles:

      1. Run remotely, no local data (=server-side DB).
      2. Run remotely, local data (=client-side DB).
      3. Run locally (=local data).

      In order to minimize context-specific coding, I will probably initially focus on (1) and (3). Unfortunately, with (3) one loses transparent application updates and needs things such as an installer and an (integrated) updater.

      But maybe having an explicit application to install makes things less confusing for users. For example, I would worry whether I really have the newest version of the app, whether all of it has been cached before going offline.

      What does Trephine do if there is no Java available? "onload" just does not get called and one uses trephine.loaded to check whether one is in "trephine mode" or not?

      Fine-tune Your Active Directory Operations with .NET

      Apr 15, 2009 · Mr B Loid

      Users will probably want to run their webapp in three styles:

      1. Run remotely, no local data (=server-side DB).
      2. Run remotely, local data (=client-side DB).
      3. Run locally (=local data).

      In order to minimize context-specific coding, I will probably initially focus on (1) and (3). Unfortunately, with (3) one loses transparent application updates and needs things such as an installer and an (integrated) updater.

      But maybe having an explicit application to install makes things less confusing for users. For example, I would worry whether I really have the newest version of the app, whether all of it has been cached before going offline.

      What does Trephine do if there is no Java available? "onload" just does not get called and one uses trephine.loaded to check whether one is in "trephine mode" or not?

      Fine-tune Your Active Directory Operations with .NET

      Apr 15, 2009 · Mr B Loid

      Users will probably want to run their webapp in three styles:

      1. Run remotely, no local data (=server-side DB).
      2. Run remotely, local data (=client-side DB).
      3. Run locally (=local data).

      In order to minimize context-specific coding, I will probably initially focus on (1) and (3). Unfortunately, with (3) one loses transparent application updates and needs things such as an installer and an (integrated) updater.

      But maybe having an explicit application to install makes things less confusing for users. For example, I would worry whether I really have the newest version of the app, whether all of it has been cached before going offline.

      What does Trephine do if there is no Java available? "onload" just does not get called and one uses trephine.loaded to check whether one is in "trephine mode" or not?

      Fine-tune Your Active Directory Operations with .NET

      Apr 15, 2009 · Mr B Loid

      Users will probably want to run their webapp in three styles:

      1. Run remotely, no local data (=server-side DB).
      2. Run remotely, local data (=client-side DB).
      3. Run locally (=local data).

      In order to minimize context-specific coding, I will probably initially focus on (1) and (3). Unfortunately, with (3) one loses transparent application updates and needs things such as an installer and an (integrated) updater.

      But maybe having an explicit application to install makes things less confusing for users. For example, I would worry whether I really have the newest version of the app, whether all of it has been cached before going offline.

      What does Trephine do if there is no Java available? "onload" just does not get called and one uses trephine.loaded to check whether one is in "trephine mode" or not?

      Fine-tune Your Active Directory Operations with .NET

      Apr 13, 2009 · Mr B Loid

      Thanks! I'm still not sure what the best way of layering and deployment is.

      • Option 1: Make the client offline capable. An elegant solution, but I need the RDF database Sesame which is Java-based. One would still want access to the local file system (which could be provided by Trephine).
      • Option 2: let users install Tomcat + web application. Same as above for the file system.
      • Hybrid solution: Download JARs to the browser, use LiveConnect (or something similar) so that one has a client-side Java backend. Again I would want to use GWT, but that does sound doable.
      Is there a way to determine whether Trephine is running or not?
      For the future, one has to wonder whether one will ever directly access server-side data or always synchronize a local repository with a server. An eye-opener in this regard has been for me how easy it is to switch mail clients with IMAP (which can be seen as a synchronization technology).
      Fine-tune Your Active Directory Operations with .NET

      Apr 13, 2009 · Mr B Loid

      Thanks! I'm still not sure what the best way of layering and deployment is.

      • Option 1: Make the client offline capable. An elegant solution, but I need the RDF database Sesame which is Java-based. One would still want access to the local file system (which could be provided by Trephine).
      • Option 2: let users install Tomcat + web application. Same as above for the file system.
      • Hybrid solution: Download JARs to the browser, use LiveConnect (or something similar) so that one has a client-side Java backend. Again I would want to use GWT, but that does sound doable.
      Is there a way to determine whether Trephine is running or not?
      For the future, one has to wonder whether one will ever directly access server-side data or always synchronize a local repository with a server. An eye-opener in this regard has been for me how easy it is to switch mail clients with IMAP (which can be seen as a synchronization technology).
      Fine-tune Your Active Directory Operations with .NET

      Apr 13, 2009 · Mr B Loid

      Capuchino is exciting, but IIRC does not have tools as good as, say, Eclipse when it comes to refactoring and code navigation. The same holds for Jaxer. For me Eclipse has become very important: I used to prefer Python over Java, but Eclipse changed that.

      If JavaScript ever gets optional types (and hopefully other features such as generators, list comprehensions etc.) then I think it won't be long before JS IDEs are up to par with Java. Capuchino feels like an intermediate solution that improves on JS language-wise. I guess GWT is in the same league, but it has a very convincing server story.

      Lastly, Java is unparallelled when it comes to libraries, especially for semantic web stuff.

      I still can't form a coherent picture of all of this in my mind, because there are cool pieces everywhere, they just don't fit together (yet).

      Fine-tune Your Active Directory Operations with .NET

      Apr 13, 2009 · Mr B Loid

      Capuchino is exciting, but IIRC does not have tools as good as, say, Eclipse when it comes to refactoring and code navigation. The same holds for Jaxer. For me Eclipse has become very important: I used to prefer Python over Java, but Eclipse changed that.

      If JavaScript ever gets optional types (and hopefully other features such as generators, list comprehensions etc.) then I think it won't be long before JS IDEs are up to par with Java. Capuchino feels like an intermediate solution that improves on JS language-wise. I guess GWT is in the same league, but it has a very convincing server story.

      Lastly, Java is unparallelled when it comes to libraries, especially for semantic web stuff.

      I still can't form a coherent picture of all of this in my mind, because there are cool pieces everywhere, they just don't fit together (yet).

      Fine-tune Your Active Directory Operations with .NET

      Apr 13, 2009 · Mr B Loid

      Capuchino is exciting, but IIRC does not have tools as good as, say, Eclipse when it comes to refactoring and code navigation. The same holds for Jaxer. For me Eclipse has become very important: I used to prefer Python over Java, but Eclipse changed that.

      If JavaScript ever gets optional types (and hopefully other features such as generators, list comprehensions etc.) then I think it won't be long before JS IDEs are up to par with Java. Capuchino feels like an intermediate solution that improves on JS language-wise. I guess GWT is in the same league, but it has a very convincing server story.

      Lastly, Java is unparallelled when it comes to libraries, especially for semantic web stuff.

      I still can't form a coherent picture of all of this in my mind, because there are cool pieces everywhere, they just don't fit together (yet).

      IBM explores SOA in banking

      Apr 01, 2008 · Vera Tushurashvili

      Yes. Eclipse E4 had it coming! Excellent April fool's.

      FREE Visual Studio .NET Tips and Tricks ebook

      Mar 26, 2008 · Lebon Bon Lebon

      I've blogged [1,2] about how I would like to see Eclipse being improved (I'm making concrete suggestions in the blog posts):
      • For plugin developers: Make the Eclipse code (and config) base easier to discover and handle.
      • For Eclipse users: Make code easier to browse and edit.
      [1] rauschma.blogspot.com/2008/03/eclipse-4-wishes-simplification-first.html
      [2] rauschma.blogspot.com/2008/03/improving-code-browsing-in-eclipse.html

      What I don't understand is how Eclipse can profit from being based on web technologies. Sure, supporting web developers in the Eclipse IDE is great, but why should the IDE itself be web-based? Or do they want to turn the RCP into something like GWT? Then RAP is not a good role model; it is too fat server-wise and not fat enough client-wise. When it comes to future web apps, my guess would be that both server and client will be coded in ECMAScript4. It is an incredibly powerful language that I'd love to see hosted on the JVM (probable, given Rhino) and supported by Eclipse.

      User has been successfully modified

      Failed to modify user

      ABOUT US

      • About DZone
      • Support and feedback
      • Community research
      • Sitemap

      ADVERTISE

      • Advertise with DZone

      CONTRIBUTE ON DZONE

      • Article Submission Guidelines
      • Become a Contributor
      • Core Program
      • Visit the Writers' Zone

      LEGAL

      • Terms of Service
      • Privacy Policy

      CONTACT US

      • 3343 Perimeter Hill Drive
      • Suite 100
      • Nashville, TN 37211
      • support@dzone.com

      Let's be friends: