Live data from Hacker News

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

jsfiddle.net

191–200 of 274 posts

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

#191

Earlier quoted context omitted.

> What is it now that is the equivalent of writing our own screen handling routines? Centering something using CSS. :(

Just goes to show how much the far left and the far right has influence over our society

Eh, it's pretty easy to get things not on the far side of the screen; it's just hard to get it precisely in the center.

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

#192
post #137

Earlier quoted context omitted.

The only things that are powerful and expressive in JavaScript are bastardized beyond recognition versions of ideas from Lisp, Smalltalk and Self. You get those dynamic mechanisms that we know for 50 years now (lambda expressions and runtime method dispatch, oh wow) to be useful but without learning any lessons learned in those 50 years about how to design a coherent language based on those concepts, you just get a h…

I agree, saying "Wow, this is a viable and useful language" because you can do something in just a few highly unreadable lines seems... like a pretty odd judgment. It'd be a bit like saying that C is a great language because someone wrote a raytracer that fits on a business card[0] using it. [0] http://fabiensanglard.net/rayTracing_back_of_business_card/

This code is fairly readable. It takes one or two shortcuts, but it's much closer to real code than to golf.

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

#193
post #62
post #41

This is truly great as proof of concept and also as a reminder that in software development building 80% of perceived* functionality usually takes only tiny fraction of total development time which is required to build final product. * - this app looks and feels like “almost complete spreadsheet” yet it provides much less than 1% features of even a basic spreadsheet.

And 80% of perceived functionality is what most users — even people who rely on spreadsheets for their work — need. I'm not saying including the other 20% of functionality isn't a good thing to do, but when you're creating a new product or open source project, you can get by (and thrive) building only the 20% of functionality that's used 80% of the time. Why? Because 1% of functionality is still better than 0% (never…

This ridiculous false choice suggests a certain lack of understanding of what it is like to build software.

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

#194
post #93

It's not really comparable, but minimalistic spreadsheet applications always remind me of Dan Piponi's Haskell `loeb` function [0]---a "one-line" "spreadsheet" "implementation". The blog post is very interesting to read, but here's the meat. We're looking for a function with type loeb :: Functor f => f (f a -> a) -> f a and without thinking about the meaning of it, we can implement it as loeb x = fmap (\a -> a (loeb…

Just yesterday I was about to temporarily quit Haskell after slamming my face into Learn You A Haskell's Functor chapter. But after seeing the concept applied (jokes for nerds!) like this, I think I'm going to give it another shot. Thanks!

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

#195

Earlier quoted context omitted.

Imagine if management had not vetoed non "Java-like" syntax's during javascripts creation. Maybe Brendan Eich could have gotten a decent scheme dialect into the browser instead, people could have learned it (because in hypothetical retrospect, what else were they going to do? Not learn it?), and we would be in a far more pleasant position today...

They would have learned whatever Java/C-derived scripting language that Microsoft came up with instead.

[deleted]

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

#198

I am impressed. Its a neat hack, it actually is a real spreadsheet in 30 lines of code, with references fully working (ie =A3+B4 gives expected output. As does =alert("foo") but then nothing is perfect). I think it says something about the browser as a platform - these thirty lines simply assume an enormous amount that excel and visicalc could not - visicalc had to write their own screen refresh routines. It is usefu…

While reading I also noticed the '=alert("foo")' hack, and thought I'd be able to point it out first, but you beat me to it! Ah well, that could be fixed pretty easily if it were harmful enough.

I think it's time that we accept the browser as a platform development model. Now Apple has 'iWork for iCloud' and Google has had it's doc programs for a while.

Very good hack, very powerful idea.

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

#199
post #93

It's not really comparable, but minimalistic spreadsheet applications always remind me of Dan Piponi's Haskell `loeb` function [0]---a "one-line" "spreadsheet" "implementation". The blog post is very interesting to read, but here's the meat. We're looking for a function with type loeb :: Functor f => f (f a -> a) -> f a and without thinking about the meaning of it, we can implement it as loeb x = fmap (\a -> a (loeb…

Just yesterday I was about to temporarily quit Haskell after slamming my face into Learn You A Haskell 's Functor chapter. But after seeing the concept applied (jokes for nerds!) like this, I think I'm going to give it another shot. Thanks!

If you're ever in need of more motivation, be sure to take a look at more posts on Neighborhood of Infinity. It's truly an inspiring blog!

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

#200
post #191

Earlier quoted context omitted.

Just goes to show how much the far left and the far right has influence over our society

Eh, it's pretty easy to get things not on the far side of the screen; it's just hard to get it precisely in the center.

should be easy with flexbox (crossbrowser possible)

simple demo: http://philipwalton.github.io/solved-by-flexbox/demos/vertic...

Post reply on HN