Eric F. Savage

Good stuff, updated weekly(ish)

Archive for October, 2007

Rookie of the Year 2007

Friday, October 5th, 2007

Picking a Rookie of the Year is probably the most subjective of the big baseball awards. Evaluating a player on such a small sample size is anathema to sabermetricians, and hype can help or hurt the impression a player makes on his new fans. To me, the best rookies not only perform well, they show potential. The guy who comes up and has more HR than BB doesn’t really impress me (though sometimes that’s all you have), the guy that fields well and has clutch hits or pitches and still manages to put together decent numbers are the real future stars.

National League RoY: Troy Tulowitzki. Between Ryan Braun and Tulowitzki, I have to Tulowitzki the edge, but I didn’t really get a chance to see either of these guys play. Based on what I’ve read and what little I’ve seen, Tulowitzki is a talented shortstop who can hit and Braun is a clumsy third baseman who can really hit. Braun pretty much beats Tulowitzki hands down in terms of production, but I don’t trust power numbers from rookies (will he be a McGwire or a Maas?) as much as I do fielding and discipline, so Tulowitzki gets it.

American League RoY: Dustin Pedroia. Sox fans have been hearing about Pedroia since he was drafted, but always with caveats like “maybe he’s too small” or veiled warnings like “he plays with heart”. He came up early in the season and basically stunk up the joint, but his manager had faith, and eventually something clicked. Pedroia turned into a hitting machine, fielded like veteran, and always seemed to be fired up. I think the sox have a solid .300+ hitter for a few years, probably settling into the #2 spot if Ellsbury’s power is low enough that he becomes the leadoff. Runner Up: Daisuke Matsuzaka*

*I love the fact that the baseball market is going global, but something just doesn’t feel right about experienced players winning Rookie of the Year. Can you imagine Manny Ramirez going to play in Jpan and being considered a rookie? Even if I didn’t feel this way I still wouldn’t have given Dice-K the nod over Pedroia.

Generics: All or nothing?

Thursday, October 4th, 2007

I am a big fan of strong typing, so when Java 5 added support for generics, I started using them heavily. I don’t agree that that they “clean up” your code, because I see as many or more instances of type parameters, <Class>, as I used to see type casts, (Class). However, they do make code easier to read and follow.

I’ve also been using interfaces more and more over the years, and these days I’d say I use them on almost all of my beans. The lightweight multiple inheritance helps with organization, and when you’re dealing with libraries that monkey with the internal working of your code like proxied beans in Spring and Hibernate objects, interfaces are helpful if not required.

A while back, I inadvertently discovered a pitfall that had been plaguing a project of mine in a very confusing manner. Parameterizing a class should avoid class cast exceptions because of strong typing, but you have to be careful to keep it parameterized, or you can end up causing some very nasty runtime bugs. To illustrate, here is a simple example:

