Categories
JavaScript

I don’t write JavaScript like it’s Ruby

I just uploaded the largest chapter, 9, and had hoped to get 10 loaded tonight, but my mind isn’t working well. Aha, I though, write in the weblog instead.

This has been such a difficult book in more ways than one. The examples were huge and now, during editing, I have to find some way to cut them down to size; or at least trim that which shows in the book.

There are so many factors complicating the examples and the writing: cross-browser differences, quirks, IE, memory leaks, XHTML doctypes, IE, markup, CSS, JavaScript, etc etc IE etc. Then there are the issues of graceful degradation so that an application works with scripting turned off, making the code unobtrusive, and most importantly, making it accessible. Testing with JAWs, with Windows Eyes, not even sure how to use the applications.

The examples must also be exciting, fresh, innovative, and fun. Sparkly, hip, fashionable. Attractive, clean, impressive. Efficient and secure. Optimized and compartmentalized. Leave Web 2.0 in the dust of my passing.

I had a wonderful time with Chapter 8 and advanced CSS and SVG and Canvas–what a kick. I really like my database examples, and I think I’ve made some good, solid points throughout the book. I’ve touched on all the major components, demonstrated the major libraries, but provided most of the code. There’s booze in it, but no sex.

My biggest concern? I don’t write JavaScript like it’s Ruby.

Categories
Web

Old Skool

Recovered from the Wayback Machine. 

Lifted my head long enough from Adding Ajax to see a fooflah about Flickr’s newest announcement.

Flickr had said a long time ago that there would be a time when you won’t be able to have a login separate from a Yahoo account. Today the group announced that it’s no longer viable to maintain separate login systems and folks will have until March 15th to create a Yahoo identification and port their account to it. I must admit to some amazement about the anger this has generated. It was a given this was going to happen. It makes no sense to have two completely different sign-on systems.

Ken from Digital Common Sense writes:

I don’t like this. I have multiple Yahoo IDs. They are disposable, in part, becauseYahoo is disposable. My loyalty to Yahoo is non-existent. Their email sucks. The IM client is a bloated pig given years of creeping featurism with continual incorporation of crap the doesn’t work and users don’t want. In short, I’m not a Yahooligan.

I can understand that Ken doesn’t like Yahoo, but Yahoo did buy Flickr. In fact, chances are if they hadn’t, Flickr would have fallen under the weight of the demands on the system. It’s not many companies that have the built in infrastructure to handle the access sites like Flickr, or Yahoo for that matter, demand. True there are bigger photo sites, but the larger ones are focused around the photos, themsevles, which are a static, easy to serve and maintain commodity . Flickr is a community site with enormous CPU, complex data storage, as well as bandwidth needs.

If Flickr was asking something that wasn’t reasonable, I could understand the push-back, but not wanting to maintain separate sign-on and identity systems makes perfect sense–I wondered at them keeping these separate for so long.

Still, if folks aren’t comfortable with a Yahoo ID, they should consider dropping this account. There are other social photo systems, such as Zooomr, though I agree with Anil Dash in that …using these sort of opportunities to promote a competing business… is not cool. Predictable, but not cool.

Other concerns are that you can only now have 3000 contacts, and no more than 75 tags per photo. Wow, what a hardship. One person has 19,000 contacts, and as soon as he mentioned this on the thread, those folks who were among his contacts asked to be taken off. There’s a new thing in social system called the contact junkie, who craves contacts as others would crave the next heroin fix. I suppose that Flickr making these folks go cold turkey is cruel, but I can’t see a system being maintained just for the less than 1/10 of one percent of connection addicts.

It’s interesting about how some people seem to think there’s an ulterior motive for all of this, because, according to these folks, putting limits on data structures is never necessary for enhancing the performance or robustness of the system. Before you ask, no, none of the people making statements like this have a clue in how systems are built.

There are legitimate concerns about this move, not the least of which is it is difficult to find a meaningful Yahoo identifier. Luckily mine, P2PSmoke is one I’ve had since P2P was the hot thing; way before all this social software stuff. When folks talk about ‘old skool’, I have a meaningful Yahoo account–can’t get more old ‘skool’ than that.

(Question: why can’t cool people spell words correctly? This trend to add ‘cuteness’ to words should die a sudden and irreversible death.)

The point is moot, though, because if these forms of social environment are meant to equalize between participants than separating between the ‘old skool’ identities and the Yahoo identities for the newer folks is just another way of creating a false sense of elitism. With this switch, some of this is being swept away, and I wonder how much of this fooflah is because of this very thing?

