4 ms·
You are right about classes with no state. Nonsense. In fact, if you take a look at the gist I linked to the post (https://bit.ly/2NgWBJK https://bit.ly/2NgWBJK
by amiralles 8y ago
You are right about classes with no state. Nonsense. In fact, if you take a look at the gist I linked to the post (https://bit.ly/2NgWBJK https://bit.ly/2NgWBJK), you'll there is no class, nor module, nor anything like that, just a couple of ruby methods on a file. Ruby can do that, too ;))
I'm not sure on how actual spreadsheets encode cell addresses. In my particular case, what I had to do was to find a way to (efficiently) encode any cell address in the range [A1..ZZ(10^6)] into a 64 bits integer. I needed 64 bits integers because that's what I use as a key to store/retrieve cells for the in-memory data store. (An avltree indexed by integer keys.)
As I mentioned in the post, the real code was written in C and targeted 64 bits platforms. Maybe that's way I doesn't make sense under OOP lenses on 32 bits systems.
Maybe I'll do a follow up post on "how to store spreadsheets cells on avltrees" to show why this encoding mechanism may make sense...
Thanks for you comments. Let's see how it goes!