March 26, 2010

New Projects: IndexBy, TagBuilder, and ProgressiveEnhance

I recently released 3 open source projects via Google Code: eblackwelder. Here they are:


IndexBy
Language: PHP 5+
Usage: Convert database results into arbitrarily nested arrays.
Download: IndexBy v1.0
Documentation: IndexBy wiki
License: MIT License
Target audience: Web-app/database developers


TagBuilder
Language: PHP 5+
Usage: Programmatically compose well-formed HTML fragments.
Download: TagBuilder v1.0
Documentation: TagBuilder wiki
License: MIT License
Target audience: (server-side) web-developers.


ProgressiveEnhance
Language: Javascript
Usage: Helper functions for progressively enhancing widgets
License: MIT License
Target audience: (client-side) web-developers/scripters.
Dependencies: My Library

March 23, 2010

My Library: a new way to Javascript!


My Library is a new, open source Javascript library (published on Google code Jan. 2010) that starts off doing things "the right way". It's not My as in mine, but My as in yours--something you can make your own!

The first (and only) cross-browser Javascript library
Unlike every other Javascript library out there (think: jQuery, Prototype, YUI, script.aculo.us, Dojo, MooTools, qooxdoo, etc.), My Library does no "user-agent sniffing" or "Object inference" (discussed in detail  here). It performs proper feature detection and presents a dynamic API at runtime, which is detected by your application and handled accordingly.

What does that mean? Instead of trying to guess which browser the library someone is using, My Library detects what the browser is capable of--and adapts accordingly "on the fly". (This is called "degrading gracefully".) Instead of "supporting" only a limited number of known web-browsers, My Library plays nicely with any web-browser, even web-browsers that haven't been released, yet! (This is something that the other "sniffing" libraries will never be capable of doing.)

Indeed, one of the My Library slogans is "Write once, do nothing, run anywhere, forever!", purposefully mocking jQuery's "write less, do more" slogan. ;)

Download builder: the smaller the better!
Not only does it offer a dynamic API at runtime, it offers a customizable download builder. Instead of overloading your clients with Kilobytes of Javascript libraries, you only have to download and serve the code your web-application requires. This makes your web-application more responsive at load time and spares the clients with slower download rates and resources (think: smartphones).

Fast!
Using "quasi-standard" industry tests like "SlickSpeed" and "TaskSpeed"....
  • In the latest web-browsers, My Library at least ties the fastest of the other Javascript libraries and CSS selection libraries--and on modern hardware, this difference is negligible. Although the errors some of the other popular libraries throw are not negligible!
  • In older web-browsers, it decisively dominates the competition.
  • In obscure browsers (ever heard of "Green" or "Sleipnir" browsers?), My Library is the only library that doesn't die from execution errors.
And you can try out the tests for yourself.

The down side?
The only down sides I am aware of is a current lack of community support (it's only 3 months old, OK) and that the documentation is at a minimal level. But with a few more months of growth, it should have a set of widget plugins, proper (and expanding) documentation, and a more active community.

So, where do I find it?
The home of My Library is at www.cinsoft.net/mylib.html. Check out the Examples, then head over to the "Builder" and give it a whirl.

Cheers!

March 22, 2010

Anyone can cook

I just watched Ratatouille (again) at my niece's house this past weekend... the theme is "Anyone can cook". (Meaning "Not everyone can become a great artist, but a great artist can come from anywhere.") With that in mind...

Anyone can be a web-developer!
Thanks to free and open source web-development tools, anyone can become a web-developer. I will mention a few of those free tools...

1) Apache Web Server
Tool 1: The Apache web server--actually called httpd (meaning the "HTTP Daemon" (a daemon is a background service)) but is often called "Apache" because it is supported by the Apache Software Foundation.

According to Netcraft, Apache has been the most popular web server since 2006 and currently (as of March 2010) serves over 54% of all websites. It serves 67% of the million busiest sites (the next is Microsoft's IIS at 17.4%). And it's free!

You can find it here: httpd.apache.org.

2) PHP: Hypertext Processor
Tool 2: The PHP scripting language. it currently stands for "PHP: Hypertext Processor". (It used to stand for "Personal Home Page", but the authors thought a recursive acronym was cooler.) By embedding PHP instructions into your HTML web-pages, you can create dynamic websites.

It's hard to tell how "popular" a programming language is, but PHP is pretty popular these days (it currently ranks 3rd on the TIOBE index of all languages).

Find it here: www.php.net

3) MySQL Database Engine
Tool 3: The MySQL database engine (pronounced "my es-queue-el", as opposed to SQL, which is pronounced "sequel"). SQL is a standardized, mathematically-grounded language for managing and querying relational databases. MySQL is an open-source SQL database engine.

Whereas some SQL databases have been around for years (e.g. Oracle started in 1979), MySQL is relatively new (1995) and only really worth talking about as of MySQL 5 (2005), with the addition of the InnoDB storage engine. But it installs on practically everything and has a number of useful (and free) tools. And it's free! (Note: I can't find any usage notes, but MySQL claims that it's the most popular open source database.)

Find MySQL here: www.mysql.com

XAMPP, LAMP, WAMP, MAMP, etc.
So... with Apache, PHP, and MySQL, anyone can develop websites (YMMV). But how long does it take to download, install, configure, and test everything--especially if you're new at this? Because these tools play so nicely together some of the open source community decided to package them together--just to make your life easier. (Although getting something working yourself can be more instructive.)

  • LAMP stands for "Linux, Apache, MySQL, and PHP" (packages depend on your OS)
  • WAMP stands for "Windows, Apache, MySQL, and PHP"
  • MAMP stands for "Mac, Apache, MySQL, and PHP"
  • XAMPP stands for "Any OS, Apache, MySQL, PHP, and Perl"
  • etc. (Wikipedia has a better list of "*AMP" packages here)
Using WAMP to build web-sites on my Windows laptop and upload them to my Linux web-server (running LAMP) means I can choose the cheapest hosting plan (windows vs. linux, etc) and still get the job done. And it's all free!


In my experience: WAMP is fine for Windows machines--it has an installer for configuring MySQL and Apache services; everything is based inside a single folder to keep things clean. XAMPP, however, can be run from a thumb-drive, if need be (see PortableApps.com). In fact, I've been able to run Trac off a thumb-drive (Apache, MySQL, Python, and Subversion) via XAMPP!