News for hackers. Stuff that matters.
Re:It’s time to kill the web app by jerf on Saturday September 23, 2017 @04:27PM (#15321545)
"Any time I think I'd like to do something with the web and sit down to learn, it's completely overwhelming. I've never been able to put together a coherent mental model of the architecture of a web application or figure out what the best practices are for web development."

If it makes you feel any better, that's because there isn't a coherent mental model. If you've ever heard of the ORM/Relational impedance mismatch, it's got nothing on the set of impedance mismatches between the way servers like to work, the HTTP protocol (and its still very page-based orientation in a world of streams), the browser's DOM model, and how Javascript works, especially if you want to get excellent performance out of it.

It is my opinion that this is why you see so much churn in the web world; the continuous iterations on client-side frameworks, server-side frameworks, this Javascript DOM library, that Javascript DOM library, now an integrated framework, now recommending assembling your own from bits and pieces... it's all a reflection of the fact that none of these pieces particularly work all that well together in the way we'd really like them to. There's a ton of possibilities, all of them frankly pretty bad in most ways but good for this one use case, but a different use case for each tech, and that's a recipe for a lot of churn.

My recommendation to anyone getting into this world is A: learn the basics of HTTP B: learn the basics of HTML C: clock some time with Javascript's basic DOM interface and maybe jQuery and then D: relax about the whole thing, unless you really think you're going to build an app that scales up to the tens of thousands of simultaneous users. The truth is that when it comes down to it there are still plenty of applications you can successfully build and deploy using completely 2005 technologies... and the dirty secret truth is that you may well beat someone to market who is over-invested in staying Up To Date and constantly throwing away all their skills.

(You will not beat to market someone who is judiciously staying up to date, and carefully picking and choosing what modern tech to learn and deploy. But you still probably won't be that far behind them, either. And that is not the person who is actually freaking everyone out about the web; it's the guy vigorously selling Vue.js or whatever modern thing as the hot new thing and that all previous JS libraries are now trash that should be used by nobody, when six months ago they were saying the same thing about something else.)

Re:It’s time to kill the web app by userpass on Saturday September 23, 2017 @07:37PM (#15322368)
>If you've ever heard of the ORM/Relational impedance mismatch, it's got nothing on the set of impedance mismatches between the way servers like to work, the HTTP protocol (and its still very page-based orientation in a world of streams), the browser's DOM model, and how Javascript works, especially if you want to get excellent performance out of it.

Mapping objects to tables is a solved problem. The only noteworthy challenge is subtyping but it has easy solutions. I'm surprised how well it works even if you have an old crusty database with an archaic table structure. Compared to serialising objects to JSON or other formats that have no concept of identity it's downright trivial. However mapping objects to tables is the primary thing an ORM really does. Usually it implements lazyness for correctness so that your code while inefficient still works as intended.

What an ORM however does not do is write queries for you. Databases are remote devices, you can't just treat remote objects as if they were local (like CORBA did) if you care about performance.

Remember: You still have to write your queries but usually the ORM still helps you writing queries by providing a query builder or has it's own query language. The point of the ORM is that you don't have to manually marshall rows into objects, it's not a tool to avoid queries. It's right there in the name: Object Relational Mapping. It does not say AutomaticQueryGenerator or something related to queries.

Re:It’s time to kill the web app by olmo on Saturday September 23, 2017 @08:23PM (#15322540)
Why LINQ is systematically ignored outside of Microsoftland? It's actually a type-safe expressive and secure AutomaticQueryGenerator
Re:It’s time to kill the web app by wpietri on Saturday September 23, 2017 @09:27PM (#15322752)
> Mapping objects to tables is a solved problem.

Sure, but that's just the standard solution that hides the mismatch. The mismatch is still there. Which is why when performance becomes an issue, there's a whole bag of tricks for tuning the ORM or just sidestepping it and writing a sane query. It's also part of why the SQL database went from the only thing people could conceive of using to one tool among many for data persistence.

As 1970s paradigms go, SQL has had a good run. But the main problem it solves, easily finding and changing your data somewhere on a small number of spinning metal disks, is just not the central problem of computing that it was for a few decades.

Re:It’s time to kill the web app by addicted on Saturday September 23, 2017 @05:09PM (#15321743)
A lot of the churn is because the web is so young as an application platform. It’s been less than 20years since GMail which was probably the first thing that even approximated an application on the web. Chrome was released in 2008 less than 10years ago, and it was the first time the web had a runtime engine which was perform at enough to even build an app.
Re:It’s time to kill the web app by astura on Saturday September 23, 2017 @06:43PM (#15322186)
There were plenty of webapps before Gmail. There was even plenty of other webmail services before Gmail and Gmail wasn't much different from the status quo. I've been using webmail since 1997 and even my University had a web interface (SquirrelMail) for those who preferred using the web interface (almost everyone). This was pre Gmail.
Re:It’s time to kill the web app by wpietri on Saturday September 23, 2017 @09:31PM (#15322767)
Really? My recollection is that Gmail was substantially different in the extent to which it was an in-browser Javascript app built around server-side data requests. That's in contrast to something where applications were a series of mostly-static pages.

At the time this change was known as AJAX, and GMail is listed as a pioneer: https://en.wikipedia.org/wiki/Ajax_(programming)

Squirrelmail, by contrast, rendered a new page for most user actions. Especially the viewing of messages.

Re:It’s time to kill the web app by curun1r on Saturday September 23, 2017 @10:18PM (#15322898)
My recollection was that Outlook's Web Access was the first. IIRC, it used what would become XMLHttpRequest when it was still internal to Microsoft, so it's the first of what we might consider to be modern web application. GP's 1997 seems right on, though, since that was the first release.

https://en.wikipedia.org/wiki/Outlook_on_the_web#History_2

Re:It’s time to kill the web app by xenadu02 on Sunday September 24, 2017 @02:46AM (#15323607)
Microsoft invented AJAX specifically for Outlook Web Access so yes that is in fact the first "modern" web application.

As I recall there was a fight about getting it in and the creators called it XMLHttpRequest because XML was the hotness at the time and that got it past the project managers and PHBs.

Re:It’s time to kill the web app by wpietri on Sunday September 24, 2017 @04:58AM (#15323977)
GP cites Squirrelmail, which definitely was not AJAXy. And still isn't, I'm pretty sure.
Re:It’s time to kill the web app by astura on Monday September 25, 2017 @10:14AM (#15330649)
What I mean was:

-Webmail was already established as a "thing" when Gmail came out, even in Universities.

-Gmail wasn't particularly special from a UI perspective and was comparable to other offerings at the time.

-There was plenty of other web apps already that weren't Google products. In fact, I, personally, was writing one at the time GMail came in out.

Re:It’s time to kill the web app by wpietri on Monday September 25, 2017 @10:36AM (#15330819)
Sure webmail had been out for a decade before GMail. But I believe the point was that Gmail was special in that it was a pioneering user of AJAX-style interactivity.

Pre-AJAX, web-based services were just a series of forms, and the interactivity patterns harkened back to "smart terminal" [1] form-based use for mainframes in the 1970s. I believe the user you were responding to uses "application" to mean something approximating the desktop application experience of the 80s or the current mobile app experience.

So the distinction they're drawing is about the kind of interactivity. Squirrelmail, et al, were a series of forms and pages. GMail didn't do a new page or frame load every time you looked at a new message. UI rendering and interactivity became client-only activities, with the server providing an API.

[1] now known as block-oriented terminal: https://en.wikipedia.org/wiki/Block-oriented_terminal

Re:It’s time to kill the web app by ProblemFactory on Saturday September 23, 2017 @09:13PM (#15322699)
> Gmail wasn't much different from the status quo

GMail was different because it offered an outlandish 1GB of mail space, when everywhere else you got 1-10MB mailboxes. Since it was launched on April 1st, most people did not believe it at first. And (at the time) huge space allowed users to keep and search all old email, instead of deleting old emails being a weekly chore.

Re:It’s time to kill the web app by astura on Monday September 25, 2017 @10:10AM (#15330605)
I meant from a UI/UX prospective.
Re:It’s time to kill the web app by basicplus2 on Saturday September 23, 2017 @08:54PM (#15322643)
Pine
Re:It’s time to kill the web app by narrator on Saturday September 23, 2017 @06:32PM (#15322146)
Everybody here is too young to remember the era of the Microsoft monopoly and how much it sucked. The Web app era is much nicer. Besides Web Apps aren't bad compared to the 90s win32 api which was closed source and riddled with bugs and undocumented behavior.
Re:It’s time to kill the web app by camgunz on Saturday September 23, 2017 @06:28PM (#15322132)
20 years is forever. Nothing should be this bad after 20 years.
Re:It’s time to kill the web app by bjelkeman-again on Saturday September 23, 2017 @05:21PM (#15321792)
There where webapps being built before gmail. We did Ajax-like things in 1999-2000. But gmail was possibly the first slick implementation.
Re:It’s time to kill the web app by sorenjan on Saturday September 23, 2017 @06:56PM (#15322232)
I remember how impressed I was when Google Maps was released. Instead of having to click on arrows to reload the page with a new map, you could just drag and it would automatically load new map tiles!

Google Earth (the native application) is really old and abandoned by now, but its still better than the new "web" version that only works in Chrome.

Re:It’s time to kill the web app by u801e on Saturday September 23, 2017 @05:22PM (#15321798)
How did gmail back then differ from hotmail or Yahoo mail? I was using both in the late '90s/early '00s.
Re:It’s time to kill the web app by dfox on Saturday September 23, 2017 @06:49PM (#15322209)
Gmail was first massively used single page web application. Somewhat ironically it was built on top of technology meant for Outlook Web Access (ie. XMLHttpRequest as ActiveX component in IE and as an DOM extension in Gecko). AJAX is name that was conceived to describe that approach to webapps, with the somewhat funny fact, that google at the time described it as javascript (from time to time with the addendum: "done right")
Re:It’s time to kill the web app by vbezhenar on Saturday September 23, 2017 @07:22PM (#15322317)
Funny thing about AJAX is that this acronym means nothing. Asynchronous JavaScript? Well, JavaScript was always asynchronous. And XML? What does it have with XML?
Re:It’s time to kill the web app by tmzt on Sunday September 24, 2017 @03:05AM (#15323663)
XMLHttpRequest originally was intended for posting and getting XML which was automatically parsed and exposed on the response object.

Now of course we are using more JSON and XMLHttpRequest is being replaced by Fetch API.

AJAX means Asynchronous Javascript and XML.