5 ms·
The authors is quite lazy or cannot type fast enough, so he has to create all those cryptic abbreviations: `rks` for `ranks`, `unv` for `unvote`, etc. Which mak
by jek0 8y ago
The authors is quite lazy or cannot type fast enough, so he has to create all those cryptic abbreviations: `rks` for `ranks`, `unv` for `unvote`, etc. Which makes it really hard to read.
But it's especially the inconsistent use of camelcase in function names than makes me think it's pretty amateurish.
- Rapzid 8y agoYeah, just looks like a grease monkey script I would have banged out a decade ago in about an hour. Nothing wrong with that. It's far more interesting how much people are reading into this code haha. It was clearly not written to be read by us today IMHO.
- richrichardsson 8y agoHard to read? The sum total of the script fits on 2-3 pages at most, no single function exceeds about 10 lines, if you have trouble reading and reasoning about that code then something is wrong.
- paulintrognon 8y agofunctions will not be any line longer by writing ranks instead of rks, but it will greatly improve readability. You can have the exact same code wihtout abbreviations, and I can assure you that it will still be 2-3 pages long, with very short functions.
- dang 8y agoYou can't evaluate readability without knowing the conventions that a system is working with. (That means knowing something about the people as well, btw.) In this system, 'rks' communicates something that 'ranks' does not: that this is a local variable denoting a collection, and that it is a collection of the things that 'rk' denotes one of. So actually it adds quite a bit to readability. If I were going to edit that code to make it more readable, the one change I'd consider is using 'r' (or maybe 'n', because these are integers) instead of 'rk'. One can argue either way whether the k adds information or just noise.
- dorgo 8y agoYeah, I also like to minify the code before reading. It makes up to 5 times less code and it's fun to guess which letter stands for which function.
- drinchev 8y agoMaybe the author used to write C
- anoifeh 8y ago>But it's especially the inconsistent use of camelcase in function names than makes me think it's pretty amateurish. Despite its size, this .js file has been modified throughout many many years probably by various authors.
- elboru 8y agoA real amateur would have figured out how to write everything in a single function.
- LiterallyDoge 8y agoThis is the only part that I thought could be significantly improved for the use case they have here. But to each his own.