It’s fascinating to read the threads–all those folks feeling betrayed because, according to one person in one of the threads:

Stewart, why are the oldskool members being treated like second class citizens on this issue, we are the community that made Yahoo buy you guys. Nothing like alienating your core supporters and cheerleaders. We are the bloggers, podcasters, videobloggers, and photographers that made the community. Your alienating the most vocal people on the internet. It’s going to be a shit storm of bad press for yahoo and Flickr tomorrow from the blogosphere, I promise you that.

All I can say is: When the frog farts in a pond in the forest, the cat in the city doesn’t smell it.

As I said earlier, there are legitimate concerns about this move: what are the Terms of Service differences between having a Filckr account as compared to one for Yahoo? People have had problems with Yahoo sign-ons, and other technologies, and the merge doesn’t sound like it’s well crafted: what kind of support is available to help folks with this move? What additional constraints will this move have on folks, other than having to have a separate account? Can the people use the same email addresses? Not to mention that it is really tough to find a unique user name with Yahoo: how about a Flickr specific namespace for identities?

In a way, Flickr’s sign-on merge into Yahoo may actually have a reverse effect, because Flickr’s customers tend not to be as geeky as Yahoo customers (yes, I know they’re the same, bare with me); this move might actually lead a trend into improving the overall Yahoo customer service interface. Or not, and people will quit Yahoo and Flickr both.

I have my old, old Yahoo account, which I’m now using with a Flickr free account specifically for development purposes. Flickr still has one of the better open web services, made better with the new ‘machine’ tags concept. I don’t post photos much anymore, and certainly not at a ‘social’ site, so perhaps my lack of concern doesn’t reflect the concerns of others. I am sympathetic to those who are concerned about issues of privacy, or who have had problems with Yahoo’s technology, or with the photo merge. I have no sympathy, though, for those who seem to be more concerned about losing their ‘old skool’ status, or worse, using this as an opportunity to shill for another company within the threads set up for the discussions.

Bottom line, though, is that I’ve never known Flickr to pull their punches, and if they say this is going to happen, this is going to happen. That’s one of the things I’ve always admired about Flickr: lack of smarmy marketing. What you see, is what you get.

SmugMug is offering 50% off for Flickr jumpees. There you go, Thomas Hawk.

Categories
Diversity Technology

A Matter of Language

When all things are equal, inequality reflects failure.

Virginia DeBolt responded to my earlier writing about technology education being broken with a post about Educating Women in Technology. She references two innovative programs: New Horizons, at Mills College in Oakland, California, which teaches computer technology to those with a non-technical background; and the University of Colorado’s Bachelor of Innovation degree.

Though I agree with Virginia that both programs are an excellent step in the right direction, they don’t address the fundamental issues that lead to what I consider crippled and ineffective computer science university programs. Take, for instance, the New Horizons project: it provides a way for people with a liberal arts bachelor’s degree to get a Masters degree in computer science. It’s open to both men and women, but unlike traditional computer science courses, there are many more women than men.

Much of the emphasis of the program is providing a less intimidating environment. Borrowing Virginia’s quote from a San Francisco Guardian article on the program:

Introductory CS classes at most universities “act like weeder courses,” scaring away all but the most confident students, [Mills computer science associate professor Ellen] Spertus says. Typically, up to half the students fail or drop out of introductory CS classes at other institutions. Spertus says this phenomenon hits women hardest because they may have less computer experience as well as less confidence…Spertus finds that many students going into her program suffer from low self-esteem — especially female students. She says they’ll be earning A’s in the program’s classes but will be convinced they’re not doing well and somehow “don’t belong.” Her teaching style, simultaneously rigorous and nurturing, helps change their opinion, she hopes.

I agree with the sense of ‘not belonging’ that many women experience in traditional computer science programs, but I disagree with Ellen Spertus that lack of confidence is a major deterrent to women in computer science. Women make up half, or more, of the students in several different extremely rigorous and/or competitive fields at many universities: including mathematics, medicine, law, most of the sciences, business, and others. Unless we think that computer science only attracts the less confidence, we should consider that there are other factors in play. These factors may lead to a growing lack of confidence, or may be perceived to be based on lack of confidence, but I would say that this is more an effect than a cause.

