Codem Ipsum: Lorem Ipsum but for Code(codemipsum.pomb.us) |
Codem Ipsum: Lorem Ipsum but for Code(codemipsum.pomb.us) |
I am a Russian speaker, and this ambiguous aspect of English has always bugged me to hell! I think english was a bad model as a starting point for programming languages.
Hackertyper is absolutely using real code.
Specifically, it's using groups.c from the Linux kernel:
https://github.com/torvalds/linux/blob/master/kernel/groups....
Compare that to the code used by Hackertyper:
What I was hoping for is a "Lorem Ipsum"-style generator for code for like 10 different languages. So you'd have a Lorem Ipsum for JS, C++, Rust, etc.
This is just find/replacing identifiers with lorem ipsum, which doesn't really mask the underlying code that well.
I also wonder how large such an obfuscated code fragment would need to be to be able to find back the original code on GitHub/GitLab.
"SyntaxError: unknown: Unexpected token (1:20)"
on valid code
`bite(dog, man)` is ambiguous. You need to look up the function documentation, make a guess, or ask the library developer to come up with a less ambiguous name.
If you could decline your variables, however, you could write (in terrible fake Latin)
`bite(dog, man-um)` or `bite(dog-um, man)` and they would be interpreted as two different -- and unambiguous -- things.
...but I'm just repeating GP's article.
So if you wrote a library with the verb "bite", you wouldn't specify that the first bites the second, or the first was bitten by the second. Those are ambiguous, because they're you're choice as a developer. Rather, you'd specify that the noun in the subject case bites the noun in the object case. That's unambigious in all declined languages.
So, as a reader of someone else's code, I can see immediately that `bite(boy-um, dog)` -- in my fake Latin where "um" denotes the object (cf. "Puer - Puerum") -- that the boy was bitten by the dog. I don't need to look up any documentation or look at how the variables are named in a third-party library.
Again, of course this case is a toy example. The article is more in-depth.