rc3.org

Strong opinions, weakly held

Author: Rafe (page 60 of 989)

Paul Buchheit on living life

I didn’t link to the original “tiger mom” story that was published in the Wall Street Journal because I’m not a parent and I don’t know a whole lot about parenting. Besides, people who criticize other people’s parenting styles are jerks. (If you missed the original article, it’s here.)

Today I read Paul Buchheit’s response, which discusses intrinsic versus extrinsic motivation contains a lot of wisdom. You can’t beat his basic approach to life:

My strategy can be reduced to two rules: 1) Find a way to make it fun and 2) If that fails, find a way to do something else.

And this hit home for me, as I’m sure it does for many people:

One of the problems I’ve faced throughout life is that I’m kind of lazy, or maybe I lack will power or discipline or something. Either way, it’s very difficult for me to do anything that I don’t feel like doing.

I think that a life full of things you feel like doing is a pretty good life. Oddly enough, for me they don’t necessarily have to be fun as long as they enable to attain a goal that is genuinely important to me.

Is Google a copy cat?

Over at O’Reilly, Mark Sigal makes a provocative argument about Google:

All of this is, of course, very funny because isn’t Google’s whole business model about imitating, co-opting and commoditizing?

I don’t agree with him that the kind of copying Bing is engaging in is fundamentally different than the kind of copying Google does. Google strikes me as a market follower — they bring the Google sensibility to paths that others have blazed. In this case, Microsoft is engaging in rank plagiarism.

What introverts get out of social games

Game researcher Jane McGonigal explains how introverts benefit from playing social games:

With introverts, their dopamine systems tend to work more with internal thought than with external, social stimulation. Whereas with extroverts, they have the dopamine receptors going off when someone smiles at them; for them, it’s like a hit of candy or crack cocaine, you know? And for introverts, that’s not happening.

But when we’re in game world, we do get motivated. We do get these dopamine hits from the game itself. When we’re getting them around other people, it can kind of shift our neurochemistry.

The whole interview is really interesting.

Mark Bittman’s food manifesto

Mark Bittman has a list of food-related political reforms that would improve Americans’ diets and be good for the environment. Here’s how he introduces them:

… we’ve come to recognize that our diet is unhealthful and unsafe. Many food production workers labor in difficult, even deplorable, conditions, and animals are produced as if they were widgets. It would be hard to devise a more wasteful, damaging, unsustainable system.

It’s unlikely that any of them will be enacted, but it’s nice to dream.

Java coding style, accessor methods, and IDEs

Last week I was asked to answer a question about our code base and wound up with the wrong answer for what I think are interesting reasons. Thus, a few thoughts on the power of IDEs, the importance of coding standards, and a problem with the way Java handles accessor methods.

The application I work on queries an external datasource and then does stuff with the incoming data to provide a variety of results. I often get questions about how, exactly, we’re using that external data to make decisions. The incoming data is copied into Java classes which are persisted in the database using Hibernate.

My usual approach to answering these types of questions is to open Eclipse, find the appropriate accessor method for the value in question, and then use the fantastic “Find References” function to locate all the places in our code where we use that value. (It’s Command-Shift-G on your keyboard if you’re a Mac user.) If someone asked where a certain value originates, I start by pulling up all of the references to to the setter method. If someone asks how the value is being used, I find all of the references to the getter. Sometimes the sleuthing involves navigating through the code by finding a method that calls an accessor, then finding all the places that method is called, and so on.

For all of the hassle associated with building Java applications, the power of Java IDEs almost makes it worth it. I find it easy to be productive using TextMate to work on Ruby on Rails applications, but I always miss features like “Find References” and “Open Declaration” that are found in Eclipse. Eclipse, IntelliJ IDEA, and other Java IDEs build a semantic model of Java code that makes it very easy to manage your code that aren’t available when using other languages and editors. Any developer who’s avoided a bug because their IDE told them a local variable is never referenced anywhere knows exactly what I’m talking about.

Anyway, I had trouble figuring out how our code worked because I was investigating a feature written by another developer. The get method in question didn’t have any usages in our code base, and I assumed that while the value was being stored in the database, it was not incorporated into our business logic. I was asked to look again, and deeper inspection revealed that the member variable associated with the accessor I was searching for was accessed directly in other methods in its class.

When people talk about coding standards, this sort of thing is a bigger deal than bracket placement or tab size. My habit is to always use accessor methods if they’re available, whereas this other developer’s habit was to use the instance variables within the class. It’s probably better to do it one way or the other, or at least to have a clear understanding of why you might use one or the other in a given situation. The fact that we didn’t cost us a little wasted time, and could have been worse had I not reinvestigated and made sure that things were working as expected and not the way I thought they were.

This also underscores a drawback of the way Java handles accessor methods. Because accessors are regular methods, there are no easy ways to pull up all of the references to a particular variable that includes both references to the instance variable and to the accessors. It seems like Ruby accessors would lend themselves better to a more consistent approach. I’d also be curious to know whether the accessor implementation in C# leads to better tools.

