Super impressive and I love code-golfing but the title is slighlty misleading since the HTML part of the app, the cells, seem not to be included in the 220b. Still great.
A 220b spreadsheet app in HTML/JS
41–50 of 105 posts
Re: A 220b spreadsheet app in HTML/JS
#42If, like me, you're trying to figure out how this works, I've expanded it here to make it more readable: https://pastebin.com/1c72BYK1
Re: A 220b spreadsheet app in HTML/JS
#43ah, if only we could all code just what we needed, instead of over-engineering solutions to problems we wished we had
Re: A 220b spreadsheet app in HTML/JS
#44Can somebody explain to me how: "a[i]+-~j" is the same as "a[i]+(j+1)" ?
Re: A 220b spreadsheet app in HTML/JS
#45Yesterday I was blown away by both tetris and snake golfed out to this degree and now this. I feel like this is the modern reincarnation of obfuscated c. Can somebody explain to me how: "a[i]+-~j" is the same as "a[i]+(j+1)" ?
-(~j) = Twos complement of the ones complement of j
Twos complement = ones complement + 1
So twos complement of (ones complement of j) = ones complement of (ones complement of j) + 1 = j + 1
Re: A 220b spreadsheet app in HTML/JS
#46Earlier quoted context omitted.
yes hack yourself. bravo :) I guess you would have to sanitize when you save and/or load the spreadsheet
> I guess you would have to sanitize when you save and/or load the spreadsheet Sanitizing? No chance. Either you have a dedicated expression parser, or you run it directly throgh eval. There is no reliable middle ground. Decades of security failures of so-called "sanitizers" show this pretty clearly. (Even if you manage to create a perfect sanitizer today, wait a few months, new features are added to the browser, and…
Re: A 220b spreadsheet app in HTML/JS
#47I'm concerned about the lack of type annotations. What about XSS prevention? Maintainability? An API? How are people supposed to use this code in future projects? Your variable names don't conform to Code Complete. This code smells funny. Haven't you read clean code? And I don't think it's general enough. What if people want to add columns, but preserve formulas? What made you think you shouldn't use React for this?…
Re: A 220b spreadsheet app in HTML/JS
#48Re: A 220b spreadsheet app in HTML/JS
#49I'm concerned about the lack of type annotations. What about XSS prevention? Maintainability? An API? How are people supposed to use this code in future projects? Your variable names don't conform to Code Complete. This code smells funny. Haven't you read clean code? And I don't think it's general enough. What if people want to add columns, but preserve formulas? What made you think you shouldn't use React for this?…
Re: A 220b spreadsheet app in HTML/JS
#50I'm concerned about the lack of type annotations. What about XSS prevention? Maintainability? An API? How are people supposed to use this code in future projects? Your variable names don't conform to Code Complete. This code smells funny. Haven't you read clean code? And I don't think it's general enough. What if people want to add columns, but preserve formulas? What made you think you shouldn't use React for this?…