Categories
Books Technology

Node’s the thing

I just finished my fourth chapter for my newest book for O’Reilly. I never feel a book is solid and real until the fourth chapter. By the fourth chapter, you have a book, not just an idea or outline.

My newest work is titled “Learning Node”, about Node, or Node.js for the purists among you. It’s a good fit with my other JavaScript books, and is focused on an interesting and rather fun technology.

I wasn’t sure about Node when it first came out. My very first JavaScript gig wasn’t client-side development, it was a server application for a company in Portland, Oregon. I can’t remember the name of the company, or even what the application was about (I have done a lot of contract work in the last 25 years) but I remember working with a contractor from Vietnam who is one of the nicest people I have ever worked with.

I also remember that server-side development with JavaScript died quickly, and there went another skill down the toilet. So when Node came around, I didn’t embrace it as profoundly as many people did.

In time, though, Node won me over. I like it—not in the giddy, bubbling-over-with-enthusiasm embrace I may have felt about server-side JavaScript (and Java, and EJB, and the earlier Cloud computing, and DHTML), but I like it. I think it’s useful. I think it is a very solid technology.

What won me over to Node? The fact that it’s based in JavaScript helped. I’m not going to join the effete in condemning JavaScript, because I like JavaScript. I think Dart is dead on arrival, and JavaScript is only going to get better over time. However, there’s also CoffeeScript for those who just can’t embrace JavaScript.

I like that we don’t have to worry about working with threads, that modules are the norm, and that Node doesn’t pretend to be the definitive solution for every problem. I also like the community support and how uncomplicated it is to create complicated applications. I don’t want to use “easy”, but Node doesn’t demand that the developer jump through an extraordinary number of loops to get a job done. For all the new geewhiz quality about Node, it’s a very pragmatic technology.

Node is also mature enough to last—no lost skills with it. The very fact that the creator of Node, Ryan Dahl, decided to step down as gatekeeper for Node, and his decision didn’t cause any earthquakes in the Node community, attests to the maturity of both the technology and the community.

The HTML5 community could learn a lot from the Node community in this regard.

If there’s a problem with Node is that many of the those who work with Node come from a Ruby/Rails/Extreme Programming background, and many of the concepts and explanations about Node reflect assumptions that can actually form a barrier to understanding. In some ways, Node can present itself as more complex than it really is, primarily because much of the terminology reflects a background that not everyone shares.

Another problem is that documentation is an interesting mix of the nonexistent, cryptic, and/or flippant—none of which is generally helpful. Then there’s the oddly peculiar “Node web style”, with web sites in dark gray backgrounds with pale gray writing, (or white background with pale tan/green/gray writing) where the only way you can see the text is by turning up the brightness of your monitor until your head hurts.

Still, times are a changing. Cloud9’s new new Node Manual web site is a solid start in the right direction, and I have high hopes for the official Node.js site, too.

Then there’s my book, which I’m sure you’ll want—if for no other reason in that it’s a nice break from me bitching about HTML5.

Categories
Browsers

Firefox: Continuous scrolling and continuous freezing

This morning I logged into Twitter, opened my HTML5 list, and started scrolling down the page to see what new outrage/toy/publication/conference was generating excitement today. Of course, I use “page” loosely, since Twitter uses the “continuous scrolling” technique to retrieve and display older tweets. You never actually get to the end of the page, you just keep getting more tweets.

I dislike the “continuous scrolling” technique with a passion that I usually reserve for governors who harass teenagers who tweet. Many times I have scrolled to an interesting looking tweet, which is suddenly moved out of view because of an awkwardly done “page” update that pushes the previously scrolled tweets out of view. The same happens, though not as abruptly, with Facebook and Google+—a less than clever use of technology to replace what the developers seem to think is beyond their users: to click the damn “More” link.

Worse than losing that tweet that piques my interest, though, is that lately when I’m using Firefox to scroll down the page of updates, the browser freezes up. At times, it can seem to unfreeze itself if I just patiently wait for it to deal with whatever internal upset it’s currently dealing with. Other times, I’ve had to kill the browser.

In the past few weeks, though, I’ve had Firefox freeze up to the point where I couldn’t use my Windows 7 system. I can’t bring up the task manager to kill Firefox. I don’t get any response from any key combination. The only recourse I’ve had in these circumstances is to hard boot my system.

Hard booting a system is not a good idea, and it’s one I shouldn’t have to be taking. However, when your system is frozen and your laptop fan is whirring like mad, you take desperate measures. Desperate measures that came close to losing my system today.

I hard booted up my less than one year old Toshiba laptop after a Firefox/Twitter freeze this morning, except that rather than the Windows prompt asking me if I wanted to start Windows in Safe Mode, I got the ominous message that the system could not find my hard drive. I tried again in a couple of minutes, but received the same message. Waiting a short time later, I was able to get to the Windows restore/repair dialog, and tried an automatic repair. This seemingly failed, and I was faced with having to restore my system using the Toshiba recovery program, which basically overwrites your disc with a brand new installation of Windows.

Before taking such a drastic step, I tried to restart my system one more time, and this time, success!

Right now, I’m backing up all of my writing research folders to my internet site, and various other files to external USB drives. I’m also using Google Chrome to write this, because, frankly, I’m wary of using Firefox for anything at this point.

It is not the browser company’s fault that web sites use JavaScript to create some chi-chi clever effect that taxes the browser’s resources, and that most of us don’t really need, and didn’t really ask for. However, it is the browser company’s fault when it can’t deal with whatever good or bad JavaScript it encounters. No browser should allow any JavaScript to freeze the application up so badly that it has to be forcibly closed. And no browser should ever be so badly coded that it can literally crash the OS.

The only extensions I use with Firefox are Firebug, AdBlocks, and Web Developer Toolkit. I suppose one of these three could be to blame for the freezing problem, but it’s the responsibility of the browser company to ensure that its extension environment is solid so that an extension can’t cause these kinds of serious problems.

Whatever happened to my favorite Firefox of bygone years? Whatever happened to the rock solid but still innovative browser I once depended on? In its desperation to beat out Chrome and it’s aggressively pushed schedule to release new browser versions seemingly every few weeks, Firefox has become increasingly erratic and unstable. I could live with the mouse cursor landing in the web page just below a form field when tabbing (and having to click on the field to realign), but I can’t live with the freezing and crashing.

After all these years, I’m going to have to switch to another browser. Right now, I’m typing this post using Chrome, but I’m not overfond of Chrome. It’s not a bad browser, but the same issue with Firefox also applies to Chrome: aggressive release schedules and seeming indifference to stability. (“Stability? We don’t need no stinken stability!”) Apple’s support for Safari on Windows seems tepid, at best, which leaves Microsoft IE and Opera. The newer versions of IE are actually fine products, and Opera seems to have found the right point between implementing the latest gewgaw and delivering a stable product—but dammit, I’m used to Firefox.

Categories
Photography Technology

Rent not to own

Recovered from the Wayback Machine.

I have used Photoshop for years. I tried to use GIMP and UFRaw, and these are wonderful tools, but I’m comfortable with Photoshop. I like Photoshop.

Unfortunately, when I recycled my last Apple computer, I also lost my last copy of Photoshop. It was an older version, but still had what I needed. I looked at buying a few new version of Photoshop for my Windows 7 laptop, but the price of a new copy of Photoshop is beyond my means. And I don’t steal software, that’s not my thing.

Fortuitously for me, Adobe came out with a new way of acquiring Photoshop: instead of buying the application, rent it instead.

For a fixed monthly cost, you can rent a copy of Photoshop (or other high end Adobe product). How much the cost is, is dependent for how long you rent it. If you rent the application month-to-month, the cost is higher. If you rent it annually, the cost can drop a substantial amount.

The subscription plan is not the most economical way of accessing the software. The subscription cost is more expensive than just buying the software and the upgrades. However, for those organizations (or people) who just need a license for a temporary period of time, or people like me who don’t happen to have several hundred dollars lying around for a software purchase, the subscription plan does provide another option.

I signed up for a subscription for Photoshop and once a month, Adobe takes a bite out of my bank account. Hopefully, eventually I’ll have the income to buy the software outright. Or I’ll learn to live with GIMP. For now, though, the subscription does work for me.

Adobe isn’t the only “rent not to own” game in town: Amazon is getting into the rental business with Kindle books. I discovered the option when looking at a high priced book on zoos and animal rights (high, as in $108.00), Amazon is especially touting this option for textbooks, such as Sensation and Perception, 8th Edition, which sells for $116.76, but can be rented for $43.61 (and up, depending on how long you keep the book).

