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

My own! For a university assignment we had to make a simple Excel clone as a group.

We divided the work and I ended up working on the formula parser. I spent a week thinking about it and couldn't figure it out (I wanted to work it out from scratch). Eventually I had a flash of insight: I know how to parse simple formulas, so I can use string replacement to recursively rewrite a formula until I can parse it.

By the time I had written all of it, I didn't understand how it worked anymore, but it did work!

FormulaParser ended up being longer than the rest of the codebase combined, and I eventually learned the other groups did it with a regex and ~50 LoC...



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

Search: