Posts from 2008

Questions or comments? Email me.

Fri 19 December 2008

Open source programming languages for kids

This Entry is Archived!

This article was originally published on December 19, 2008 (2:00:00 PM) over at Linux.com. A still-breathing version of the article (broken links intact) can be found at Linux.com.

Scratch

The past couple of years have seen an explosion of open source programming languages and utilities that are geared toward children. Many of these efforts are based around the idea that, since the days of BASIC, programming environments have become far too complex for untrained minds to wrap themselves around. Some toolkits aim to create entirely new ways of envisioning and creating projects that appeal to younger minds, such as games and animations, while others aim to recreate the "basic"-ness of BASIC in a modern language and environment.

Developed by the Lifelong Kindergarten group at MIT, Scratch is a graphical programming environment implemented in Squeak that works in a very Lego-like fashion. The basic premise is that you build programs by snapping together colorful blocks of code. Scratch's custom interface allows a programmer to bring in graphics and sounds and create basic animations. All the basic programming constructs, such as loops and if statements, are supported, and grouped into different block categories, such as Motion, Sensing, and Sound.

Scratch has implementations available under Microsoft Windows and Mac OS X, but as of yet there's no (official) native Linux version to run. It is possible to run Scratch through Wine, though in my tests most audio-related Scratch programs ended up failing. There is a Linux-runnable version of Scratch, though it's not actively developed by the folks at MIT. The one problem with using this version is that presentation mode, where your Scratch program can take over the whole screen, doesn't work. This isn't really a show-stopper, as there are a few different ways to view a Scratch program, but it's easy to see how it could be a desired feature.

One useful prospect that Scratch offers is the ability to upload your programs to the Scratch Web site, where you can create an account, get support, and browse programs that other Scratch users have uploaded. All uploaded programs are open source, in the sense that you can download and modify the source of any Scratch program that's been uploaded. Scratch programs are also viewable from within a Web browser, for the most part, through use of a Java applet called the Scratch Player. Scratch itself is released under its own Scratch License, and all uploaded programs exist under a Creative Commons Share Alike license.

One issue I came across with Scratch was that the source code for a program could become quite large when the program involved many graphics or, more specifically, music. One program, a simple music player, reached a strikingly large 93MB in size. Typically Scratch would choke on loading any program greater than 60MB in size, usually erroring out. The large size of a file may have something to do with how old the source code is; repeated instances of saving and re-opening the same file seemed to grow the size exponentially.

Alice

Scratch deals well with 2-D graphics, text, and other somewhat "flat" programming concepts. By contrast, Alice teaches programming fundamentals in the form of 3-D movies and games. Alice is developed in Java, and is somewhat like Scratch in that you build things in a drag and drop interface.

Alice, developed by a group of researchers at Carnegie Mellon University, has releases for Linux, Mac OS X, and Windows, and is released under an aptly titled Alice License. The environment is open source in the sense that you can download and examine the source code, but the creators prefer to work exclusively in-team, and don't take outside contributions. Alice has been around since 1999, making it one of the oldest and most developed environments for teaching children how to program. It is because of this that it's used in schools all over the world.

Shoes

Originally created by a developer who goes by "why the lucky stiff," now furthered by a large development community, and based on the already user-friendly Ruby programming language, Shoes is an open source toolkit that's a bit more in line with traditional programming methods. All that's required to make a program in Shoes, besides its runtime environment, is a basic text editor. On the project's Web site you can find a free PDF guidebook that contains tutorials and examples for Shoes. You can also order the guidebook in paperback form for $5.57. Shoes 2 comes with an extensive built-in manual that users can access via key commands.

Shoes has similar syntax to Ruby, and has easy methods for creating graphics and buttons, as well as displaying colors and text. It is supported across multiple platforms, including Linux, Mac OS X, and Windows. The toolkit works well across platforms, in that windows, buttons, and dialogs look native to their environment, and do so regardless of which platform the application was initially created on. A benefit of Shoes being in Ruby is that it's given access to the many different RubyGems packages that exist. Shoes 2 even includes support for automatically installing a Gem on a user's system if it's not already present.

