5 ms·
Codem Ipsum: Lorem Ipsum but for Code
- lettergram 7y agoNo description of what’s happening (on mobile anyway), but it looks like the variables are being replaced?
- tyingq 7y agoIdentifiers too. It's using the babel.js compiler so the approach is pretty straightforward: https://github.com/pomber/codem-ipsum/blob/master/index.html https://github.com/pomber/codem-ipsum/blob/master/index.html
- mike_hock 7y agoThe "lorem ipsum" identifier names are foo, bar, baz, qux, quux, etc.
- wa1987 7y agoThere's even a fancy umbrella term: https://en.m.wikipedia.org/wiki/Metasyntactic_variable https://en.m.wikipedia.org/wiki/Metasyntactic_variable
- 0xDEEPFAC 7y agoLorem Ipsum but for javascript
- pomber 7y agoHey, I made this. I needed dummy but syntactically valid code to show in demos like this one: https://github.com/pomber/code-surfer/blob/code-surfer-v2/readme.md https://github.com/pomber/code-surfer/blob/code-surfer-v2/re...
- omarhaneef 7y agoWait, this is just for dummy code for demos? I've been using at work for our production system. I figured the compiler would catch any mistakes...
- john-radio 7y agoLet me know how it goes with the compiler, I've got too much angel capital invested in this by now for it not to work!
- abhijitparida 7y agoThe name is kind of misleading. I expected it to generate random lines of code, instead of just replacing identifiers with lorem ipsum.
- XCabbage 7y agoFor whatever it's worth, I didn't share your expectation. The real lorem ipsum is just a fixed load of text, after all - describing something as "lorem ipsum but for code" shouldn't necessarily imply any functionality.
- wongarsu 7y agoGiven that lorem ipsum is a fixed load of text, as you said, I would have expected a lorem ipsum for code to be a fixed load of code (that's nonsensical but looks real enough from afar).
- FunnyLookinHat 7y agoI thought the same thing.
- moontear 7y agoSame thought here. I thought something along the lines of hackertyper. Something that looks like real code, but isn't.
- Sohcahtoa82 7y ago> I thought something along the lines of hackertyper. Something that looks like real code, but isn't. 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.c https://github.com/torvalds/linux/blob/master/kernel/groups.... Compare that to the code used by Hackertyper: http://hackertyper.com/code.txt http://hackertyper.com/code.txt
- BerislavLopac 7y agoWhy code in faux Latin when you can use the real thing: http://users.monash.edu/~damian/papers/HTML/Perligata.html http://users.monash.edu/~damian/papers/HTML/Perligata.html
- jacobush 7y agoI didn't expect it, but I thought Perligata is more readable than Perl.
- libeclipse 7y agoNot a difficult task lol
- skykooler 7y agoAt least, apart from numbers, which all are rendered in Roman numerals.
- ClumsyPilot 7y agoThis is so cool! I love it. 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.
- Aloha 7y agoHow so?
- SamBam 7y agoI'm guessing they're referring to linguistic features that English doesn't have, such as inflected nouns to unambiguously indicate the subject, direct object and indirect objects. `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.
- Someone 7y agoUnfortunately, this doesn’t lorem ipsum code comments. 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.
- gatherhunterer 7y agoIt looks like dolor is assigned without first being initialized.
- pc86 7y agoNo, it's passed in as a parameter with a default value of 1
- gatherhunterer 7y agoI see, the two columns are hard to read on mobile.
- madacol 7y agoI think it should not replace the `length` property of an intentional array.
- swagonomixxx 7y agoAs some others in this thread, I feel bamboozled. 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.
- Raphmedia 7y agoIt keeps throwing me "SyntaxError: unknown: Unexpected token (1:20)" on valid code
- cryptozeus 7y agoWhere would one use this ?