annathyst: (Default)
[personal profile] annathyst
1) It is better to seek forgiveness than to ask permission. (Don't check to see if you can do something before trying to do it, because the answer might change under you.)
2) Laziness is a virtue. (Delay calculating values until you actually need the values)
3) Adding another layer of indirection solves everything. (I don't really have a pithy explanation of this, it's just true.)
4) Just because something is impossible doesn't mean it can't happen.
Corollary: Impossible behavior is your runtime screaming at you to pay attention. Ignore or work around it at your peril.

Is this worth expanding on? Am I just being overly pretentious? Should I go into more detail about situations that gave rise to these?

Date: 2006-02-09 04:15 am (UTC)
From: [identity profile] stargazer.livejournal.com
I have learned the first one over and over and over again in my job over the past year. It's amazing how often it comes up. Sometimes the issue isn't even that the data can change under you, or whatever; sometimes it's just easier to recklessly do something and then see if it worked.

We have a homebrew search engine (don't ask) that fundamentally can't handle anything that can't be encoded as ISO-8859-1. So now that we've got web services and stuff where we use UTF-8 everywhere because, well, it's the only sane thing to do, the question came up: what should we do with search queries that can't be expressed as ISO-8859-1?

Me: "Let's just find the troublesome words and add them to the list of words we ignored."

Coworker: "I think that's a good idea in principle but I don't think it's worth the huge hairy regular expression you'd have to write to find ISO-8859-1-encodable words."

Me: "I hadn't even thought about that. I was just going to make a copy of the word, encode it as ISO-8859-1, decode it back, and see if we lost any data that was in the original."

Coworker: "Oh!"

Date: 2006-02-10 03:31 am (UTC)
From: [identity profile] stargazer.livejournal.com
I SAID DON'T ASK! But okay, fine. It's actually exactly the story you'd probably guess: the Knowledge Base that I work for has actually been around for a long time. It used to be just text files on a common machine, and then it was served over Gopher. So when someone first wrote a search engine for it, off-the-shelf solutions weren't really available. And we've just been porting it forward ever since.

We'll replace it someday, but first we have to make sure our mission critical machines aren't going to die tomorrow....

Profile

annathyst: (Default)
Anna

June 2021

S M T W T F S
  12345
67 89101112
13141516171819
20212223242526
27282930   

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Jun. 23rd, 2025 08:44 pm
Powered by Dreamwidth Studios