This is all old hat for O’Reilly, my book publisher for the last several years. The company provides access to many (if not most) of its books through Safari Online—a subscription based book site. The difference, though, is that you can download Photoshop or a Kindle rental book to your device(s) and access them offline. As far as I know, you have to access Safari Online, well, online. You can access the books through a mobile device, but you still have to be online. So Safari Online is less a case of renting the book, and more subscribing to a service. With Amazon, you’re literally renting the book.

The concept of “rent not to own” has its advantages: you don’t have to buy something you only need for a limited time, have to have the cash upfront, or charge the cost of the products to a credit card (which you most likely won’t pay off, anyway). The cost is fixed, and you know the price (and conditions) before you sign up. If your finances are erratic, you can rent month to month. Best of all, by not charging, you’re not giving interest to the bloodsucking banks.

Categories
Specs Technology

Why read about it when you can play

Earlier today I got into a friendly discussion and debate on Twitter about a new web site called W3Fools. The site bills itself as a “W3Schools intervention”, and the purpose is to wake developers up to the fact that W3School tutorials can, and do, have errors.

The problem with a site like W3Fools, I said (using shorter words, or course, since this was Twitter), is that it focuses too much on the negative aspects of W3Schools, without providing a viable alternative.

But, they said, W3Fools does provide links to other sites that provide information on HTML, CSS, or JavaScript. And, I was also told, the reason W3Schools shows up first in search results is because of uncanny use of SEO optimization.

Hmmm.

It may be true that W3Schools makes excellent use of SEO, and it may be equally true that W3Schools commits egregious and painful errors. However, neither of these account for what W3Schools is doing right. If you don’t acknowledge what the site does well, you’re not going to make much headway into turning people off the site—no matter how many cleverly named sites you create.

For instance, one of the superior information sites recommended by W3Fools is the Mozilla Doc Center, or MDC as it is affectionately known. Now, I’m a big fan of MDC. I use it all the time, especially when I want to get a better idea of what Firefox supports. But look at the work you have to put in to learn about a new HTML5 element, such as the new HTML5 hgroup element:

  1. Go to main page
  2. Click on HTML5 link
  3. Search through the topics until you see one that’s titled “Sections and outlines in HTML5”, which you know you want because it mentions hgroup
  4. Have a neuron fire and realize that you can just click directly on hgroup
  5. Go to the hgroup page, past the disclaimer about what version of Firefox supports the element, looking for an example of usage
  6. Realize there is no example of how to use hgroup
  7. Go to the original Sections and Outlines in HTML5 link
  8. Go past some stuff about elephants, looking for example
  9. Go past some bullets about why all this new sectioning stuff is cool, looking for an example
  10. Break down and use your in-page search to find hgroup
  11. Finally find an example of how to use hgroup

As compared to W3Schools:

  1. Go to main page
  2. Click on Learn HTML5 link
  3. Click on New Elements link
  4. Start to scroll down when you realize the new elements are listed along the left side
  5. Click on hgroup
  6. Look at example

One thing W3Schools does well is provide a clean, simple to navigate interface that makes it very easy to find exactly what you need with a minimum of scrolling or searching.

Returning to our comparison between W3Schools and MDC, we then search for information on SQL. Oh, wait a sec: there isn’t anything on SQL at the Mozilla site. That’s because Mozilla is primarily a browser company and is only interested in documenting browser stuff.

So then our intrepid explorer must find another site, this one providing information on SQL. And if they want to learn more about PHP, they have to find yet another site. To learn about ASP? Another site, and so on.

What W3Schools also provides is one-stop shopping for the web developer. Once you’ve become familiar with the interface, and once the site has proved helpful, you’re more likely to return when you need additional information. Let’s face it: wouldn’t you rather use one site than dozens?

Screenshot of W3Schools page showing many of the topics

Let’s say, though, that you need information on CSS3. Well, you know that MDC covers CSS, so you return to the MDC site, and you click on the link that’s labeled “CSS”, and you look for something that says CSS3.

What do you mean there isn’t anything that says CSS3? What do you mean that transitions are CSS3—how am I, a CSS3 neophyte, supposed to know this?

