Category: Programming

  • Systems Approach v. User Approach

    I wanted to follow up on Bruce Eckel’s thought about “thinking in zope” (or thinking in a particular idiom or computer language). Previously he argued that one cause of bad design is a developer’s failure to appreciate customer problems and what they really want. The problem, he argued, boils down to gathering and heeding user requirements.

    Now he’s changing his tune a bit. He’s saying that a systems approach (understanding the computer language/tools first before you can tackle actual problems) might actually be preferable. Zope, I’m afraid, is a platform that forces you to think differently; you are dealing with objects, not tables of data; you are dealing with macros and slots and methods employed on objects. That is quite a contrast to the typical notion of separating data from logic (with RDMS), and it involves a lot of iteration; you are creating instances rather than filling tables. Instead of dealing with static php pages that trigger a lot of data calls, you are using paths to convey objects that are acted upon. Quite frankly, I’m not used to thinking this way although that doesn’t mean my plastic brain can’t change.

    Andy McKay’s book starts out with a user-centered approach (i.e., explaining how to work the interface), but actually we need to use a systems-oriented approach just to get started. I can manipulate the interface, but can I actually create templates? I need more.

    The problem comes when familiarity with systems imposes patterns on user workflow. The developer needs to adopt two nearly contradictory mindsets: that of user who just wants to get the job done, and that of system-aware coder who wants the workflow to fit within the language’s parameters. It’s not that the developer dislikes the user; it’s that he builds things in terms of what’s already been built; the principle of least effort seems to apply. On the other hand, a good developer can recognize when a new use case seems to justify for a new tool or algorithm.

  • Perfection-oriented v. Performance-oriented

    Robert Strandh writes a piece about two different kinds of learners: perfection-oriented learners and performance-oriented learners.

    He writes:

    The people in the category perfection-oriented have a natural intellectual curiosity. They are constantly searching for better ways of doing things, new methods, new tools. They search for perfection, but they take pleasure in the search itself, knowing perfectly well that perfection can not be accomplished. To the people in this category, failure is a normal part of the strive for perfection. In fact, failure gives a deeper understanding of why a particular path was unsuccessful, making it possible to avoid similar paths in the future.

    The people in the category performance-oriented on the contrary, do not at all strive for perfection. Instead they have a need to achieve performance immediately. Such performance leaves no time for intellectual curiosity. Instead, techniques already known to them must be applied to solve problems. To these people, failure is a disaster whose sole feature is to harm instant performance. Similarly, learning represents the possibility of failure and must thus be avoided if possible. To the people in this category, knowledge in other people also represents a threat. As long as everybody around them use tools, techniques, and methods that they themselves know, they can count on outperforming these other people. But when the people around them start learning different, perhaps better, ways, they must defend themselves. Other people having other knowledge might require learning to keep up with performance, and learning, as we pointed out, increases the risk of failure. One possibility for these people is to discredit other people’s knowledge. If done well, it would eliminate the need for the extra effort to learn, which would fit very well with their objectives.

    Looking at these two categories, I would put myself in the perfection-learning category even though I don’t necessarily think this is the better category. He later describes how initial impressions often cause an individual to reject a programming language or toolset for bogus reasons. He says:

    It is hard to overestimate the strength of this phenomenon. I myself recently discovered a marvelous feature in a programming language that I had purposely avoided for the past 10 years, simply because 10 years ago, a colleague (who did not know the feature) explained to me that it was no good. We were both victims of our own minds. My colleague because he obviously needed to defend that he had made a different choice, and myself because I subconsciously found it very appealing to be able to brush off the feature as useless and thus not having to learn it. It is hard to overestimate the wasted time I have put in during the past 10 years due to considerably lower productivity than I could have had, had I realized at the time what I now know about human psychology.

    Obviously Strandh is trying to warn against this tendency. But I would argue that this tendency toward premature judgment is in fact a natural learning response. The brain absorbs what it can. It’s quite possible that this feature wouldn’t have made any sense to him at the time the feature was presented to him, and it was only later that he could appreciate its usefulness. The learner creates his own path, rejecting some avenues and accepting others. We can hope that some teacher can guide him along and point out when the learner is going nowhere, but there is a lot to be said for the learner discovering things on his own. The mistakes in exploratory forms of learning can be just as instructive as the correct paths.

    That is why keeping abreast of a field is particularly important (by for instance reading weblogs). While reading newsgroups and weblogs, the mere recurrence of certain discussions will gradually familiarize the learner to a tool or concept and help him to “rediscover” it later on. To use the example presented above, the reason for the programmer’s stupidity may very well have his failure to keep abreast in ideas and commentaries by peers who did find the tool to be useful.

  • Thinking in Zope

    A list of (primarily php-based) open source CMS’s and web application platforms. It includes links to some php survey tools also.

    A longish 5 page chapter excerpt from Ed Yourdon’s book, Death March. A death march project , for those of you don’t know, is one whose “project parameters” exceed the norm by at least 50 percent. Yourdon admits that death march projects aren’t all evil:

    I’m not necessarily opposed to death march projects; I agree with my colleague Rick Zahniser that such projects can be an educational experience even if they fail. I’ve told you before, I think everyone should be on at least one of these projects. However, there are some other things that you should do at least once:

    • Spend a night in jail.
    • Get commode-hugging drunk
    • Raise a boy
    • Raise a girl
    • Start your own business
    • Climb Mount Fuji

    This actually reminds me of Eric Raymond’s discussion of why open source programmers make better products. The freedom from time constraints makes them less likely to focus on schedules and more likely to focus on good product.

    Bruce Eckel, one of my favorite programming gurus (and author of Thinking in Java, among other things) talks about python, zope and tool complexity. Complaining about Zope 2’s complexity (a complaint I share by the way), he says:

    But after all this time, I don’t “Think in Zope” yet because I don’t do it all the time and there are too many conceptual hurdles to absorb if I don’t do it all the time. So while I’m sure I will not stop using Zope as an app server, I think I also need another Python-based app server running alongside which is much easier to program (possibly until Zope 3 finally appears and overwhelms me with its simplicity).

    Then Eckel waxes philosophical on lowering the threshhold of complexity:

    Part of what I’m trying to convey in this article is the subtle threshold beyond which a thing is just a bit too complicated to absorb into your toolbox, along with all the other tools. The subtlety is that it’s possible to use that tool, but beyond a certain vague point it’s just a little bit too hard to put down and then easily pick up again later, and for me, that’s the crux ? not whether it’s usable at all, but how easy is it to put down and pick up? If I have some fantastic wrench that requires me to consult an instruction manual every time I use it…, I’ll probably just hunt around for the plain old fixed-size wrench, ashamed that I’m not sophisticated enough to use the fancier tool. Making things effortless by lowering the complexity of accomplishment really does make a difference.

    (Eckel also answers some questions about Python).

    I’ve been reading Andy McKay’s book about developing with zope/plone and have been struck by the complexity of it and how ill-equipped I am for learning it. This is one of those things where you have to learn a process for creating something workable, testing it and making it go live. The actual coding part is not the hard part; the hard part is doing it in a way that doesn’t shut down the larger system (It may also help to have more experience working on a similar type of project; this is really my first kind of project like this).

    My learning and technical progress continues in spurts. I can spend days or even weeks trying to figure something out, and then suddenly my mastery of something brings me technical competence to a new level. It’s a little like playing a video game where you can’t use the magic wand until you reach level 2. (The analogy of viewing this programming project like a video game iis helpful because it injects a bit of “hard fun” into the task).

  • JEdit and Python IDE’s

    Still learning the Python thing. From David Mertz’s Charming Python articles, I get this article about Python IDE’s. In summary he says that if you can live with Jython, you can be happy with JEdit. Now if only I can get the debugger to work!

  • The Python Paradox

    Slashdot discussion of Paul Graham’s article about why Python programmers are smarter than Java programmers.

  • Links for Learning Python

    I’m gathering links for learning python. I’ll be adding links over the week. First, Uta Priss’s Python Course & Exercises, Python FAQ, Guido’s Tutorial , and PlanetPython . Also, here’s an interesting piece by Ted Leung about how languages can be community-friendly.

  • Open Ebooks & Big Media Cartels

    David Rothman has been explaining the advantages of the openreader. Here’s a longer piece by Jon Noring on the dangers of DRM overkill., and open ebook standards.

    On their implementation roadmap, I see that they are emphasizing xhtml/css and basic oebps, but not TEI-lite or Docbook (not immediately at least). That is both good and bad. I don’t have enough experience with these dialects, but i’m not sure that people making xhtml are thinking about how it would be rendered in an ebook reader. (Here’s a FAQ about basic oebps).

    Also David Rothman is proposing reverting copyright laws back to pre-Bono terms. This is a sensible idea, but we are misidentifying the real harm being done. “Perpetual copyright” make content creators reluctant to cede rights. At this point in my life, everything I do must be creative commons. But if I could negotiate rights to regain copyright control after a substantially shorter amount of time (say 5 or 10 years), then I wouldn’t rule out trying to sell content. Therein lies the advantage of small publishing. Instead of offering giant royalties, they can offer authors better copyright control (and shorter durations).

    The problem might actually be one of content production. Far-fetched? The status quo media companies are not pumping out content fast enough. Look at mp3’s. The ratio of unsigned artists to signed artists is 100 to 1. For every song put out by major media companies, unsigned artists are releasing at least 100 mp3’s. Unfortunately, big media companies want to convey this sense of “scarcity” in order to keep the high price of content. Why has the cost of buying music stayed essentially the same over the years? In fact, the costs of production have dropped precipitously to the point of nonexistence; when you download or share mp3’s, the content creator is essentially losing nothing.

    Here’s the solution to how to beat the big media empires: outproduce them! In other words, make it easier for consumers to acquire content in greater amounts and at substantially lower cost than the major media companies are doing now. Of course, it means essentially forgoing massive marketing campaigns and music videos and thousands of review copies and payola. The net result may be lower royalty checks for more content creators. Media companies can compensate for lower payments by offering more control over rights. This is really easy.

  • Zope Photo Installer and Photo Galleries

    A Photoalbum product for Zope. It doesn’t seem to be plone-friendly yet. Check out this feature list. It looks like the yet-to-be-released version 1.4 will make it plone-friendly.

    Alex King has a photo database. The neat thing about his product is that it is platform neutral. Basically you run a web server on your local machine to let you create your catalog database. Because it runs on php/mysql/apache, you can run it on any machine (and because it is in mysql, I assume you can manipulate your data for reports. The only bad thing about this software is that it doesn’t offer a way to display your data and that for performance reasons it’s not good for a remote server. Still, if you can import the photos to a directory which can then by used by another display program, it would work very well. (Alex King has a forum here for his product). For those who can afford to stay on Windows only, there are two good options: Picasa (recently bought by google) and imatch.

    WordPress has a photo hack, which really isn’t necessary because you can upload several photos in any given post, for example.

    Of course, there’s the PHP-based Gallery project (though I don’t feel comfortable with the fact that the PHP must not be in safe mode.

    I have two problems (really three) to address. First, which gallery is the most user-friendly and most compatible for my preferred platform (zope/plone)? Second, how easy will it be to customize the output so that I can make (sometimes lengthy) comments about the photos in question? (I’m guessing that can be done with ZPT). Third, can I batch upload the photos via SCP/FTP or even multiple upload controls on a webpage? Fourth, I want the ability to create metadata for the photos I am importing into the project. (And I want a way to access and even use this metadata outside of the web interface). Fifth, I want the ability to specify parameters about the size of thumbnails and maximum size of uploads (and screen size). Sixth, I want an easy way to access the files on the file system in the event that the web interface has broken down. Seventh, I would like the ability to allow different users to create their own photo galleries, with appropriate permissions and controls. Also, the big question is photo metadata. There is IPCT (which relates to content, using general categories), and EXIF (which relates to technical specs of the camera and shooting). Here’s a primary on photo metadata.

    Zope uses CMFPhotoAlbum, which I think is sucky (though its Python Image library allows you to zoom, which is cool . Anybody have a better suggestion?

  • Various Technology Posts

    Help, this weblog is quickly turning into a literary/cinema blog! I go in spurts about various subjects. For a few weeks, I’m crazy about python, another week I’m ranting about world affairs, then the next two weeks I’m into mythology and wacky photoshop sites.

    This week, everybody has been publicizing the Internet Explorer exploits. From the MS article about how to avoid being duped:

    The most effective step that you can take to help protect yourself from
    malicious hyperlinks is not to click them. Rather, type the URL of your
    intended destination in the address bar yourself.

    So much for hypertextuality. I wanted to bring up something about Firefox which is truly incredible. One of the extensions, Web Developer, lets you highlight html elements, edit css on the fly and most importantly, display ID & class details. This last feature is something I’ve been seeking for a long time, and topstyle doesn’t have. At least, Topstyle doesn’t make visible classes and ID’s for pages being actively edited. It’s hard to believe why style editors or dreamweaver haven’t incorporated this feature. (Yes, I know, you are wonderings, since when have I spent much time editing styles?)

    Slashdot forum: when donating a laptop to a school in Uganda, what software should I put on it? Some of the more interesting answers: 1 gig of porn (to copy and resell). The entire wikopedia database (available in sql/mysql) and an ISO burn of Project Gutenberg.

    Not that I have anything against Project Gutenberg, but people’s reading habits have changed. They are more likely to experience older things a)if they are in audio form, b)if it is short or for school. Maybe there will be a resurgence of interest in 19th century texts only when we have an ebook reader that doesn’t include DRM.

  • 20 Questions (For the Web)

    From JOHO, here’s a lovely online version of the classic game 20 questions. I tried blowjob, prayer, goggles, birthday cake, sitcom, a pomegranete, a podium, a will, a signature. Guess which ones the online game guessed correctly?

  • Shirky’s Nomic World

    I know that slashdot and boingboing will catch this on their radar: Clay Shirky on the nomic world. (Link not available yet, but it will be shortly).

    In fact what often happens, both online and off, is that structures are created which look like citizen input, but these structures are actually designed to deflect participation while providing political cover. Anyone in academia knows that faculty meetings exist so the administration can say “Well you were consulted” whenever something bad happens, even though the actual leverage the faculty has over the ultimate decision is nil. The model here is customer service — generate a feeling of satisfaction at the lowest possible cost. Political representation, on the other hand, is a high-cost
    exercise, not least because it requires group approval.

    Interestingly, Shirky invoked a game I used to play a few times, Nomic. It brings up fond memories of arguments and getting my pants whipped in a fun sort of way.

    Finally, and this is the most important point, we are moving an increasing amount of our speech to owned environments. The economic seriousness of these worlds undermines the ‘it’s only a game’argument, and the case of tk being run out of the Sims for publishing reports critical of the game show how quickly freedom of speech issues can arise. The real world is too difficult to control by fiat — pi remains stubbornly irrational no matter who votes on it — but the
    online world is not. Even in non-game and non-fee collecting social environments like Yahoo Groups, the intrusiveness of advertising and the right of the owners to unilaterally change the rules creates many fewer freedoms than we enjoy offline.

    This whole essay is full of insights. One more thing. An interesting analysis about the Paradox of Self-Amendment. by Nomic found Peter Suber. Probably more in depth than interests me, but worth skimming over at least.

  • Ton of Bricks

    Added Jim Roepcke’s Have Browser Will Travel to my permanent links. He gave a good intro to python at a plone conference. (The other slides/presentations are archived here).

    Roepcke alerted me to the amazing interview with soldier Jim Massey about his participation in the killing of innocent Iraqi civilians. There are chilling quotes everywhere:

    Q: What does the public need to know about your experiences as a Marine?

    A: The cause of the Iraqi revolt against the American occupation. What they need to know is we killed a lot of innocent people. I think at first the Iraqis had the understanding that casualties are a part of war. But over the course of time, the occupation hurt the Iraqis. And I didn’t see any humanitarian support.

    Q: What experiences turned you against the war and made you leave the Marines?

    A: I was in charge of a platoon that consists of machine gunners and missile men. Our job was to go into certain areas of the towns and secure the roadways. There was this one particular incident – and there’s many more – the one that really pushed me over the edge. It involved a car with Iraqi civilians. From all the intelligence reports we were getting, the cars were loaded down with suicide bombs or material. That’s the rhetoric we received from intelligence. They came upon our checkpoint. We fired some warning shots. They didn’t slow down. So we lit them up.

    Q: Lit up? You mean you fired machine guns?

    A: Right. Every car that we lit up we were expecting ammunition to go off. But we never heard any. Well, this particular vehicle we didn’t destroy completely, and one gentleman looked up at me and said: “Why did you kill my brother? We didn’t do anything wrong.” That hit me like a ton of bricks.