News for hackers. Stuff that matters.
Re:Web Programming Is Getting Unnecessarily Complicated by DougN7 on Monday July 18, 2016 @08:33PM (#12118803)
I wonder how many are like me (old school? Just old??) and eschew platforms and libraries and roll my own most of the time, because most of the time, the needs are simple, and it's quicker to pound something out rather than learn and use Yet Another Framework. Though using jquery is nice sometimes...
Re:Web Programming Is Getting Unnecessarily Complicated by fenomas on Monday July 18, 2016 @09:58PM (#12119068)
> eschew platforms and libraries and roll my own most of the time

That's what nearly everybody does, when they're one person hacking on a one-off project.

I like to hate on Big Web Frameworks as much as anyone, but it should be understood that their value isn't replacing your hand-rolled code, their value is to let big 20-person projects avoid having 20 different flavors of hand-rolled code.

Re:Web Programming Is Getting Unnecessarily Complicated by pavlov on Monday July 18, 2016 @10:21PM (#12119136)
Thing is, complex frameworks like Angular tend to allow for 20 different ways to accomplish the same thing, so they don't really solve the underlying problem: team members still need to agree on a common approach and a shared set of idioms and coding styles.

There is a difference though. When there's a big framework involved, discussion will tend towards "Is this the right way to do X in Angular?" rather than "How do we want to solve X?". That may be good or bad, depending on whether you want to build your career around being an "Angular expert" (or a "Rails expert" or "SAP expert" or "COBOL/IMS expert" or any other kind of framework expert).

Re:Web Programming Is Getting Unnecessarily Complicated by buckbova on Monday July 18, 2016 @11:09PM (#12119303)
I picked up Angular quickly, insisted everyone in my group follow this style guide.

https://github.com/johnpapa/angular-styleguide

We didn't need an expert.

Re:Web Programming Is Getting Unnecessarily Complicated by jasonm23 on Tuesday July 19, 2016 @01:18AM (#12119883)
Seems you were lucky that the expert you didn't need had written up a style guide.
Re:Web Programming Is Getting Unnecessarily Complicated by buckbova on Tuesday July 19, 2016 @01:25AM (#12119911)
Definitely. We live in wonderful times.
Re:Web Programming Is Getting Unnecessarily Complicated by thegayngler on Tuesday July 19, 2016 @02:12AM (#12120090)
I don't like Angular 1.xxx that much because in Angular 1.xxx building simple stuff in JavaScript is a no no. Angular doesn't play nicely with JavaScript. Instead you have to do Angularjs way and write the Angular specific code in your 50 Angular specific HTML attributes. Performance of data intensive apps is particularly lousy in Angular. In my opinion it's a framework written for people who like complexity for complexity's sake.

I don't want to be hunting all over my code base just to figure out what is happening in a controller or component.

JPs styleguide is awesome!

Re:Web Programming Is Getting Unnecessarily Complicated by Silhouette on Tuesday July 19, 2016 @12:47AM (#12119749)
I like to hate on Big Web Frameworks as much as anyone, but it should be understood that their value isn't replacing your hand-rolled code, their value is to let big 20-person projects avoid having 20 different flavors of hand-rolled code.

Or we could just adopt good coding standards and build with reasonable software architecture. That's been working for longer than anything like the modern Web has existed, to build software orders of magnitude larger than any web app by any useful metric I can imagine, without the need to resort to huge frameworks to keep growing code bases organised and consistent.

Re:Web Programming Is Getting Unnecessarily Complicated by fenomas on Tuesday July 19, 2016 @04:23AM (#12120540)
Big Web Frameworks aren't there to "keep code bases organized and consistent", they're there to do stuff like render state changes into a complicated DOM without causing jank, without FOUCs, without crashing IE9, etc. Those aren't problems that "adopting good coding standards" can solve.

Web frameworks have architecture to them, but their value lies in solving technical problems, not architectural ones.

Re:Web Programming Is Getting Unnecessarily Complicated by Silhouette on Tuesday July 19, 2016 @10:10AM (#12121852)
Big Web Frameworks aren't there to "keep code bases organized and consistent", they're there to do stuff like render state changes into a complicated DOM without causing jank, without FOUCs, without crashing IE9, etc. Those aren't problems that "adopting good coding standards" can solve.

I respectfully disagree. You don't need a framework to do any of those things.

I do a lot of work with relatively complicated browser-based UIs. In my experience, the DOM/layout thrashing and jank issues that have been getting a lot of attention lately only became a big deal in the first place because the early frameworks were so horrifically slow compared to just doing manual updates of exactly what you needed to change. Even in the most demanding applications -- and not many web apps actually are this demanding -- you could achieve pleasant, smooth results with some modest attention to how you applied updates so you didn't cause the browser to regenerate layout unnecessarily. (This would be an example of a useful coding standard, BTW.)

Flashes of unstyled content/text/whatever are a symptom of serving web pages in chunks and how browsers render incrementally as more of the chunks are available. Again, dealing with these effects just requires some understanding of what causes them and a little care in how your site/app is served and does its initial setup. The frameworks don't do anything magic that you can't do in your own code.

And finally, we were solving cross-browser portability problems with script repositories and then libraries like jQuery a long time before any of the modern frameworks were on the scene, and in a much more varied environment in the early days. IE has certainly had its issues over the years, but for the most part at least the issues were well known and you could just work around them. And again, there weren't really that many horrible issues, and this was an area where having some basic coding standards worked OK even if for some reason you didn't want to just use one of the many utility libraries.

Re:Web Programming Is Getting Unnecessarily Complicated by tomc1985 on Tuesday July 19, 2016 @01:34AM (#12119954)
It's a format that doesn't lend itself very well to the current model of code-bootcamps-and-hello-world-tutorials.

Now that I think about it, the zeitgeist here really does feel like those cheesy "Learn C++ in just 20 minutes a day!!!!!" books

Re:Web Programming Is Getting Unnecessarily Complicated by Silhouette on Tuesday July 19, 2016 @01:49AM (#12120015)
The thing is, producing good software at any serious scale and maintaining it for any serious length of time needs more skill and understanding than you can learn from a 10 minute tutorial video and a couple of blog posts.

There seems to be a new generation of developers who think that 10,000 lines of code is a big program, a web app doesn't need to last more than a year or maybe two at most, and any sort of in-house programming or software design work will be inherently inferior to any external code you can import instead. These people are probably doomed no matter what they do.

There's a certain irony that in the one clear exception to that rule -- if you really are building a throwaway MVP in the expectation that it will either fail quickly or succeed enough be be worth rewriting properly later -- it mostly doesn't matter what tools or practices you follow. As long as you have some basic competence regarding security and you're keeping any important data somewhere safe so it can be transferred reliably to a new system later, the strategy is what it is. However, that also means many of the claimed advantages of frameworks are irrelevant to such projects, because you don't really care about things like longevity or being able to hire more developers already familiar with the framework or keeping growing teams consistent in how they design a growing code base.

Re:Web Programming Is Getting Unnecessarily Complicated by dozzie on Tuesday July 19, 2016 @04:35AM (#12120579)
> There seems to be a new generation of developers who think that 10,000 lines of code is a big program

This one made my day xD

10kLOC is a top limit for my programs (I say that whatever has higher line count starts boring me), and those were just small tools for sysadmins since forever.

Re:Web Programming Is Getting Unnecessarily Complicated by DougN7 on Monday July 18, 2016 @11:46PM (#12119453)
That's a really good point - it's very rare for someone else to need to use my web code.
Re:Web Programming Is Getting Unnecessarily Complicated by pavlov on Monday July 18, 2016 @09:20PM (#12118951)
I do that. Web dev is not my main focus, but I have to deal with it all the time. I try to attack the problems with an initial prototype that's a combination of plain HTML+JS and Node.js. Instead of a database, I tend to reuse a simple Javascript class I wrote a couple of years back that provides a minimalist layer of persistence for collections using an append-only file. (It's really just a single file I copy to any new projects when it's time to store something.)

Over 90% of the time that prototype turns out to be good enough, either because the problem is abandoned or remains at a level where a rewrite isn't worth it.

So far I haven't regretted not investing time into learning Framework X every few years... Although I'm probably going to start deploying React instead of plain JS soon. The library is very useful for real-world UI problems, even though it's surrounded by a deafening amount of toolchain fetishism which tends to cloud React's fundamental simplicity.

(I'm 36, started writing C in 1990 and HTML in 1995, so I feel somewhat old in this industry already.)

Re:Web Programming Is Getting Unnecessarily Complicated by msane on Monday July 18, 2016 @10:43PM (#12119213)
I recommend avoiding React. I have never seen an ecosystem so bogged down at every turn. It also has a bad zealot problem, where Facebook has cleverly brought a lot of people to it who haven't seen anything else and are convinced it is the bee's knees.

> The library is very useful for (?) UI problems...

Components are good. But they didn't come from React and React isn't the only place to get them. Angular 1/2, Polymer, Ember are great in comparison. And so much more simple. React's position on simplicity is that the demos on the site are all 15 lines so that means it's simple right? You can't say it's complicated because it's 15 lines, see? It's "easy to reason about", i.e., "you're not smart if you don't get it".

Once you see the toolchain and ecosystem you will glimpse the price of those 15 lines.

> ...toolchain fetishism which tends to cloud React's fundamental simplicity

This is a very real thing. People who work in React spend way more time fixing toolchain stuff and trying to mix 10 artisanal-crafted "easy to reason about" libraries in order to accomplish tasks which are either solved or not even issues in other component frameworks.

Re:Web Programming Is Getting Unnecessarily Complicated by Silhouette on Tuesday July 19, 2016 @12:58AM (#12119798)
I recommend avoiding React. I have never seen an ecosystem so bogged down at every turn.

It's perfectly possible to just use React on its own, without getting bogged down with all the other buzzword-of-the-week stuff around it.

React itself has been reasonably stable for a long time in Web terms. It is much more tightly scoped and smaller in its interface than most JS frameworks. There are a couple of major design trade-offs, which often seem to get overlooked in React advocacy, but if you have a bit of experience using it and understand the practical pros and cons then you can quickly decide whether the balance is favourable for some new project.

People who work in React spend way more time fixing toolchain stuff and trying to mix 10 artisanal-crafted "easy to reason about" libraries in order to accomplish tasks which are either solved or not even issues in other component frameworks.

Some people who work with React might. Plenty of others don't.

Re:Web Programming Is Getting Unnecessarily Complicated by anupshinde on Tuesday July 19, 2016 @01:14AM (#12119869)
React is great. But the tooling around it tends to complicate things a lot. Just for example react-redux (not just redux).

When I first started with React, it felt awesome - just React still feels great. But I had just started then and then got introduced to redux (I had been using something similar custom built). That was good too, until I learnt react-redux. I get the concepts, I understand every bit of it and have used it correctly in many large apps - it is useful. But react-redux just feels awkward many times and I consistently feel something is wrong with it - but I don't know what. React-Redux just feels disconnected with the idea of independent web-components.

On a side note - If one is okay moving to Typescript, Angular2 is just amazing.

Re:Web Programming Is Getting Unnecessarily Complicated by Silhouette on Tuesday July 19, 2016 @01:29AM (#12119933)
I find the Redux ecosystem to be one of those areas that sounds great in theory, but that in practice has quite a narrow range where it's a good fit. If the web app's data model is simple enough, it can easily keep track of mutable state directly and just rerender everything on any relevant change with acceptable performance. If the model is complicated enough, the simple data stores provided by Redux and the like lack power and flexibility until you build a lot of other architecture around them, at which point you might well be better off building something catering to your project's exact needs anyway. I can see that there might be a happy zone somewhere in between, where building with tools like Redux and its surrounding ecosystem does pay off, but I've yet to work on such a project myself.
Re:Web Programming Is Getting Unnecessarily Complicated by jiyinyiyong on Wednesday July 20, 2016 @10:45AM (#12129377)
Would you like to try Respo https://github.com/respo-mvc/respo/wiki/Quick-Start if you hold similar options with me? I built Respo because I think React is not functional enough.
Re:Web Programming Is Getting Unnecessarily Complicated by thegayngler on Tuesday July 19, 2016 @02:51AM (#12120239)
Polymer while I used to like it more isn't better than Web Components and for me was harder to use than both React and Web Components. React offers up more than both Polymer and Web Components spec. With web components it's still just a glop of JavaScript in a file. So I don't quite see the benefit of being "closer to the metal" when you are not closer to the metal. The community simply hasn't embraced Polymer. React is easy for me to understand and I can use it today and Web Components aren't really a necessity at that point nor are they even supported in browsers yet.
Re:Web Programming Is Getting Unnecessarily Complicated by microcolonel on Tuesday July 19, 2016 @12:03AM (#12119531)
I frankly don't see how you could come to the conclusion that Angular 2 components are simpler than React components. I mean, in React, a component can be as simple as const MyComponent = () => <span> some markup nonsense </span>;
Re:Web Programming Is Getting Unnecessarily Complicated by msane on Tuesday July 19, 2016 @01:23AM (#12119900)
Yup that's the argument mentioned: React is "simpler", "anyone can see"...

Brevity isn't simplicity. The simplicity is being easier to install, build, read about, debug, consume APIs with, send data between, talk about to other developers... and yes, "reason" about.

    myMod.component('Foo', {
      template: '<h1>{{$and.better.templating}} {{see()}}</h1>',
      controller: function() {
        var and = {this_one: 'does_stuff'};
      }
    });
Re:Web Programming Is Getting Unnecessarily Complicated by thegayngler on Tuesday July 19, 2016 @02:31AM (#12120181)
This is not easier to reason about than returning jsx IMO... It's only 1 of the ways to build an angular 2 component. The website tutorial is using decorator syntax. Typescript Angular 2 documentation. What's wrong with just learning JavaScript and less Angular specific syntax and tooling.

Maybe I'm wrong but I feel like Angular likes to force projects to become big monoliths where people who don't understand the problem being solved are trying to architect a solution for all of the problems.

React does have jsx shock and JavaScript tooling fatigue. However, now that React is mature JavaScript tooling decision fatigue should be less of an issue. You aren't relying on one company to solve problems. You have a community solving problems for themselves. As they need it they can add it or take it away.

Re:Web Programming Is Getting Unnecessarily Complicated by warfangle on Tuesday July 19, 2016 @07:07AM (#12121021)
Why aren't you just using an interpolated string?
Re:Web Programming Is Getting Unnecessarily Complicated by grumblestumble on Tuesday July 19, 2016 @04:43PM (#12124744)
"Over 90% of the time that prototype turns out to be good enough, either because the problem is abandoned or remains at a level where a rewrite isn't worth it."

You might want to spend some introspection time on that statement.

Re:Web Programming Is Getting Unnecessarily Complicated by pavlov on Tuesday July 19, 2016 @07:33PM (#12125746)
What do you mean by that?
Re:Web Programming Is Getting Unnecessarily Complicated by rco8786 on Monday July 18, 2016 @11:43PM (#12119433)
I hope your not pushing that to any meaningful production environment
Re:Web Programming Is Getting Unnecessarily Complicated by JustSomeNobody on Tuesday July 19, 2016 @08:18AM (#12121266)
Why?

Define "meaningful".

Re:Web Programming Is Getting Unnecessarily Complicated by kalleboo on Tuesday July 19, 2016 @12:36AM (#12119699)
Most of the web stuff I have to work on is developed once, and then maintained rarely (once a year or so). It's not the kind of project that has continuous development. So whenever I've used a framework or SDK, when it comes time to add a small feature or tweak, I spend more time bringing the project up to date with the latest version of the framework or SDK than I do implementing the feature.

Literally every time I update one of our sites using a Facebook SDK, they've changed around how the whole SDK is designed and I have to rewrite basic things like session management.

Re:Web Programming Is Getting Unnecessarily Complicated by polishninja on Tuesday July 19, 2016 @12:40AM (#12119716)
I've run into this issue multiple times as well.
Re:Web Programming Is Getting Unnecessarily Complicated by blub on Tuesday July 19, 2016 @12:52AM (#12119767)
I think there's a lot of social pressure from rockstar web developers to build and use JS libraries and frameworks.

Let's face it, classic front-end web development works fine and is well understood. Doesn't get you into conferences or help you sell courses.

So we get the web of today, piles of Javascript and unnecessary complexity all wrapped together with ads and tracking. And excuses about how today's customers expect an app-like experience.

Re:Web Programming Is Getting Unnecessarily Complicated by jasonthevillain on Tuesday July 19, 2016 @10:22AM (#12121927)
> And excuses about how today's customers expect an app-like experience

Yes. If anyone has evidence of this I'd love to see it.

Re:Web Programming Is Getting Unnecessarily Complicated by hajile on Monday July 18, 2016 @11:18PM (#12119340)
It's not so much a change in technology as it is a shift in focus.

If you or your company needs a basic website, then wordpress will almost always take you as far as you need to go. There's not a huge need for devs and nobody who's good at the web wants to be there because it's a race to the bottom financially. That part of the web (the overwhelming majority I might add) is pretty stagnant with few real changes or advancements having happened in the past decade.

Apps failed in that nobody wants to install your app on their device unless it's a game, a free utility, or one of a few popular apps made by large companies. WebOS got the idea of web technologies right, but the devices were too limited. Today, the idea of a web app that runs everywhere is very appealing and much more accessible to clients. All the new frameworks are really targeting this kind of use. Pounding the square that is web apps through the round hole that is the browser is hard, but still better than the alternatives.

If you're making a website, jQuery and simple JS is usually all you need. If you're making a web app with complex data and complex UI, you need a framework to keep things sane.

Re:Web Programming Is Getting Unnecessarily Complicated by blub on Tuesday July 19, 2016 @12:36AM (#12119701)
Web app with complex data = website that can be done very well with html, css and a server-side language.

It's only the complex UI which requires JS frameworks and libraries, but building such a UI is already a losing proposition and the main reason why web programming is getting "unnecessarily complicated".

Web developers think that web apps can compete with native applications - they still can't and in the process of trying to get them there, they turned the process of building websites into a mess.

Re:Web Programming Is Getting Unnecessarily Complicated by onion2k on Tuesday July 19, 2016 @01:42AM (#12119984)
Web app with complex data = website that can be done very well with html, css and a server-side language.

Only if you make a baseless assumption about the user's internet connection. Someone whose connection drops out regularly, or who faces periods without a connection at all, is going to hate your server-side app compared to my offline-first progressive web app that they can have cached on their device and that syncs their changes using pouchdb/couchdb.

My app will have a ton of JS that yours doesn't, but that extra code makes it work when they're not online. That's a huge advantage.

Not all progress is designed for added shininess. Some of the changes that are happening are designed to fix real problems that people face.

Re:Web Programming Is Getting Unnecessarily Complicated by blub on Tuesday July 19, 2016 @05:16AM (#12120719)
I think that when one is developing a web-based product, a working internet connection is a very reasonable assumption.

If that's not the case, it's pointless to create a web-based product. Just offer the full thing as an app and a simple web UI.

I looked at the WaPo link that you posted and it seems to be exactly this type of product with an identity crysis - my browser already allows me to save pages for later reading and if that won't work, there are a multitude of offline reading apps to choose from, I don't need a WaPo "progressively enhanced" app for that.

Re:Web Programming Is Getting Unnecessarily Complicated by antimatter on Tuesday July 19, 2016 @02:25AM (#12120153)
I keep seeing this use case of JS heavy web apps but have yet to come across one in production that adds any value when offline. Can you provide an example?
Re:Web Programming Is Getting Unnecessarily Complicated by onion2k on Tuesday July 19, 2016 @03:05AM (#12120274)
Re:Web Programming Is Getting Unnecessarily Complicated by flukus on Tuesday July 19, 2016 @01:48AM (#12120008)
Assuming all the required data is reachable offline, which would make the choice of a web app very questionable.
Re:Web Programming Is Getting Unnecessarily Complicated by onion2k on Tuesday July 19, 2016 @03:15AM (#12120296)
What work is required to make an app fulfill it's need is mostly very similar regardless of what delivery mechanism you use to get it to the user. Native has a few advantages (performance, build tools, layout libraries, etc), but if all you need is available on a web app platform and the performance is good enough then a web app can still be a very good choice, namely because the code assets easily can be shared with other web offerings and there's vastly more available developers to do the job so hiring someone to write it is much, much easier (assuming you're not outsourcing it).

There are a lot of things that you have to do regardless of how the app is delivered - you need to work out what the app actually needs to do, you need to design the business logic, you need to design the look and feel, you need to get the UX right, you have to throughly test it. On a decent size app, the job of actually writing the code is about 25% of the work required. In my opinion, something that represents a quarter of the project probably shouldn't drive the entire process.

Re:Web Programming Is Getting Unnecessarily Complicated by flukus on Tuesday July 19, 2016 @03:33AM (#12120351)
The apis and libraries for an offline app are very different to an online one. If you build an offline app as a html/js app then good like finding libraries for common tasks, like file system access.
Re:Web Programming Is Getting Unnecessarily Complicated by onion2k on Tuesday July 19, 2016 @03:50AM (#12120433)
When I'm talking about offline-first progressive web apps I'm not referring to something that would load data from a file system.

https://developers.google.com/web/fundamentals/getting-start...

As it is though, the API for file system access in JS might not be standard yet (and might never be) but it works well in Chrome: https://developer.mozilla.org/en-US/docs/Web/API/File_System...

Re:Web Programming Is Getting Unnecessarily Complicated by Bahamut on Tuesday July 19, 2016 @02:31AM (#12120183)
There are many web apps that make zero sense to write a native app for. For example, my company's product is an LMS - the administrator side is not something that makes much sense to make a mobile app for iOS and Android, as one has to create/manage courses, manage users, and view useful displays of data (i.e. charts). Instead, we have a web app that degrades acceptably for mobile, losing such features as multiple selections for modification (it has a lot of grids).

For such an app, having a longer load upfront in order to facilitate vastly better UX than using purely server-side rendered pages is a huge win for our customers, and having the time to load & interact being low also adds tremendous value to the customers, to the point that they flock to us over our competitors.

I don't find myself having a problem with frontend web app architecture - most of the problems out there are already solved or solvable with a little time spent on thought, but the knowledge is not widespread, and so we have a lot of people who have never seen what good structure looks like.

Re:Web Programming Is Getting Unnecessarily Complicated by blub on Tuesday July 19, 2016 @05:21AM (#12120731)
I don't know what's best for your customers, I assume the company did usability studies and drew conclusions from that.

There's always cases where it makes sense to make use of particular technologies. It absolutely does not make sense to transform most websites into web apps that are completely broken without JavaScript, which is what's happening right now.

Re:Web Programming Is Getting Unnecessarily Complicated by abledon on Thursday July 21, 2016 @11:35AM (#12137526)
what LMS if i may ask?
Re:Web Programming Is Getting Unnecessarily Complicated by pbreit on Tuesday July 19, 2016 @03:35AM (#12120361)
I'm still sort of a newbie but I have found it much much easier for me to quickly build my projects on the very very easy to use Web2py Python framework. The things I like are: defining my DB structure in simple code, no routing (routing is implied by file & function names), Python, HTML views with simple embedded code (including full Python if need/want).
Re:Web Programming Is Getting Unnecessarily Complicated by johnloeber on Monday July 18, 2016 @09:17PM (#12118937)
That's the approach I took to hand-rolling my personal website. All I care about is delivering my content reasonably well -- the elegance or modernity of the underlying engineering seems irrelevant. (Not to mention that this minimizes website bloat...)
Re:Web Programming Is Getting Unnecessarily Complicated by notliketherest on Tuesday July 19, 2016 @12:15AM (#12119599)
wow this attitude is so sad! React + Redux - changed my whole outlook on web development and it's actually a joy again. Take a little bit of time, read, learn, figure out a simple webpack script, and you're gonna love life.