Archive for August, 2003

A Taxonomy of Comments

Sunday, August 31st, 2003

Christian Sepulveda writes about comments in source code:

Not all comments are bad. But they are generally deodorant; they cover up mistakes in the code. Each time a comment is written to explain what the code is doing, the code should be re-written to be more clean and self explanatory.

This statement is provocative and interesting, but wrong. There are more good uses for comments than bad ones. (The rest of Sepulveda’s posting is more nuanced, and much of what I write here expands on points he makes.)

Comments are an escape hatch for expressing everything about a program that the programming language can’t. Comments therefore don’t fall into a single natural category.


Read the rest of this entry »

Test versus Type

Wednesday, August 20th, 2003

A lightweight language such as Python or JavaScript fits a lot of program design into a small amount of source text. A heavyweight language such as C++ or Java uses more tokens to express the same design.


Read the rest of this entry »

Dot Numbers

Thursday, August 14th, 2003

Dot numbers are a new notation for numbers, that make integer addition look like rational multiplication. They may be useful in primary school math education. The idea is that once you understand integers and addition, you can learn another way to look at it that sets you up to understand fractions and multiplication.

I made up dot numbers a few years ago to try to explain negative numbers to my then-four-year-old son.

Basics

A dot number is a way of writing a number. A dot number is represented as a number of dots above a line. This is the number 3, as a dot number:


Read the rest of this entry »

Laszlo Blogging Widget

Friday, August 8th, 2003

Last month I did a code sprint on a blogging aggregator written in LZX. You can see the results at myLaszlo.com. There’s a screenshot on this page.

more

The aggregator was based on a suggestion by Marc Cantor. It’s a widget intended for the gutter of a blog. Like a blogroll, it displays a list of blog titles. Like a full-page aggregator, it displays the last few items within each blog. And since it’s a Laszlo application, it can be driven by an XML feed, and animates smoothly between visual states.


Read the rest of this entry »

Rethinking MVC

Monday, August 4th, 2003

In the Model-View-Controller architecture, the Model is decoupled from information about the user interface. In a Data-Driven Presentation, the data contains all the information necessary to assemble the user-interface elements. These design patterns appear at first to be exclusive mutually exclusive: either the data contains presentation information, or it doesn’t. This apparent conflict is because of a confusion between the Model of MVC, and the Data in DDP.
more

Two Architectures


MVC

The Model-View-Controller (MVC) architecture consists of a Model, which simulates a real-world or “business” object, and a View, which represents the user interface of the object. (There’s also a Controller, but I’m not going to talk about that here.)


Read the rest of this entry »

myLaszlo.com

Friday, August 1st, 2003

Check out myLaszlo.com. As well as showing off some examples, this is a way of getting free hosting for Laszlo applications written using the Laszlo Presentation Server’s Developer Edition — which is also free.
more
Some applications that people have already posted:


Read the rest of this entry »