rc3.org

Strong opinions, weakly held

Month: March 2005 (page 1 of 7)

Just so you know

The United States is about to advanced fighter planes capable of carrying a nuclear payload to Pakistan. It’s OK, though, because the plan is to sell something even better to India. Sleep well.

The WordPress PageRank scam

Andy Baio has written an article on some unsavory practices on the part of the WordPress developers. Basically they’re selling the PageRank they have accumulated from all those “Powered by WordPress” buttons on blogs to a company that churns out junk articles on topics that garner high-cost ads.

Update: Not only is WordPress publishing bogus articles on their site, they also provided hidden links to them on their home page using a CSS “cloaking” technique so that spiders see them but humans do not. The sleaze factor increases.

Udell on del.irio.us

Jon Udell has a fair and balanced take on the del.irio.us project.

I was a bit too harsh yesterday. I think that if the project remains a clone of del.icio.us, I won’t view it too favorably, especially considering that the creator could have distributed the code without launching a competing site. But if it evolves to offer features del.icio.us doesn’t and both of them improve as a result, so much the better.

On a different note, Simon Willison explains how Jon Udell can solve one of the problems he mentions in the blog entry using Greasemonkey.

Free programming tip

Let’s say you’re writing a method or a function that returns a boolean value (true or false). My usual way of writing these things is to write a default return statement at the bottom so the code will compile. So say I’m writing a method called thisWorks(). It will be full of code conditional statements that test whether “this” doesn’t work, each of which returns false if that’s the case. If none of the conditions are true, at the end we get to a bare return true. I think this leads to bugs, and that the safer approach is to always end the method with a conditional statement, not a bare return statement. So your method ends with:

if (lastTestFailed) {
return false;
}
else {
return true;
}

It seems to me that making such a rule prevents you from failing to return something when you should and falling through to the default return value. I’ve been burned by that a few times lately. What this says about using languages that simply return the value of the last expression encountered absent an explicit return statement, I don’t know.

Update: I’ve heard from several people that this is not a comprehensive solution to the problem that I described, which is unfortunately true. It solves one class of problem where you write a new method with a return statement at the end and then add in some conditionals, but if you insert other conditional statements prior to the conditional statement that I bothered to type out above, you can introduce bugs of exactly the type that I’d like to avoid. Perhaps there’s some way to write these methods that avoids these problems, but it looks like once again the safest solution is to write comprehensive unit tests.

Apple’s lawsuits against rumor sites

Yesterday I endorsed Tim Bray’s criticism of Apple on the basis of its lack of transparency (and willingness to litigate to keep its secrets secret).

I realized today that if I’m going to accept the proposition that Apple is behaving badly in this case, I should do more reading to familiarize myself with the details. Here’s a Macworld analysis of the cases Apple is litigating right now. It’s a good starting point.

Apple malfeasance

Tim Bray nails the problem when it comes to Apple — great hardware, great software, lousy attitude. (Well, he also pings them for having dated hardware, which is another fair criticism.)

There’s something about Google

Here’s something interesting that I didn’t know about Google:

There is, by and large, only one code base at Google. This has many advantages. Most obvious is that it is really easy to look at and contribute to code in other projects without having to talk to anyone, get special permissions or fill out forms in triplicate. That is just the tip of the iceberg, though. Having one codebase means that there is a very high degree of code sharing. Need to base 64 encode/decode something? No problem, there is a standard Google routine for that. Found a bug? Just fix it and check it in after getting it code reviewed by a documented owner. One of the reasons that environments like Perl, Python, C#, Java, etc. flourish is that they have large and well through out libraries of useful code. For a variety of reasons, C++ has never had this. (I could theorize but that would be off topic.) Google has solved this problem by building up a large library of well documented and easy to integrate code. This not only lowers the bar for new projects but makes it easy to switch projects as you don’t have to learn new conventions.

This explains why Google has been hiring so many programming all-stars, and why those people want to work there in the first place. If you know that the brilliant things you design at the library level will be integrated into projects all over the company, it’s a pretty powerful incentive to come on board.

Stealing something good

Stephen O’Grady takes a look at Steve Mallett’s clone of Joshua Schachter’s del.icio.us social bookmarking service. As far as I’m concerned, copying the concept, functionality, and even URL of the site is pathetically lame, whatever your motivation.

Update: in other news, Joshua has quit his job and is working on del.icio.us full time. Perhaps getting the inbox to work reliably is a full time job …

Another number that astounds

Every once in awhile, I read something mentioned in passing that just blows me away. Did you know that in some public schools, sixth graders only have math class three days a week? So reports James Robertson. I honestly don’t know what to make of that, other than it seems like a dreadful shame. (And I say that as someone who never enjoyed or excelled in his math classes.)

Why Web Programming Matters Most

Ian Bicking has written a piece arguing that Python advocates entitled Why Web Programming Matters Most. His argument is that making Python better for Web programmers is the single most important thing they can do to market Python, and as a Python dabbler, I find it difficult to disagree.

I come at this argument as a Java developer with extensive Perl and limited PHP experience. I want the speed of development I can get with Perl and PHP but the object-oriented focus of Java, and the two number one choices out there in terms of languages are Python and Ruby. I’ve dabbled with Python for years, but I have never jumped into it with both feet. And now I’ve gone out and bought a book on Ruby and plan on implementing a Ruby-based weblog application. I have no idea whether Ruby is a better language than Python (both have some really neat constructs, Python strikes me as a bit cleaner). What I do know is that there’s a Ruby story out there for people like me, and it’s called Ruby on Rails. If I go to Google and ask, “What’s the best approach for writing a CRUD application in Python?” how long will it take me to find an answer?

Maybe there’s a great alternative to Ruby on Rails in the Python world, but I don’t know what it is. Ruby on Rails is winning the hype war, and the fact that it wins the technical battles is taken on faith.

Older posts

© 2024 rc3.org

Theme by Anders NorenUp ↑