Returning to W3Schools, I click the link in the main page that is labeled CSS3. Oh look, in the page that opens, there’s a sidebar link that’s labeled “CSS3 transitions”. And when I click that link, a page opens that provides an immediate example of using CSS3 transitions that I can try, as well as an easy to read a table of browser support.

Screenshot of W3Schools CSS3 transitions page

W3Schools doesn’t throw a lot of text before the examples, primarily because we learn web material best by example. Remember that an entire generation of web developers grew up with “View Source” as our primary learning tool.

But so far, I’ve only compared W3Schools to MDC. There are other useful sites that the W3Fools site approves. So I try the “Google: HTML, CSS, and JavaScript from the ground up” web page. When it opens, I click the link labeled CSS…

And I get a video about using CSS.

A video.

Remember in junior high or high school, when your science teacher would bring out the projector and you knew you were going to get a video? Do you remember that feeling that came over you? How you kind of relaxed, because you know the teacher wasn’t going to ask you any questions, and you didn’t have to write any notes, or even really pay attention?

I bet some of you even fell asleep during the video.

Videos are good for specific types of demonstrations—when something is complex, with many different steps, and the order of the steps and other factors have to be just so.

When it comes to CSS, HTML, and so many other web technologies, though, video is about the most passive and non-interactive learning experience there is. More importantly, if the video doesn’t have captioning, and most don’t, you’re also leaving part of your audience behind.

Now let’s return to the W3Schools site, this time looking at one of the CSS selector tutorials. The first thing you notice is that right below the example there’s a button, labeled “Try it Yourself”.

W3Schools screenshot showing the Try It button

Why read about it, when you can play?

One of the more annoying aspects of trying to learn about a specific HTML element, or a bit of CSS, is that you have to create an entire web page just to try it out. What W3Schools provides is that all important, absolutely essential, one button click to Try it out.

I’m not defending W3Schools. The site has played off the W3C title, though that doesn’t have a lot of meaning nowadays. More importantly, some of the material has errors and the site is resistant to correcting any of these errors, and this is unconscionable.

But you aren’t going to dent the popularity of the site without at least understanding why it is so popular. The W3Schools’ site is not popular because of SEO, and it’s not popular because of the W3 part of the name.

The W3Schools website is so popular because it is so usable.

Categories
Specs Web

Google’s Ta Da moments

Recovered from the Wayback Machine.

Henri Bergius wrote a piece on Google’s seeming desire to replace all web components, except HTML. Among the “new” technologies:

  • SPDY to replace HTTP
  • schema.org and Microdata to replace a decade’s worth of semantic work with RDF and microformats
  • WebP, a new image format
  • WebM, a new video format
  • And now Dart, to replace JavaScript

However, I wouldn’t leave HTML out. The only editor for HTML5 is a Google employee, Ian Hickson, who has been working with other folks, including another Google employee, to break pieces off the HTML5 specification, take them to WHATWG space, and completely re-write them in isolation. Then, when the pieces are re-written, the editors don’t seem want to bring them back to the W3C. (Or they have to ask Google Legal whether they can do so, completely ignoring the fact that as a W3C member, Google pledged to work with others.)

I’ve been battling this effort with the Editing API and just recently, the same thing happened with the section on dynamic markup insertion.

It’s not that people aren’t happy about these non-HTML components being pulled out of the HTML5 specification, but rather than work with the members of the HTML WG and the W3C, Google has been encouraging people to act unilaterally, aided and abetted by the HTML5 editor.

What’s ironic is that the concepts behind the Editing API and the dynamic markup insertion sections, which includes innerHTML among other things, actually originated with Microsoft. I’ve been waiting for Microsoft to go, “Hold on partner!” Apple already has. (And again).

Google has become all that is arrogant conceit. It believes it can do anything better than anyone else. It has dropped any pretense of seemingly wanting to work with others, and pretends its work is open, as long as it “gives” it all away when it’s finished.

The internet and the web were created so that people could connect; that those who were separated physically could still work together. The roots of the web are based in openness and cooperation, not unilateral decisions that demonstrate little tolerance and no empathy. I’d rather use an imperfect technology created by a team of varied and interested people, then a “perfect” work created in isolation and dumped on the world in some grand “Ta Da!” moment.

An imperfect technology can be perfected, but you can’t fix hubris.