Live data from Hacker News

A spreadsheet in fewer than 30 lines of JavaScript, no library used

jsfiddle.net

121–130 of 274 posts

Re: A spreadsheet in fewer than 30 lines of JavaScript, no library used

#123
post #99
post #67

Earlier quoted context omitted.

The problem is that the total economic value (as measured by market price) for the users who only use that 80% of perceived functionality is close to 0 (google docs and OO/LO are free) The incredibly difficult 20% is what people pay for. It's what the businesses that shell out billions of dollars a year pay for. And it's what a successful product in the space needs to tackle

On the other hand, you are taking what appears to be a general observation and applying it to this specific instance. Sure, there are plenty of free spreadsheets available. But what about other areas? There's plenty of areas still where a well executed easy to use minimal version of a product can compete in the existing for-pay ecosystem, and as we are discussing, minimal can pay off since 20% of functionality may ta…

Y'alls be talking about different things.

You're talking about "feature minimalism is a good design philosophy".

The other dudes are talking about "bridging the gap between a sweet demo and a final product is a tremendous assload of work".

Re: A spreadsheet in fewer than 30 lines of JavaScript, no library used

#124
post #30

Are there any more full-featured libraries that people use for this? I've found SpreadJS[0], GelSheet[1], jQuery.Sheet[2], and ZK Spreadsheet, but none seem like thriving open-source projects as far as I can tell. [0] http://wijmo.com/demo/spreadjs/samples/index.html [1] http://www.gelsheet.org/demo [2] http://visop-dev.com/Project+jQuery.sheet [3] http://www.zkoss.org/product/zkspreadsheet

I've been a fan of SlickGrid for a while, it handles huge data sets relatively well. If you want excel-style functionality it'll still take a little work. https://github.com/mleibman/SlickGrid

SlickGrid is very nice and seems very advanced. Thanks!

Re: A spreadsheet in fewer than 30 lines of JavaScript, no library used

#125

This works wonderfully. Definitely the most punch I've seen per line of code. You can use javascript functions in your excel formulas. In a 30 line of code program this is a feature. = alert("I love it.");

Definitely a cool hack, but I had to laugh out loud at "Excel-like syntax (formulas start with "=")". Apparently the grammar for an "excel-like" syntax is: excel_like_expression ::= "=" javascript_expression

[deleted]

Re: A spreadsheet in fewer than 30 lines of JavaScript, no library used

#126
post #90

Just yesterday there was that Google email from 2010 talking about how JS can not evolve any further. It made me feel a bit wasteful about my time spent with the likes of node and angular. Seeing things like this reminds me how much JS is capable of in today's browsers and also shows me how much more I need to understand about the language. Awesome stuff.

It's important to remember that when someone is justifying the existence of a new project, claims like " can't evolve to meet the needs of " are highly suspect.

Re: A spreadsheet in fewer than 30 lines of JavaScript, no library used

#129
post #98

Although it is impressive that an app like this can be created in such few lines of code, I think it is a bad precedent as a programmer to have a goal to write as least as many lines as possible. It leads to hacks and unmaintainable code. I would rather have a method that has 10 lines of code that can be easily understood, then a method with one line of code that is only understood by the creator. That is not to say…

This code isn't particularly hard to understand, and that's one of the things I was impressed with about it. If it were more than a demo, it would need comments to explain its cleverer bits, but on the whole, it's pretty cleanly written.

But I disagree that writing short programs for the sake of writing short programs is a bad thing. Sure, you need to recognize that you can't take all of the habits you get from it with you when doing stuff for production, but it can be a good goal when creating prototypes. One big advantage is that it prevents feature creep.

I wrote a library a while back called DelayedOp for wrangling async calls in JS. Originally it was 5 lines of CoffeeScript, and I actually used it in that form for a while. It's much bigger now and full of features to aid in debugging. The key is that by writing it minimally to begin with, I got something I could use and see what features I actually wanted to add. And while I mourn the elegance of those original five lines, I also realize that what it is now is far more useful and reliable.

Re: A spreadsheet in fewer than 30 lines of JavaScript, no library used

#130
post #104

Earlier quoted context omitted.

Can you explain how such a tree would map inside a graph? I can't think of an obvious use case.

The use case is something like this: http://ludo.cubicphuse.nl/jquery-treetable/ It would be nice if something like that existed, but with much richer features like the libraries above.

[deleted]
Post reply on HN