A Very Short Post:
I’ve lately come to the opinion that desktop application development is a moribund activity, which suits me quite nicely because I’ve never really liked any of the ways people invented to do it. So I’m getting my JavaScript on and building web applications, and more specifically, Single Page Applications.
To do this, I’m using AngularJS and TypeScript for the client-side development, and Simple.Web for the server side, and I’ve discovered this amazing thing: you don’t need server-side page rendering of any kind. You can serve purely static HTML files, and all the things you might do with Razor on the server can be done with JavaScript MVx frameworks on the client. You can even do Windows Live authentication with a static HTML callback page, and then pass the access token to the server using AJAX.
My favourite thing about this is, I can stick all the HTML, JavaScript, CSS and images that make up my UI into a CDN with a custom domain name, and set up CORS on my service servers so they’ll accept AJAX requests from that domain. Which makes serving the app lightning-fast, and reduces the load on expensive servers which have better things to be doing than shovelling static files.
The only fly in this ointment is that all the AJAX calls can be done to SSL endpoints, but unless the static files are served over SSL, there’s no reassuring padlock symbol to tell the user that their data is being transferred securely. So you end up pointlessly HTTPS-ing your static content just to keep the padlock there. If anyone knows of a solution to that problem, please let me know.










Do I feel a presentation coming along for SPA? I think I might have a go at using the technology you mentioned on my next greenfield web app… Keep up the good work Mark.
It’s going in my upcoming TypeScript talk, happy to come over and do that in Hereford.
The only thing I’m using Razor for is to switch between bundled and unbundled assets in release or debug mode. That can probably be factored out, but I’m too lazy.
The advantage of desktop applications (if you were not doing cross-platform stuff) is that the user experience on different machines would be more or less identical. Having to write tons of specific HTML/CSS/JS just to get something working on IE7 or 8 is an absolute pain in the ass, so I hope you’re not targeting those platforms
I am lucky enough to be targeting users to whom I can say “use a modern browser or GTFO”.
Ah, I see why you got that MVP award
Really amazing work, Mark! Lately, I have also tried to work with integrating APIs in the web apps and I would love to work with your Single Page Applications. My main focus these days has been GroupDocs developer APIs to integrate it apps into existing applications. You should also try working with it for the sake of new experience. Check it out here:
http://groupdocs.com/api
So what you’re saying, then, is that rather than render the HTML on a server in a fast, compiled language, and then download as small a page to the user as possible, you should instead write your code in a buggy, open-source code generator which makes an interpreted script which runs unpredictably and differently in different browsers, then force the user to download that as well, opening yourself up to hackers, and then slow the whole thing down and overload your server by having the users’ machines make loads of callbacks to it. Brilliant! I just wish I knew as much about systems as you: it would make my goal of being unemployable so much more attainable! Thanks for this!
I think everyone should go to http://opwernby.com/ to check out the kind of website this genius can make when he puts his Beautiful Mind to it. Be sure to view source to see what the HTML for “as small a page as possible” looks like.
haha owned
BTW, I suspect that posting rubbish like this in blog comments is doing far more to make you unemployable than learning something new ever would.
Ahahahahaha. It’s classic ASP. Which means it’s VBScript, that famously fast, compiled language.
And bless, you wrote your own CAPTCHA because you’re so awesome.
http://opwernby.com/scripts/security.js
that produces this (machine-readable DOM content):
https://gist.github.com/anonymous/5155715#file-worstcaptchaever-html
You should read this: http://en.wikipedia.org/wiki/Dunning%E2%80%93Kruger_effect
The ownage is strong with this one