(forgive the formatting, WordPress’ editor is poor at handling code…

First we have a Person interface. People have IDs and vehicles.

package com.efsavage.generic;
import java.util.Set;
public interface Person<PK extends Comparable> {
public PK getId();
public void setId(PK id);
public Set<Vehicle> getVehicles();
public void setVehicles(Set<Vehicle> vehicles);
}

We also have a Vehicle interface, the fields of which are unimportant here:

package com.efsavage.generic;
public interface Vehicle { }

And we have an implementation of the Person interface:

package com.efsavage.generic;
import java.util.Set;
public class PersonImpl implements Person {
private Integer id;
private Set vehicles;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public Set getVehicles() {
return vehicles;
}
public void setVehicles(Set vehicles) {
this.vehicles = vehicles;
}
}

So now let’s write a little test:

package com.efsavage.generic;
import java.util.Set;
public class PersonTest {
public static void main(String[] args) {
Person me = new PersonImpl();
Person<Integer> you = new PersonImpl();
me.setId("5");
you.setId(5);
Set<String> myVehicles = me.getVehicles();
Set<Vehicle> yourVehicles = you.getVehicles();
}
}

This code compiles fine (though Eclipse will flag a few warnings). There’s two problems here.

Despite the fact that PersonImpl implements Person<Integer>, I’m able to set a string via me.setId(“5″), because I did not keep that parameter when I cast me to Person, without a parameter. I would have expected the parameter to be inferred here.

The other problem is that I’m able to cast myVehicles to Set<String>! This wasn’t even a parameter I defined, it’s right in Person. However, by using Person without the PK parameter, Java ignores all other parameters too!

I’m sure someone thought this was a good idea, and there’s a reasonable explanation deep in the JCP forums, but it just seems wrong to me, so be careful to check your parameters if you find weird class cast exceptions showing up in your logs.

MVP 2007

Wednesday, October 3rd, 2007

National League MVP: Matt Holliday. Led the league in BA, H, XBH, 2B, RBI, TB, and RC, and finished near the top in other categories. Carried his team to the post-season, not to mention scoring the winning run of the final game. Runner Up: Prince Fielder.

American League MVP: Alex Rodriguez. Led the league in R, SLG, OBP, TB, HR, RBI, and RC. Basically carried his team until their 50% payroll surplus was able to get them out of a long funk. Runner Up: David Ortiz

TBS seems to have gone to the FOX school of baseball broadcasting. Missing the beginning of innings so they can squeeze a promo in is unacceptable. Not only that, but it’s a promo for a damned re-run, and the same one they show every half-inning! Much like I was forced to boycott House because of FOX’s incessant promotion of it during the 2004 playoffs, I’m not watching The Office on TBS. Luckily since it’s on NBC first, I won’t be missing anything.

Cy Young 2007

Tuesday, October 2nd, 2007

Being a sports fan doesn’t end when the season does, you need to analyze, reflect, and debate things like awards, so let’s get started:

National League Cy Young: Jake Peavy. No real debate here. Led the league in strikeouts, strikouts per inning, wins, WHIP, and ERA, and came just short of the playoffs. Runner Up: Brandon Webb.

American League Cy Young: C. C. Sabathia. On the surface, it looks like a real close race here with Beckett and maybe even Lackey, and the press seems to think Beckett is a lock because he got 20 wins. However, Sabathia beats Beckett in WHIP, IP, K, GS, CG, SHO, K/BB ratio, which are all key ace/stopper stats. Runner Up: Josh Beckett.

Note: Expect a surge in baseball-related posts over the next couple of weeks :)

Baseball Manglers

Monday, October 1st, 2007

One of the key differences (beyond the rules of the game) between the 4 major professional American sports is the role of the managers. In football a team wins or loses largely based on the cleverness of the coach. Basketball and hockey teams use styles and plans that the coach comes up with, even if the action itself is largely tactical.

Baseball calls the position a manager, not a coach, and is also the only sport where the manager wears a completely unnecessary uniform. The term manager is probably more accurate, since most of what the manager does is done off-field, keeping two dozen or more alpha jocks in line every day for 6 months. During the actual game, the manager rarely moves, typically waddling out of the dugout only a few times per game. Sometimes a bad call is made and a show must be put on, but the decisions largely make themselves, and the limited number of options often makes them rather easy.

I devote a blog post (the first of several, most likely) to poking a stick at the 30 guys that often make more than a million dollars a year because one of my pet peeves came to light in tonight’s exciting one-game-playoff between the Padres and Rockies.

Why do managers never pull pitchers in the middle of a count?

It was obvious to anyone watching the game that Jorge Julio had nothing. He walked Giles, throwing pitches anywhere but over the plate. His first pitch to Hairston was just as bad, and I said to my roommate, “they need to get this guy out of there”. The cameras showed the manager pacing, not looking happy. The poor pitcher had no control at all, the manager is sitting on a 40 man roster, and this is the most important game of the year. Julio has pitched well this season, but when every pitch counts this much, you have to mitigate the risk. Needless to say, the next pitch left the park.

I have never seen a pitcher pulled in the middle of facing a batter. It’s apparently one of the unwritten rules that makes no sense like not switching sides when you bat (or pitch). There are probably hitters out there who would do well to switch sides when they get ahead or behind in the count, but they don’t do it. Short of an injury or ejection, a manager would sooner watch his team lose while he’s posed on the top step of the dugout than just run out and tell a guy he’s done and he’s not going to get a chance to throw two more balls or lob the meatball the batter is obviously sitting on.

Entries (RSS) and Comments (RSS).