The New Horizons program is successful in that the many of the cultural issues associated with the field are eliminated, primarily because most of the students are women. Mills College is a college for women, and though this program is open to men, I would bet that most men would find it uncomfortable to get a degree, even a Master’s, from a college that is predominately a women’s college. As such, the program stays dominated by woman, and that’s one factor thats significantly different from other comp-sci programs. More importantly, the program also provides a very effective environment for women and men with families, jobs, and other non-academic priorities–something that wouldn’t be tolerated in most computer science programs. Actually, it wouldn’t be tolerated in most academic programs, which are, more or less, geared to the mindset of an 19 year old male from an affluent family.

(I also don’t know if I agree with the statement about computer science being a lucrative field, with globalization’s massive impact on this field.)

New Horizons is effective, but this approach is more of a bandage than a solution to a problem. We can’t continue the ‘separate but equal’ routine of dealing with the problem of astonishing lack of diversity in the computer field. Leaving aside culture as the only determiner–because after all if such is the sole criteria for women in college, than wouldn’t this also impact on women in law and women in medicine?–those components of computer science I consider especially broken have less to do with how the environment is managed, and more to do with the subject, itself.

Computer Science suffers from an early and inappropriate association with engineering, another field that tends to be massively male dominated. In fact the two fields, computer science and the different flavors of engineering, are always the departments in any college that have the fewest women students. Because of this early association, there’s a strong engineering bias built into the field of computer science: a bias that doesn’t necessarily make it a ‘better’ field, numerous books on the subject aside.

We assume this engineering connection makes the field of computer technology better. Why? Because the people in the field most successful are those more capable of adapting to the odd and pervasive cultural and linguistic biases inherent in engineering. Since the most successful people in the field are the ones most likely able to establish a pattern of what are ‘good’ or ‘bad’ computer science practices, an engineering bias (evidence of membership also demonstrating a gender and a cultural bias) has been interwoven into the field in such a way that it’s almost impossible to be able to view the practical application of computer technology separate and apart from engineering practices.

It is an inappropriate blending of fields; a coercion of the natural growth of computer technology. It’s like visiting a relative and wearing his or her clothes: they might seem to fit, but you’re never completely comfortable because you know the clothes are borrowed.

A good example of the engineering influence in computer science is the linguistic bias inherent in programming languages. Grace Hopper was the first to promote the concept of an English-like syntax when creating computer programs. Her work ultimately led to COBOL, which has been the butt of jokes and criticism since. One such criticism is that COBOL is excessively verbose. This is interesting when you compare it with the newer generation of languages popping up in the field just at a time when not only has the numbers of women not been increasing–our numbers have been shrinking. In particular if you follow a sequence from Perl to Python to Ruby, there’s one obvious trend: the language is losing its verbosity. Ruby is so stripped down to the barest minimum to support the programming constructs that you could almost write a complete weblogging tool in 20 lines or less.

This lack of verbosity makes for shorter programs, and less time to write such programs. However, the language is also incredibly cryptic.

Compare PHP or Java, which though not as verbose as COBOL are still ‘chatty’ compared to Python and Ruby. I’ve worked with a huge number of programming languages, over 23, yet I have found myself increasingly ‘alienated’ if that’s the word, from the languages in use today. In fact, one of my biggest criticism’s of Prototype, the Ajax/JavaScript library, is it’s use of Ruby constructs, and functions such as $(var), to access an element in the page.

Programming constructs such as this may strip away the ‘fat’ that English or other linquistic components add to other language variations, but at what price? I wrote someone once that when I first saw a ‘larger’ Ruby application (larger being relative), my first thought was: this is a language written by men for men.

A better way of saying this, though, is that this is a language that favors a certain mental bias; one that’s pervasive in engineering and that heavily influences computer science, both in an educational sense and in practice. It is a bias that favors a more mathematical, or perhaps spatially holistic would be a better term, view of an application over a more verbose, verbal view of the same.

Spatial over verbal: where have we heard that before?

We’ve all heard the results of controversial studies that report cognitive differences between women and men in two main areas: women have greater language skills, while men have more spatial acuity. Of course, many of these studies are flawed, with samplings too small to really understand what constitutes a ‘significant’ difference. It’s also difficult to strip out the environment; to deny that boys are more encouraged to indulge in solitary past-times such as taking apart the toaster or working on the car; while girls are encouraged to spend time, even hobby time, with their friends.

Regardless of whether there really is a gender bias when it comes to language and spatial reasoning, programming languages–from COBOL to C, from BASIC to C++, Java and PHP to Python and Ruby–do reflect a cognitive bias: either exhibiting a bias towards the verbal or a bias towards the spacial; a bias that can impact on how well a person uses the language, or more importantly, how comfortable they are with the language.

