Live data from Hacker News

Ask HN: How to write a web app that will outlast the latest JS trends?

news.ycombinator.com

1–10 of 23 posts

Ask HN: How to write a web app that will outlast the latest JS trends?

#1
HN is rife with JS framework wars, comparisons, latest feature news, libraries of the week, etc. What are surefire strategies for building a web app that won't have to be completely rewritten in 2-3 years? If I choose to write a web app in AngularJS and then in 2 years the Web community decides to coalesce around the new latest and greatest framework, technology, then it seems like I'll be in a rut.

How do you write a modern web app and be sure it will still be maintainable in the 2-3 year time frame?

Re: Ask HN: How to write a web app that will outlast the latest JS trends?

#3
My suggestion - you can't predict the future. Evaluate the best of what's currently available based on momentum, user base, and community. Pick the best for your current use cases. You can decide not to use the latest and greatest- observe what will stay constant, and use that.

Re: Ask HN: How to write a web app that will outlast the latest JS trends?

#4

Why would you be "in a rut" if the way you built your site is no longer the latest fad in 3 years?

Because in 3 years the frameworks, tools, etc. will have a much weaker base of developers than it its heyday (now). So in 3 years the framework will fall behind in browser compatibility, integration with newer tools, etc. Left to rot in the bit bin of history. And if I need to make changes in the web app, add new features, it'll be much more challenging if I also have to be dealing with framework maintenance in parallel.

Re: Ask HN: How to write a web app that will outlast the latest JS trends?

#5

Why would you be "in a rut" if the way you built your site is no longer the latest fad in 3 years?

Sometimes a need arises for browser-based apps that are not on the net, usually as part of a system installed at a location without access to public internet for various reasons.

If these systems are planned to have a life time of say 5-7 years, it would be best to not start developing parts of them with libraries and frameworks that are due to be phased out in just 2 or 3 years.

E.g. AngularJS, the writing is clearly on the wall. Google are investing in a number of libraries and technologies that are the "next thing": Polymer, Dart, Web Components + Shadow DOM in Chrome etc. It appears that in the big picture AngularJS is a stepping stone, which is a problem when you plan on building something that should be supportable for 5+ years.

Remember GWT? 5 years ago it was all the rage. At the 2012 Google I/O event they announced they're handing over control to a steering committee - their way of letting go and moving on. Imagine if you needed to continue supporting GWT based code for another few years, when the catalyst for the technology are phasing it out themselves. The worst part of this is the lack of developers - they see Google dumping GWT and stop learning about it. How do you hire developers to continue maintaining your software? This should qualify as being "in a rut".

So it begs the question, should an organization start using AngularJS (or any other fashionable framework trend) for long-term support systems? If so, how should one decide?

Re: Ask HN: How to write a web app that will outlast the latest JS trends?

#6
I am actually using AngularJS to rewrite an old project for a client. The reason I chose it is not because of popularity alone, but because it makes my code easier to read and it adds responsive interface to it.

Don't aim for a growing trend in regards to frameworks, aim for productivity and user experience.

Re: Ask HN: How to write a web app that will outlast the latest JS trends?

#8
"The best way to predict the future is to invent it". - Alan Kay

Therefore, the obvious solution is to invent a new JS framework.

To me, it looks like the Google team is committed to staying relevant based on their roadmap to 2.0. I personally feel confident AngularJS will be around in 5 years. Web components and dart fit well with angular, so I doubt it'll go the route of GWT.

Re: Ask HN: How to write a web app that will outlast the latest JS trends?

#9
How do you write a modern web app and be sure it will still be maintainable in the 2-3 year time frame?

There is no magic.

1. Write your code using standard JavaScript, avoiding corner cases and features that aren't universally supported.

2. Use libraries (you decide the architecture and when to call them) instead of frameworks (they establish the architecture and your code has to fit within it).

Neither of these is a new argument, it's just the usual trade-off with using bleeding edge functionality or building around a framework, now applied to the world of front-end web development and JS: you can do more things quickly at first with these tools, but at the expense of introducing portability and maintenance overheads that might cost you further down the line. Whether the benefit outweighs the cost is something you have to consider on a case by case basis.

Re: Ask HN: How to write a web app that will outlast the latest JS trends?

#10
post #8

"The best way to predict the future is to invent it". - Alan Kay Therefore, the obvious solution is to invent a new JS framework. To me, it looks like the Google team is committed to staying relevant based on their roadmap to 2.0. I personally feel confident AngularJS will be around in 5 years. Web components and dart fit well with angular, so I doubt it'll go the route of GWT.

Please, no more JavaScript frameworks unless you're doing something truly interesting, ala React with its virtual DOM or Angular with its.. everything.

There are enough to go around already.

Post reply on HN