The role of the federal government

What’s the role of the federal government? Here’s one answer, courtesy of Matt Yglesias:

One of the main things the federal government does is transfer resources from high-productivity urban areas to low-productivity rural ones.

In principle, I don’t have a huge problem with this. However, I do have a problem with the fact that the people in the more subsidized areas fail to understand that this is how things work, and indeed consider themselves to be exploited by the federal government rather than exploiting it.

Mainly, I just appreciated reading that sentence. I had never really thought of things that way.

How did Egypt drop off the Internet?

BGPmon.net looks at Egypt leaving the Internet. There was some speculation as to whether the government of Egypt had some sort of central kill switch they could use to shut down the Internet, but it appears as though the ISPs are shutting down individually at the request of the government.

Building distributable Web applications

My current project involves building a commercial Java Web application. For years I’ve built Web applications (using Java and a number of other platforms) to deploy on our own servers. Building something that’s suitable for distribution is a horse of a different color. I thought I’d write up my experiences for other people who are taking on similar tasks.

  • Distribution format – Usually Java applications are distributed as WAR or EAR files, but many people also package their Java Web applications with a servlet container to run them to make things easier.
  • Open source licenses – My application uses a number of open source libraries, and I had to go through and make sure that all of the libraries were distributable without much fuss.
  • Configuration – What’s the best way to set up database connections and other configuration parameters?
  • Deployment platform – In theory, Java Web applications should work with any servlet container, but the devil is always in the details. Many Java applications seem to be distributed with a servlet container as well. What’s the best approach?

Look for separate posts dealing with each of those issues.

I’m sure other considerations will arise as well, but those are the first few that have cropped up as I’ve started working on this.

Embarking on this process makes it clear why PHP has become the dominant platform for writing distributable Web applications. Regardless of its strengths and weaknesses as a development platform, its deployment story is hard to beat.

There are no real questions when it comes to distribution format. You archive the files and put them up for download. The end user downloads the archive, expands it, and puts the files in the directory where they want the application to appear.

As far as licenses go, many PHP applications have no external dependencies. PHP provides all of the functionality you need for most applications, and PHP developers have never really taken to using libraries to make things easier. Java developers tend to use tons of third party libraries, and Ruby on Rails applications often depend on dozens of Gems. PHP developers use what’s available as part of PHP and that’s it. PEAR is out there, but it isn’t terribly popular. I assume that’s because so many PHP applications are deployed on shared hosting. It’s just not worth the risk to bring in dependencies if you don’t have to.

Configuring a PHP application usually involves editing one heavily commented PHP file. Most people consider that to be inelegant, but it’s hard to argue with the simplicity.

PHP is ubiquitous, so there’s not much to worry about in terms of deployment. You just need Apache with PHP support.

When you look at those factors as compared to Java or Ruby, it’s easy to see why PHP maintains its massive popularity over other development platforms, and why we see explosive growth among applications built using PHP, like Drupal, WordPress, and MediaWiki. For all its drawbacks, PHP has evolved in a world where simple deployment and configuration are both hugely important, and that has given PHP some powerful advantages that other platforms aren’t even trying to compete with.

Keep your eye on the scoreboard

Lately I’ve taken to playing Words With Friends, a Scrabble game for the iPhone. One of the first things I learned from playing against good players is that Scrabble is not about showing off your good vocabulary, it’s about turning the tiles you draw into points. A two letter word that nets you 31 points because you dropped a Q onto a triple letter score to make the used-only-in-Scrabble word “QI” is better than busting out a 6 letter word nobody’s ever heard of that nets 18 points.

I thought about that when I read Rands’ interview with Marco Arment about Instapaper, and being a one-man software development shop. Here’s what Arment says about making it as a sole proprietor:

The biggest design decision I’ve made is more of a continuous philosophy: do as few extremely time-consuming features as possible. As a result, Instapaper is a collection of a bunch of very easy things and only a handful of semi-hard things.

This philosophy sounds simple, but it isn’t: geeks like us are always tempted to implement very complex, never-ending features because they’re academically or algorithmically interesting, or because they can add massive value if done well, such as speech or handwriting recognition, recommendation engines, or natural-language processing.

Both are nice reminders that efficiency is one of the keys to success.

Be sure to read the explanation of how the Instapaper bookmarklet works, as well. It’s a marvel.

RIP, Charlie Louvin

Satan Is Real - The Louvin Brothers

Emmylou Harris on the Louvin Brothers:

I’d always loved the Everly Brothers, but there was something scary and washed in the blood about the sound of the Louvin Brothers.

From the New York Times obituary for Charlie Louvin. I strongly recommend Louvin’s self-titled album released in 2007. His tribute to his brother Ira, who died in 1965, is particularly moving.

Older posts Newer posts

© 2024 rc3.org

Theme by Anders NorenUp ↑