I live in Washington, and I find myself constantly pleading with Europeans (and, okay, Britons) to stop visiting New York and maybe Los Angeles and declaring they've seen the United States.
New York is an excellent four-day visit. You can pack in a combination of high-end dining, mid-end touristing (yes, you have to go to Central Park, visit Greenwich Village, get a pizza, get a corned beef sandwich, etc.), and urban exploring (I recommend devoting a day to hiking (wear shorts) from Central Park to Battery Park). It will be crowded and kind of dirty, and you'll be impressed by the combination of brusque blue-collar New York and ultra plus ultra wealth (not unlike rich London). Washington Square, Soho, and the Upper West Side all feel vibrant.
But, unless you really know people in New York, to the point that you can spend days just "hanging out" without a busy itinerary, eight days is long. It's an exhausting half-week visit, but after that, you would either want to get into a rhythm, as a resident would have, or go somewhere else. I suggest adding a second city.
If choosing between each city for the first time, Washington is typically a better 3-4-day visit than Boston. Not because Boston is a dull or mediocre city, but rather because Washington is simply "greater," in various ways. I imagine it's sort of like saying that one should visit Amsterdam over Bruges, or Barcelona over Valencia.
The one downside is the weather: I think of Boston as the frigid arctic (in truth, it's often about 5-10C cooler than D.C.), but, in July, it's probably the perfect temperature. Warm days, pleasant nights. D.C. might be 27F in July, but it could also easily be 32F, and, for a week or two, it will regularly hit 35F. For a several nights a year (often in late July and early August), it will even be hot after dark, though usually just comfortably warm. On top of that, it's humid in the summer.* It's more or less a summer tradition to see out-of-shape tourists, in visors, dousing themselves with overpriced Dasani water bottles on the National Mall at high noon in July. We Washingtonians get to feel wonderful schadenfreude as we sit in our offices (or, for millions of commuters, in traffic en route to the bridge).
Having said that: If you don't mind the heat--or, better, if you like visiting museums--come to D.C. The Smithsonian museums that line the Mall really are extraordinary, and they're all free. The Air and Space Museum is most popular (and crowded), but it is memorable to see several of the most important aircraft and spacecraft in history in one urban setting. The National Gallery has world-class artwork, and, apparently, the African American History Museum (just a few years old) has both great exhibits and a cafeteria with truly good soul food. Seeing the monuments is a must, as is a visit to (the outside of) the White House. (You can try to get a tour, which they offer, but it usually requires a request from your congressional office, and you are, I suspect, without representation.)
Then, D.C. comes alive after 4 PM. Because there's Washington, and then there's D.C. Locals make that distinction. D.C. is both a fun and beautiful city with a diverse local culture that feels, in many ways, totally distinct from federal, suit-and-tie Washington.
Obviously, I can't speak as much for Boston. It is a smaller city, though it has many beautiful parts. As an American, I marvel at its Englishness; there are place names with Colonial spellings that the rest of the U.S. either lost or never hard. As others have mentioned, the best part of Boston is actually the neighboring city of Cambridge, home to Harvard Square. (For a truly Harvardian experience, stay at The Charles.)
But, Boston is certainly a great city that I enjoy visiting (albeit largely for the lobster), D.C. has more. On the other hand, Boston weather may be perfect that time of year, while D.C. is hot. So that's balance.
And you would immediately regret renting a car in either city. If you don't want the subway, take Uber.
*Trump used to rant that D.C. was a "swamp," and out of respect for this forum, I will not comment on his comments. But, surprisingly, he was almost correct: Historically, much of D.C. was a swamp. It has to do with why the city exists in the first place: Georgetown, the oldest part of D.C. (and originally its own city) sits on the Potomac River at the point where it narrows significantly. Just north are cliffs and Great Falls, a series of waterfalls. Ships could not get north of Georgetown, and so that was the logically place for an upriver port. But the other thing those cliffs block is the humid air that comes from the Atlantic up the Chesapeake Bay and then up the Potomac River. So the humid air stagnates over D.C., particularly near the river. Hence, one low-lying neighborhood (home to the State Department) is known as Foggy Bottom.