Shoes has a fan-supported Web site that showcases a gallery of applications created with Shoes. As with Scratch, all the applications that are uploaded can be downloaded, modified, and remixed. Shoes itself is released under an MIT License, and is open to outside patching and development.

A multitude of other programming languages and environments exist to teach children, such as Greenfoot, Phogram, and Microsoft's Small Basic, though many of them exist as proprietary implementations. Scratch, Alice, and Shoes are all open source, include support channels such as forums or chatrooms, and have large, thriving communities. These three environments are possibly the most open, mature, and easily accessible environments that are geared toward teaching programming concepts to young minds.

Mon 15 September 2008

Supercharge Firebug

This Entry is Archived!

This article was originally published on September 15, 2008 (9:00:00 AM) over at Linux.com. A still-breathing version of the article can be found at Linux.com.

Yslow

While you can use Firebug to monitor network activity, you can take that to the next level by adding YSlow, which checks your Web site against Yahoo's best practices for a high performance Web site. Besides checking your performance, YSlow can also show you graphs and charts that let you inspect things such as expires headers, ETags, and the total amount of HTTP requests -- all useful for optimization.

Jiffy

Jiffy is a Firebug extension developed at Netflix that checks and captures time measurements for JavaScript that loads on the page (via jiffyweb, an open source Web site measurement suite), and provides a graphical representation of the data, which is ideal for comparing and reducing the effects on page load that are brought on by various JavaScript libraries.

FirePHP

If you're debugging HTML, CSS, or JavaScript, Firebug fits your needs, but what if you want to go further? FirePHP is a Firebug extension that lets you work with PHP5 and up as your server-side language of choice. FirePHP requires that a PHP library be installed in order to function, but once that's installed FirePHP can make use of special "X-FirePHP-Data" headers to bring debugging into the Firebug pane. The debugging data that's sent from the server to the client-side does not interfere with the content of the page you're debugging in any way. For more information, including a quick tutorial, check out the FirePHP Homepage.

Firecookie

The Firecookie Firebug extension allows you to view all the cookies currently being used on a page or search for a specific cookie, monitor any existing cookies on the page, and add or delete cookies at will. With Firecookie you can check out information on any cookie, such as the name, value, domain, expire date, or path. You can also use the extension to change your settings for accepting or denying cookies straight from within Firebug.

Pixel Perfect

Firebug can provide more than just developer functionality. If you're a designer, check out Pixel Perfect, a Firebug extension that allows you to overlay a semi-transparent image, or mockup, of your page design. Tou can then use Firebug to line up every element on your page with the overlay. Pixel Perfect is still an experimental add-on, but in my tests I found it to be perfectly stable.

If you like the features of Pixel Perfect and would like to use it in a cross-browser setting, check out OverlayComp, an open source script that accomplishes much of the same functionality, albeit with lesser convenience.

Rainbow for Firebug

Firebug's default script panel can feel somewhat like working in a plain text file at points. To get around this, check out another experimental add-on. Rainbow for Firebug adds syntax highlighting to the script panel, displaying intuitive, color-coded text for variables, objects, functions, and more. There are alternatives to the default highlighting colors -- to see more coloring options, or possibly create your own, check out the Rainbow for Firebug homepage.

Rainbow utilizes the parser from CodeMirror.

All the aforementioned extensions work best with Firefox 3 and some form of Firebug 1.2. Rainbow in particular requires Firebug 1.2 -- if it's installed alongside an older version of Firebug, that version will cease to function.

Firebug by itself is an immense asset to any Web developer, but if you extend it with any of these add-ons, you'll have a tool that can reduce the time it takes you to implement and debug your sites.

Ryan around the Web