back
13 comments
Wow. Thanks for writing it up, but that API just makes me cringe. That's what we had to deal with back in the day, but now we have abstract APIs like localStorage, Web SQL and Indexed DB [1]. At the very least, this wont gel with "Directories and System" component of the File API [2][3]. Microsoft will probably be implementing the W3C standard, but we may have to come up with a fileQuery.js library to do file-operations the same way across platforms until they see a need for it.

[1] http://www.html5rocks.com/en/tutorials/offline/storage/

[2] http://dev.w3.org/2009/dap/file-system/file-dir-sys.html

[3] http://www.html5rocks.com/en/tutorials/file/filesystem/

I find the whole situation quite absurd. Throughout the 1950s, 1960s, 1970s, 1980s, 1990s, and most of the 2000s, we saw real advancements being made. Things were generally getting better over time.

Fortran made programming much more accessible. C and UNIX made for an effective, practical platform. Lisp, Scheme, Smalltalk and ML brought some rigor and new ideas to the table. Perl and Python allowed for rapid development of scripts and prototypes. SQL let us really push relational databases to the limit. Even C++, Java and C# allowed for the development of large, real-world systems.

Then around 2007 or so, everything went completely stupid. We saw the rise of JavaScript and NoSQL, and things have only gotten worse since then. It's like we lost 50+ years of accumulated knowledge, programming language functionality, libraries and platform support.

What happened to our craft? Everything that was good is being discarded, in favor of languages, databases, APIs and platforms that are rubbish. It's not even a case of "worse is better". It's "worse is much worse".

I'm not sure why so many think Javascript is bad. In my opinion, the new version of ECMAScript is heading in the wrong direction by adding classes and more Java/C++ features. C++ has so much cruft I can't possibly remember all that stuff (the standard is hundreds of pages if I recall correctly). Javascript has the benefit of being a very powerful, light-weight language.

CoffeeScript removes the quirks of Javascripts and emphasizes the functional aspects. My Coffeescript code is easily more expressive than the C++ code to do something equivalent (as long as it's not low-level system stuff or HPC critical). First-class functions, maps, folds -- yes please! And even though Javascript objects aren't technically maps, everyone uses them for that (and V8 optimizes them for that) and the syntax is amazingly brief.

I think Javascript for a desktop API is a good idea. As to Microsoft's implementation of such a desktop API, I can't comment since I haven't used it.

EDIT: Just read through the Windows Javascript API. Holy crap, they screwed that up badly! So much potential...

Javascript is bad because Vendors like microsoft made it bad , to promote their own RIA tech ( silverlight ). IF ecmascript 4 would have been standardised in 2007 , javascript would be closer to ActionScript and Jscript.NET. they allow the same amount of functional programming than Javascript does yet are strongly typed , with classes , interfaces , etc ...
>Javascript is bad because Vendors like microsoft made it bad , to promote their own RIA tech ( silverlight )

What on this green Earth does that even mean? JavaScript and Silverlight could hardly be less related other than they're both available in some browsers. Timeframe, etc, don't support your [conspiracy] theory.

JS is different in that it's a prototype-based language. That and the sometimes errant recent love-obsession with Node.JS has given JS an undeserved and often non-specific bad reputation.

JavaScript had a bad reputation far before Node.js was introduced. It was blatantly inferior to begin with, and it hasn't really improved since, but for whatever reason people don't recognize the inferiority like they used to.

While its prototype-based nature may have some theoretical benefits, in practice it has obviously been disastrous. I suspect that it is the cause of more terrible code than JavaScript's numerous other serious problems.

In order to make something truly usable out of JavaScript, you essentially have to discard all of its core features and syntax. At that point, one should ask why there's even any point in bothering. If JavaScript basically needs to be twisted into something resembling C++, Java, C#, Ruby or Python to be truly useful, then why not just go with those languages instead?

Everything now is stupid and rubbish. Got it. Ignore D, Rust, Go, valid uses of NoSQL, advanced made to RDMS, etc.
I never said "everything now is stupid and rubbish". I'm not sure at all where you got that nonsense from. It's mainly just JavaScript, and its closely related technologies, that are problematic these days.

I don't really consider D, Rust and Go to be all that remarkable. They're not terrible regressions like JavaScript is, but they aren't that much of an improvement over C or C++, for instance. Likewise, NoSQL is merely 1960s-era approaches reused and abused today.

Maybe you weren't around to experience the massive boost in productivity that languages like C, C++, Java and Perl brought when they first became available. Tasks that formerly took months now only took days, and tasks that took days could now be accomplished in mere hours. You wouldn't believe the excitement I saw from some developers when they first started using Perl and CPAN, for instance.

It's like we were due for that next massive productivity jump between 2007 and 2010 or so, but things went horribly wrong and we ended up in this JavaScript swamp instead.

This application is being written on the WinRT platform which is a wrapper around win32 for writing windows 8 applications using HTML and Javascript. it's not really a browser application, it just happens to use html and javascript as it's UI layer hence it doesn't use things like localstorage or web sql etc.
+1 for a nice library that makes it look like the HTML5 API and that uses promises for both cases. I may even end up writing it myself.
I don't see what's that wrong with the API other than they ought to have more aligned with the HTML5 APIs.

The code in the blog post is poor because it's width constrained and callback soup. Use of promises and/or better JS would help the appearance of the code.

But are you sure those would WORK? One of the things I had to wrap my head around early is that MS JS is not the same as ALL JS. You don't want to know what you have to do for a Global variable...
Huh? (I wrote one of the JS WonRT API and implementations)