A better explanation of my initial perception of Ruby would be that it’s a language that’s biased towards those who favor the spatial over the verbal, and I’m most comfortable working with a language designed for those who favor the verbal over the spatial. Not to say I can’t learn Ruby or Python, and even grow to appreciate and like both. However, it’s like putting on my cousin’s pants: they might fit, but I’m never going to be as comfortable in them as my cousin.

The Wikipedia article associated with computer programming has an interesting remark:

Another ongoing debate is the extent to which the programming language used in writing programs affects the form that the final program takes. This debate is analogous to that surrounding the Sapir Whorf hypothesis in linguistics.

The quote has to do with linguistic determinism, whereby the language we use determines how we think. There’s disagreement on this, and studies supporting and studies refuting, but it is a fascinating subject. Made more so by extending it to the computer languages we use, and how they impact on the overall structure of a program. Again, are programs such as Agile arising because of the fact that our practice of technology is skewed to a specific bias, not to mention personality?

Perhaps we’ll find that object-oriented development is really an outgrowth of a bias toward the spatial over the verbal, and that we’ve managed to create an entire field that consists of one gigantic human filter. We don’t know, because we’ve never thought to challenge the disparity in the computer science field based on the development of the subject, not just the environment.

That’s why I say the computer science field is broken, and rather than focus purely on environment or culture, we need to examine the myriad ways in which it is broken, recognize each, and find solutions: we can’t depend on providing ‘warm nurturing environments’ as being the end all, be all solution for every problem.

For instance, if the computer science programs were split up in universities, with computer technology incorporated into other fields such as philosophy, library science, psychology, math and so on, we might find that each field ends up with its own programming languages–like a suit of clothes custom made for fit and comfort, compared to buying off the rack or worse, borrowing from our cousin, who has the worst taste. The Bachelor’s of Innovation somewhat reflects this, but again that’s seen more as an interdisciplinary field than realizing that computer technology is a part of lives, is a tool, and how we teach it should reflect this.

Categories
JavaScript

Progressive Enhancement

The book title, Adding Ajax, should be synonymous with the concept of progressive enhancement in Ajax development, and I’ve gone through the earlier chapters and adjusted accordingly.

Progressive enhancement (or should that be Progressive Enhancement?) is the philosophy that you create web pages that don’t require any scripting at all, first; then add scripting effects in such a way that each degrades gracefully and doesn’t impact on the accessibility of the page.

Most web development should use progressive enhancement, because most sites aren’t creating Word in a web page, or yet another spreadsheet. Most web sites are providing information, stores, how-tos, whatever that aren’t dependent on scripting. The scripting is an enhancement.

Starting with the script and then adding accessibility comes off as clumsy. Starting with the basic application and adding scripting and Ajax effects is a much more elegant approach.

The one last step in all of this is how to make dynamic web page changes apparent to screen readers. Juicy Studio has documented approaches with JAWS, first in Making Ajax Work with Screen Readers and recently with Improving Ajax Applications for JAWS Users.

Categories
Technology Weblogging

Ella sings the Blues

WordPress 2.1 is code-named “Ella” after Ella Fitzgerald. Well, if that’s so, then Ella is singing the blues.

In the next couple of weeks, I planned on upgrading all of my weblogs to the new version. I’m also moving the few people who had tried out Wordform to WordPress 2.1, so they’re using a supported weblogging tool. However, I read in Mark Pilgrim’s weblog this morning that WordPress 2.1 still does not have a valid Atom 1.0 feed, I thought to myself, “No, that can’t possibly be. After all the work people did to create a patch? After all the promises of a valid Atom feed since version 1.6?”

It’s true, though. I downloaded the installation this AM and there it is: Atom 0.3.

There’s nothing like syndication to bring out the schoolyard in supposedly reasonable adults. I don’t think even the “vi versus emacs” wars compare.

I’m still porting all the weblogs to WordPress 2.1. I’ll be installing the Atom 0.3 feed on the ported Wordform weblogs, because I don’t want to put non-standard files on other people’s sites. However, I’m using my own edited Atom 1.0 feed for my sites. It works, but I do tire of having to have a backup of this so it’s not overwritten with every bug and design release.

Do I appreciate having this software? You bet. Do I appreciate the team working on it? You bet. But continuing to release an invalid feed syntax sounds a sour note, and the Ella I know and adore would never sing off-key.

update

Joe Gregorio on the phantom Atom 1.0 release.