Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> And, if I understand correctly, in every other locale file too. This tingles my DRY sense in a bad way.

Not as long as your locale file is ordered the same for each region. Then the index match on the English string tells you which line to read from.

> Premature optimization may be bad, but I still try to always pick the faster option when it doesn't require too much work :)

Certainly. It's definitely a balancing act. But I think I give up maybe ~5% total performance for a ~500% improvement in code clarity. Moving to Java and things like that would increase the overhead by an order of magnitude while probably not helping readability at all (maybe just a little.)

Of course, if I were trying to parse a 20GiB text file, I'd probably be working on it via mmap() over a char* array :D



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: