4 ms·
how is this "educational"? it's about as readable as hexadecimal machine code. What's the lesson?
by fnord77 5y ago
how is this "educational"? it's about as readable as hexadecimal machine code. What's the lesson?
- everyone 5y agoIt demonstrates how awful javascript is.
- TimTheTinker 5y agoFlexible !== awful
- justin_oaks 5y agoJavaScript can certainly be awesome, but the tricks that JSFuck relies on aren't "flexible". They're things that make you say "Wat?" https://www.destroyallsoftware.com/talks/wat https://www.destroyallsoftware.com/talks/wat
- fctorial 5y agoIf your code adds two arrays together, there's something seriously wrong with your code. It isn't that different from divide by zero error.
- eyelidlessness 5y agoA lot of other languages allow + to concatenate lists/arrays/sequences, even merge dicts/objects/maps. Languages that don’t have those semantics often have much safer and more idiomatic ways to join data structures (see lisps of all sorts) in ways you wouldn’t immediately expect if you’re coming from this perspective. Adding two arrays together isn’t the problem, it’s a perfectly obvious thing to do. Adding two arrays together and getting a new language out of it is bonkers. Edit to add: I work in JS/TS almost exclusively. This isn’t a chip on my shoulder criticizing a language I’m not invested in.
- phaedryx 5y agoI noticed that you had to use !== instead of != because the comparison operators in JavaScript are awful :D
- TimTheTinker 5y agoTouché :) Though I'd still argue that the presence of both `==`/`!=` and `===`/`!==` is somewhat more indicative of flexibility than awfulness.
- deleted 5y ago[deleted]
- Dylan16807 5y agoI'd say about half the interactions this relies on fall in the 'trash' category. It doesn't mean javascript is trash, but it has a lot of trash in it.
- eyelidlessness 5y agoIf you want a sincere answer: it provides a huge state space of how unexpected input can produce much more unexpected results. If nothing else it’s educational about how you really shouldn’t trust input, and REALLY should scrutinize how it’s used.